diff --git a/README.md b/README.md index b10d2306..dabbc28a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ From left to right: Refraction, ambient occlusion and reflection: ![Refraction, ambient occlusion and reflection](docs/images/header.svg) -Quadtree intersection of 2d triangle meshes: +Quadtree intersection of 2D triangle meshes: ![Quadtree](docs/images/quadtree_StopSplitIfAtLeastTwoChildsHaveAsManySubShapesAsParent.svg) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5cab5816..6800aa46 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,6 +20,16 @@ jobs: steps: - template: devertexwahn/ci/macOS-13-apple-clang14.yaml + # macOS 14/M1 is still not supported on Azure Pipelines + # consult documentation for Microsoft-hosted agents: + # https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml + #- job: MacOSAppleClang14Sonoma + # displayName: "Apple Clang14 on macOS 14 (Sonoma)" + # pool: + # vmImage: 'macOS-14' + # steps: + # - template: devertexwahn/ci/macOS-14-apple-clang14.yaml + #- job: Ubuntu20Clang14 # displayName: "Clang14 on Ubuntu 20.04" @@ -31,7 +41,6 @@ jobs: - job: Ubuntu20GCC9Fast displayName: "GCC9 fast on Ubuntu 20.04" pool: - #name: Default vmImage: 'ubuntu-20.04' steps: - template: devertexwahn/ci/ubuntu-20.04-gcc9-fast.yaml @@ -39,19 +48,57 @@ jobs: - job: Ubuntu20GCC9Opt displayName: "GCC9 opt on Ubuntu 20.04" pool: - #name: Default vmImage: 'ubuntu-20.04' steps: - template: devertexwahn/ci/ubuntu-20.04-gcc9-opt.yaml - - job: Ubuntu20GCC9Debug - displayName: "GCC9 debug on Ubuntu 20.04" + - job: Ubuntu20GCC9DebugPart1 + displayName: "GCC9 debug on Ubuntu 20.04 (Part 1)" pool: - #name: Default vmImage: 'ubuntu-20.04' steps: - - template: devertexwahn/ci/ubuntu-20.04-gcc9-dbg.yaml + - template: devertexwahn/ci/ubuntu-20.04-gcc9-dbg-part1.yaml + - job: Ubuntu20GCC9DebugPart2 + displayName: "GCC9 debug on Ubuntu 20.04 (Part 2)" + pool: + vmImage: 'ubuntu-20.04' + steps: + - template: devertexwahn/ci/ubuntu-20.04-gcc9-dbg-part2.yaml + + - job: Ubuntu22BazelQuery + displayName: "Bazel query on Ubuntu 22.04" + pool: + vmImage: 'ubuntu-22.04' + steps: + - template: devertexwahn/ci/ubuntu-22.04-bazel-query.yaml + + - job: Ubuntu22Clang16 + displayName: "Clang16 on Ubuntu 22.04" + pool: + vmImage: 'ubuntu-22.04' + steps: + - template: devertexwahn/ci/ubuntu-22.04-clang16.yaml + + - job: Ubuntu22Coverage + displayName: "Coverage with LCOV/GCC11 on Ubuntu 22.04" + pool: + vmImage: 'ubuntu-22.04' + steps: + - template: devertexwahn/ci/ubuntu-22.04-coverage.yaml + #- job: Ubuntu22Docker + # displayName: "aarch64 Docker" + # pool: + # vmImage: 'ubuntu-22.04' + # steps: + # - template: devertexwahn/ci/ubuntu-22.04-docker-aarch64.yaml + + - job: Ubuntu22Bzlmod + displayName: "Bzlmod on Ubuntu 22.04" + pool: + vmImage: 'ubuntu-22.04' + steps: + - template: devertexwahn/ci/ubuntu-22.04-gcc11-bzlmod.yaml - job: Ubuntu22GCC11 displayName: "GCC11 fast opt on Ubuntu 22.04" @@ -60,20 +107,19 @@ jobs: steps: - template: devertexwahn/ci/ubuntu-22.04-gcc11-fast-opt.yaml - - job: Ubuntu22GCC11Debug - displayName: "GCC11 dbg on Ubuntu 22.04" + - job: Ubuntu22GCC11DebugPart1 + displayName: "GCC11 dbg on Ubuntu 22.04 (Part 1)" pool: vmImage: 'ubuntu-22.04' steps: - - template: devertexwahn/ci/ubuntu-22.04-gcc11-dbg.yaml + - template: devertexwahn/ci/ubuntu-22.04-gcc11-dbg-part1.yaml - - job: Ubuntu22Clang14 - displayName: "Clang14 on Ubuntu 22.04" + - job: Ubuntu22GCC11DebugPart2 + displayName: "GCC11 dbg on Ubuntu 22.04 (Part 2)" pool: vmImage: 'ubuntu-22.04' steps: - - template: devertexwahn/ci/ubuntu-22.04-clang14.yaml - + - template: devertexwahn/ci/ubuntu-22.04-gcc11-dbg-part2.yaml # Visual Studio 2019 - job: VisualStudio2019Dbg diff --git a/devertexwahn/.bazelrc b/devertexwahn/.bazelrc index b822ee7f..9ef7c19a 100644 --- a/devertexwahn/.bazelrc +++ b/devertexwahn/.bazelrc @@ -1,5 +1,5 @@ # -# SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann +# SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann # SPDX-License-Identifier: Apache-2.0 # @@ -13,10 +13,9 @@ # Bzlmod #------------------------------------------------------------------------------------- -common --enable_bzlmod -#common --registry=file:///%workspace%/registry -common --registry=https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/ # Check if this makes Windows happy -common --registry=https://raw.githubusercontent.com/bazelboost/registry/main +#common --registry=file:///%workspace%/registry # Does not work on Windows 11 + Bazel 6.5.0 +#common --registry=https://vertexwahn.de/registry +common --registry=https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/ # Needed for Boost common --registry=https://bcr.bazel.build @@ -25,11 +24,12 @@ common --registry=https://bcr.bazel.build #------------------------------------------------------------------------------------- # macOS (e.g. Clang 14.0.0) -build:macos --cxxopt=-std=c++2b # see https://clang.llvm.org/cxx_status.html -build:macos --cxxopt=-Wall +build:macos --cxxopt=-std=c++2b # see https://clang.llvm.org/cxx_status.html +build:macos --cxxopt=-Wall # Turn on all warnings build:macos --define compiler=macos +build:macos --noincompatible_enable_cc_toolchain_resolution # disable LLVM toolchain #build:macos --cxxopt=-Werror # Commented out because of Embree -##build:macos --cxxopt=-Wextra +#build:macos --cxxopt=-Wextra #build:macos --spawn_strategy=local # Xcode 15 has some compiler issues - therefore there is this special config @@ -38,20 +38,17 @@ build:macos_xcode15 --linkopt=-ld_classic # Workaround for Xcode 15 linker bug, # macOS Intel (config used in CI jobs) build:clang14_macos --cxxopt=-std=c++20 -#build:clang14 --cxxopt=-mavx -#build:clang14 --cxxopt=-mavx2 -#build:clang14 --cxxopt=-msse4.2 -#build:clang14 --cxxopt=-Werror -build:clang14_macos --incompatible_enable_cc_toolchain_resolution +build:clang14_macos --noincompatible_enable_cc_toolchain_resolution # disable LLVM toolchain build:clang14_macos --cxxopt=-mwaitpkg build:clang14_macos --define compiler=clang14_macos -# macOS M1 (config is used on local MacBook M1 Pro) -build:clang14_macos_m1 --cxxopt=-std=c++20 -build:clang14_macos_m1 --incompatible_enable_cc_toolchain_resolution -build:clang14_macos_m1 --linkopt=-ld_classic # Workaround for Xcode 15 linker bug, see for instance https://github.com/godotengine/godot/pull/81968/files -#build:clang14_macos_m1 --cxxopt=-mwaitpkg # lead to compilation issues on local M1 macBook -build:clang14_macos_m1 --define compiler=clang14_macos_m1 +# not used anymore? Todo: Remove this config if it is not needed anymore +## macOS M1 (config is used on local MacBook M1 Pro) +#build:clang14_macos_m1 --cxxopt=-std=c++20 +#build:clang14_macos_m1 --incompatible_enable_cc_toolchain_resolution +#build:clang14_macos_m1 --linkopt=-ld_classic # Workaround for Xcode 15 linker bug, see for instance https://github.com/godotengine/godot/pull/81968/files +##build:clang14_macos_m1 --cxxopt=-mwaitpkg # lead to compilation issues on local M1 macBook +#build:clang14_macos_m1 --define compiler=clang14_macos_m1 # Todo: Add apple_debug config # https://github.com/RobotLocomotion/drake/search?q=apple_debug @@ -60,6 +57,7 @@ build:clang14_macos_m1 --define compiler=clang14_macos_m1 build:gcc9 --cxxopt=-std=c++2a build:gcc9 --cxxopt=-Wall build:gcc9 --define compiler=gcc9 +build:gcc9 --noincompatible_enable_cc_toolchain_resolution # disable LLVM toolchain #build:gcc9 --cxxopt=-Werror # blocked by googletest ##build:gcc9 --cxxopt=-Wextra @@ -68,12 +66,13 @@ build:remote_gcc9 --cxxopt=-Werror build:remote_gcc9 --define compiler=remote_gcc9 ##build:remote_gcc9 --cxxopt=-Wextra -# GCC 11.3 +# GCC 11.4 #build:gcc11 --cxxopt=-std=c++23 # blocked by emsdk build:gcc11 --cxxopt=-std=c++20 build:gcc11 --cxxopt=-Wall build:gcc11 --define compiler=gcc11 build:gcc11 --cxxopt=-fpermissive # Needed for fmt +build:gcc11 --noincompatible_enable_cc_toolchain_resolution # disable LLVM toolchain #build:gcc11 --cxxopt=-Werror #build:gcc11 --cxxopt=-Wno-volatile # blocked by emsdk ##build:gcc11 --cxxopt=-Wextra @@ -97,6 +96,19 @@ build:clang14 --features=-libtool build:clang14 --cxxopt=-mwaitpkg build:clang14 --define compiler=clang14 +# Clang 16.0.0 (config is used on Ubuntu) +build:clang16 --cxxopt=-std=c++20 +#build:clang16 --cxxopt=-mavx +#build:clang16 --cxxopt=-mavx2 +#build:clang16 --cxxopt=-msse4.2 +#build:clang16 --cxxopt=-Werror +build:clang16 --incompatible_enable_cc_toolchain_resolution +# Tell Bazel to pass the right flags for llvm-ar, not libtool. Only needed if you are building on darwin. +# See https://github.com/bazelbuild/bazel/blob/5c75d0acec21459bbb13520817e3806e1507e907/tools/cpp/unix_cc_toolchain_config.bzl#L1000-L1024 +build:clang16 --features=-libtool +build:clang16 --cxxopt=-mwaitpkg +build:clang16 --define compiler=clang14 + # MinGW build:mingw --cxxopt=-std=c++2a #build:mingw --cxxopt=-Wall diff --git a/devertexwahn/.bazelversion b/devertexwahn/.bazelversion index 19b860c1..21c8c7b4 100644 --- a/devertexwahn/.bazelversion +++ b/devertexwahn/.bazelversion @@ -1 +1 @@ -6.4.0 +7.1.1 diff --git a/devertexwahn/MODULE.bazel b/devertexwahn/MODULE.bazel index ba31e4b9..9f7123bb 100644 --- a/devertexwahn/MODULE.bazel +++ b/devertexwahn/MODULE.bazel @@ -5,50 +5,58 @@ module( version = "0.0.1", ) -# Wait until abseil-cpp has a MODULE.bazel file - maybe we need to wait for Bazel 8 here... -#bazel_dep( -# name = "abseil-cpp", -# version = "20230802.0", -#) - -# Does not compile on windows, does not uses nasm to build -# bazel_dep( name = "libjpeg_turbo", version = "2.1.91",) - -bazel_dep(name = "apple_support", version = "1.11.1") +bazel_dep(name = "abseil-cpp", version = "20240116.2") +bazel_dep(name = "apple_support", version = "1.15.1") +bazel_dep(name = "autodiff", version = "1.0.3") bazel_dep(name = "bazel_skylib", version = "1.5.0") -bazel_dep(name = "boost.algorithm", version = "1.83.0.bzl.1") -bazel_dep(name = "boost.core", version = "1.83.0.bzl.1") -bazel_dep(name = "boost.predef", version = "1.83.0.bzl.1") +bazel_dep(name = "boost.algorithm", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.asio", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.core", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.predef", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.program_options", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.uuid", version = "1.83.0.bcr.1") bazel_dep(name = "eigen", version = "3.4.0") -bazel_dep(name = "embree", version = "4.3.0") +bazel_dep(name = "embree", version = "4.3.1") +bazel_dep(name = "flip", version = "1.3") +bazel_dep(name = "fmt", version = "10.2.1") bazel_dep(name = "gazelle", version = "0.35.0") -bazel_dep(name = "imath", version = "3.1.9", repo_name = "Imath") -bazel_dep(name = "libdeflate", version = "1.19") +bazel_dep(name = "glog", version = "0.7.0") +bazel_dep(name = "hypothesis") +bazel_dep(name = "imath", version = "3.1.11") +bazel_dep(name = "libdeflate", version = "1.20.bcr.1") bazel_dep(name = "libjpeg_turbo", version = "2.1.4") -bazel_dep(name = "libpng", version = "1.6.40") +bazel_dep(name = "libpng", version = "1.6.43") bazel_dep(name = "libwebp", version = "1.3.2") bazel_dep(name = "nasm", version = "2.14.02") bazel_dep(name = "nlohmann_json", version = "3.11.3") -bazel_dep(name = "openexr", version = "3.2.1") -bazel_dep(name = "platforms", version = "0.0.8") +bazel_dep(name = "openexr", version = "3.2.4") +bazel_dep(name = "pcg") +bazel_dep(name = "platforms", version = "0.0.9") bazel_dep(name = "pugixml", version = "1.14") bazel_dep(name = "rules_cc", version = "0.0.9") -bazel_dep(name = "rules_go", version = "0.44.0") -bazel_dep(name = "rules_license", version = "0.0.7") -bazel_dep(name = "rules_oci", version = "1.5.1") -bazel_dep(name = "rules_pkg", version = "0.9.1") -bazel_dep(name = "zlib", version = "1.3") +bazel_dep(name = "rules_license", version = "0.0.8") +bazel_dep(name = "rules_pkg", version = "0.10.1") +bazel_dep(name = "rules_python", version = "0.31.0") +bazel_dep(name = "xtensor") +bazel_dep(name = "xtl") +bazel_dep(name = "yaml-cpp", version = "0.8.0") +bazel_dep(name = "zlib", version = "1.3.1.bcr.1") -bazel_dep(name = "container_structure_test", version = "1.16.0", dev_dependency = True) +bazel_dep(name = "catch2", version = "3.5.4", dev_dependency = True) +bazel_dep(name = "google_benchmark", version = "1.8.3", dev_dependency = True) bazel_dep(name = "googletest", version = "1.14.0.bcr.1", dev_dependency = True) -#bazel_dep(name = "catch2", version = "3.4.0", dev_dependency = True) -#bazel_dep(name = "fmt", version = "10.1.1") -#bazel_dep(name = "toolchains_llvm", version = "0.10.1") +# This projects intends to stay as close as possible to upstream dependencies (Live at Head). Therefore, upstream +# dependencies are copied on a regular basis 1:1 with some Bazel related patches (if needed) to the `third_party` folder +# and overridden here. If you do not like this approach you can simply remove most of the local_path_override's here and +# live with the newest versions in the BCR (which can be much older). +# Note: Some dependencies are not part in the BCR (such as pcg or xtl) and therefore the local_path_override is needed +# here for some libraries. -# This projects intends to stay as close as possible to upstream dependencies. -# Therefore, upstream dependencies are copied 1:1 to the `third_party` folder and -# overridden here: +local_path_override( + module_name = "abseil-cpp", + path = "../third_party/abseil-cpp", +) local_path_override( module_name = "bazel_skylib", @@ -56,8 +64,28 @@ local_path_override( ) local_path_override( - module_name = "autodiff", - path = "../third_party/autodiff", + module_name = "fmt", + path = "../third_party/fmt", +) + +local_path_override( + module_name = "imath", + path = "../third_party/Imath", +) + +local_path_override( + module_name = "glog", + path = "../third_party/glog", +) + +local_path_override( + module_name = "libpng", + path = "../third_party/libpng-1.6.43", +) + +local_path_override( + module_name = "hypothesis", + path = "../third_party/hypothesis", ) local_path_override( @@ -66,7 +94,72 @@ local_path_override( ) local_path_override( - module_name = "rules_pkg", - path = "../third_party/rules_pkg-0.9.1", + module_name = "pcg", + path = "../third_party/pcg-cpp", +) + +local_path_override( + module_name = "pugixml", + path = "../third_party/pugixml", +) + +local_path_override( + module_name = "xtensor", + path = "../third_party/xtensor", +) + +local_path_override( + module_name = "xtl", + path = "../third_party/xtl", +) + +local_path_override( + module_name = "yaml-cpp", + path = "../third_party/yaml-cpp", +) + +local_path_override( + module_name = "catch2", + path = "../third_party/Catch2", +) + +#------------------------------------------------------------------------------------- +# LLVM toolchain for bazel +#------------------------------------------------------------------------------------- + +bazel_dep(name = "toolchains_llvm", version = "0.10.3") +git_override( + module_name = "toolchains_llvm", + commit = "bba94f8138ab454d70afcd263788b34e2801e2ba", + remote = "https://github.com/bazel-contrib/toolchains_llvm.git", ) +bazel_dep(name = "rules_foreign_cc", version = "0.10.1") + +# Configure and register the toolchain. +llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm") + +LLVM_VERSIONS = { + "": "16.0.0", # Default version 16.0.0 + "darwin-aarch64": "16.0.5", + "darwin-x86_64": "15.0.7", +} + +llvm.toolchain( + name = "llvm_toolchain", + llvm_versions = LLVM_VERSIONS, +) +use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm") + +register_toolchains("@llvm_toolchain//:all") + +#------------------------------------------------------------------------------------- +# Python +#------------------------------------------------------------------------------------- + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") + +#python.toolchain( +# python_version = "3.11", +#) +use_repo(python, "python_versions") diff --git a/devertexwahn/MODULE.bazel.lock b/devertexwahn/MODULE.bazel.lock new file mode 100644 index 00000000..35788a8c --- /dev/null +++ b/devertexwahn/MODULE.bazel.lock @@ -0,0 +1,8640 @@ +{ + "lockFileVersion": 6, + "moduleFileHash": "07ba4d562917b962f8eb149e92187501ec67f014d09cc5a3d724af404a91499b", + "flags": { + "cmdRegistries": [ + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/", + "https://bcr.bazel.build" + ], + "cmdModuleOverrides": {}, + "allowedYankedVersions": [], + "envVarAllowedYankedVersions": "", + "ignoreDevDependency": false, + "directDependenciesMode": "WARNING", + "compatibilityMode": "ERROR" + }, + "localOverrideHashes": { + "openexr": "73f828c33de1b9bb672765a18a28f6f6d786f85b11125ad25d8fe795015fb725", + "libpng": "9035a3007a7b77b93f055cfb486df3936643320a0204055adb0522da3e0cb09e", + "imath": "18286fd8b55f57775e4386a2c9f01cc0e7f36bf69d95f14fdbcd18817bfdfee8", + "catch2": "d9f18fac17d966ca0f906f6f8307732cf3adc9923c3e1db1a9accd7b5e30a811", + "fmt": "578e2f6966a8bbed4ddb5808847d348ec9e6585b49a33ccfc23b4d1b5aac765b", + "glog": "29ebd254eddb72368db5dacead55b68de7c846eef9e77128fa967e889331eb47", + "pugixml": "6a377479526e97330476888779182b79dc5c0d50e420fd5c6343850968cfc94a", + "yaml-cpp": "879443fbbf128457a187bea6f278d05789f3fc465bb22c2e0fe7fdb52e45eef0", + "bazel_skylib": "6afe9c575e9a699b8d85771bc57d05fc0014c7d35bbccc30002f5e68981b6d9e", + "xtensor": "28df91a9a6196aed6311beee6992213a19092d65a62848f4ecfe85b45c6527c5", + "xtl": "29bc3cfd99a0597b2711e4dd0e1e2ea7fe0f47943a1518c1cec06b9c97745c52", + "pcg": "9ed20c51dde92c498f162f921238617ede92a144ac9dec66ea7fcf0786a46b64", + "bazel_tools": "1ae69322ac3823527337acf02016e8ee95813d8d356f47060255b8956fa642f0", + "abseil-cpp": "08efe2f96a99547f5d4077b31a7caf9719cf2f2da6b259fbf58c7e22b02e026b", + "hypothesis": "032d7eddfe76a10d41b26cff46a3962d1e222e008417fca97efbd833b88e0974" + }, + "moduleDepGraph": { + "": { + "name": "de_vertexwahn", + "version": "0.0.1", + "key": "", + "repoName": "de_vertexwahn", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@llvm_toolchain//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@toolchains_llvm//toolchain/extensions:llvm.bzl", + "extensionName": "llvm", + "usingModule": "", + "location": { + "file": "@@//:MODULE.bazel", + "line": 140, + "column": 21 + }, + "imports": { + "llvm_toolchain": "llvm_toolchain", + "llvm_toolchain_llvm": "llvm_toolchain_llvm" + }, + "devImports": [], + "tags": [ + { + "tagName": "toolchain", + "attributeValues": { + "name": "llvm_toolchain", + "llvm_versions": { + "": "16.0.0", + "darwin-aarch64": "16.0.5", + "darwin-x86_64": "15.0.7" + } + }, + "devDependency": false, + "location": { + "file": "@@//:MODULE.bazel", + "line": 148, + "column": 15 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_python//python/extensions:python.bzl", + "extensionName": "python", + "usingModule": "", + "location": { + "file": "@@//:MODULE.bazel", + "line": 160, + "column": 23 + }, + "imports": { + "python_versions": "python_versions" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "abseil-cpp": "abseil-cpp@_", + "apple_support": "apple_support@1.15.1", + "autodiff": "autodiff@1.0.3", + "bazel_skylib": "bazel_skylib@_", + "boost.algorithm": "boost.algorithm@1.83.0.bcr.1", + "boost.asio": "boost.asio@1.83.0.bcr.1", + "boost.core": "boost.core@1.83.0.bcr.1", + "boost.predef": "boost.predef@1.83.0.bcr.1", + "boost.program_options": "boost.program_options@1.83.0.bcr.1", + "boost.uuid": "boost.uuid@1.83.0.bcr.1", + "eigen": "eigen@3.4.0", + "embree": "embree@4.3.1", + "flip": "flip@1.3", + "fmt": "fmt@_", + "gazelle": "gazelle@0.35.0", + "glog": "glog@_", + "hypothesis": "hypothesis@_", + "imath": "imath@_", + "libdeflate": "libdeflate@1.20.bcr.1", + "libjpeg_turbo": "libjpeg_turbo@2.1.4", + "libpng": "libpng@_", + "libwebp": "libwebp@1.3.2", + "nasm": "nasm@2.14.02", + "nlohmann_json": "nlohmann_json@3.11.3", + "openexr": "openexr@_", + "pcg": "pcg@_", + "platforms": "platforms@0.0.9", + "pugixml": "pugixml@_", + "rules_cc": "rules_cc@0.0.9", + "rules_license": "rules_license@0.0.8", + "rules_pkg": "rules_pkg@0.10.1", + "rules_python": "rules_python@0.31.0", + "xtensor": "xtensor@_", + "xtl": "xtl@_", + "yaml-cpp": "yaml-cpp@_", + "zlib": "zlib@1.3.1.bcr.1", + "catch2": "catch2@_", + "google_benchmark": "google_benchmark@1.8.3", + "googletest": "googletest@1.14.0.bcr.1", + "toolchains_llvm": "toolchains_llvm@_", + "rules_foreign_cc": "rules_foreign_cc@0.10.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "abseil-cpp@_": { + "name": "abseil-cpp", + "version": "head", + "key": "abseil-cpp@_", + "repoName": "abseil-cpp", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "abseil-cpp@_", + "location": { + "file": "@@abseil-cpp~//:MODULE.bazel", + "line": 23, + "column": 29 + }, + "imports": { + "local_config_cc": "local_config_cc" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "com_google_googletest": "googletest@1.14.0.bcr.1", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "apple_support@1.15.1": { + "name": "apple_support", + "version": "1.15.1", + "key": "apple_support@1.15.1", + "repoName": "build_bazel_apple_support", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_apple_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl", + "extensionName": "apple_cc_configure_extension", + "usingModule": "apple_support@1.15.1", + "location": { + "file": "https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel", + "line": 19, + "column": 35 + }, + "imports": { + "local_config_apple_cc": "local_config_apple_cc", + "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/apple_support/releases/download/1.15.1/apple_support.1.15.1.tar.gz" + ], + "integrity": "sha256-xLsrc2fEhDgjAK7nW+WYuS+EeJb7MbvSLzojRq32aoA=", + "strip_prefix": "", + "remote_patches": { + "https://bcr.bazel.build/modules/apple_support/1.15.1/patches/module_dot_bazel_version.patch": "sha256-FvMGp1f0FT1IT38LFbWGUqe5fukTvEyug2Puhimca74=" + }, + "remote_patch_strip": 1 + } + } + }, + "autodiff@1.0.3": { + "name": "autodiff", + "version": "1.0.3", + "key": "autodiff@1.0.3", + "repoName": "autodiff", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "com_github_eigen_eigen": "eigen@3.4.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/autodiff/autodiff/archive/refs/tags/v1.0.3.tar.gz" + ], + "integrity": "sha256-IbV85ghkhXkTysuFbDlzrhD3U5trsAvMBPhbLwDbDOI=", + "strip_prefix": "autodiff-1.0.3", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/autodiff/1.0.3/patches/add_module_dot_bazel.patch": "sha256-8Jkc6F5nUWaac3Ac4viES+YUd+z1zPIX7DA7WgDOvzI=" + }, + "remote_patch_strip": 0 + } + } + }, + "bazel_skylib@_": { + "name": "bazel_skylib", + "version": "1.5.0", + "key": "bazel_skylib@_", + "repoName": "bazel_skylib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains/unittest:cmd_toolchain", + "//toolchains/unittest:bash_toolchain" + ], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "boost.algorithm@1.83.0.bcr.1": { + "name": "boost.algorithm", + "version": "1.83.0.bcr.1", + "key": "boost.algorithm@1.83.0.bcr.1", + "repoName": "boost.algorithm", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/algorithm/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-N32JpqRiblBC1x5p4m/GNe6d/DGEZRR+eUsJ6o0+gp8=", + "strip_prefix": "algorithm-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.algorithm/1.83.0.bcr.1/patches/patch.diff": "sha256-bydTCyPmYqLtMDzpcZ7SqeI4rbAN37kb6tbhRsOuS6o=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.asio@1.83.0.bcr.1": { + "name": "boost.asio", + "version": "1.83.0.bcr.1", + "key": "boost.asio@1.83.0.bcr.1", + "repoName": "boost.asio", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "boringssl": "boringssl@0.0.0-20230215-5c22014", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/asio/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-/mOmHwuTI67iCQpPW6yY7g+0X9L/4xYQXCbfVNAbtj8=", + "strip_prefix": "asio-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.asio/1.83.0.bcr.1/patches/patch.diff": "sha256-bsyKYqtnuIJH8XIHfk1nrWt2MccnbMcphK7xarRVe94=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.core@1.83.0.bcr.1": { + "name": "boost.core", + "version": "1.83.0.bcr.1", + "key": "boost.core@1.83.0.bcr.1", + "repoName": "boost.core", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "boost.serialization": "boost.serialization@1.83.0.bcr.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/core/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-gAOK9OlsjOfK1jY+8boC3FEBf9qDKKzlmKPNQ9lxOjg=", + "strip_prefix": "core-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.core/1.83.0.bcr.1/patches/patch.diff": "sha256-RbHxclBqfFSVpjpay2jLPesnHJa7x+VZTWxFKWJrbmQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.predef@1.83.0.bcr.1": { + "name": "boost.predef", + "version": "1.83.0.bcr.1", + "key": "boost.predef@1.83.0.bcr.1", + "repoName": "boost.predef", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/predef/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-wNijX5JYhG+dqlEcDeBS/M4MiNvh5pfzBHEYwx+hOFQ=", + "strip_prefix": "predef-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.predef/1.83.0.bcr.1/patches/patch.diff": "sha256-12zioDGTVgkdDmFQKcxvBBz603G1Hy4Y8m4EiINzI6o=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.program_options@1.83.0.bcr.1": { + "name": "boost.program_options", + "version": "1.83.0.bcr.1", + "key": "boost.program_options@1.83.0.bcr.1", + "repoName": "boost.program_options", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/program_options/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-2EN+J4h3kekduKqeVhbJOuX3kvA0ftAiBTipkSYkjMY=", + "strip_prefix": "program_options-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.program_options/1.83.0.bcr.1/patches/patch.diff": "sha256-kyZCqK0G216QdI7XlyqCDohjn5Iw6yLHjfZ6CiIibiQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.uuid@1.83.0.bcr.1": { + "name": "boost.uuid", + "version": "1.83.0.bcr.1", + "key": "boost.uuid@1.83.0.bcr.1", + "repoName": "boost.uuid", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/uuid/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-D9kSkan1QR0Jf4gR5hNz3xPU4b6EWNWLLIas9CYVPBY=", + "strip_prefix": "uuid-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.uuid/1.83.0.bcr.1/patches/patch.diff": "sha256-KcTC+yRzBY/RD+U+aBF7NBuAA+B5rUEQNcFq+TYCQVY=" + }, + "remote_patch_strip": 1 + } + } + }, + "eigen@3.4.0": { + "name": "eigen", + "version": "3.4.0", + "key": "eigen@3.4.0", + "repoName": "eigen", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip" + ], + "integrity": "sha256-HMqrv+hw9grz1qUZxT4J89z2MCBzId/6VTVkqOdcT8g=", + "strip_prefix": "eigen-3.4.0", + "remote_patches": { + "https://bcr.bazel.build/modules/eigen/3.4.0/patches/add_build_file.patch": "sha256-wuOxV4nxufkyDCw+HWCn5D9vik84RuLacFT5ashhC58=", + "https://bcr.bazel.build/modules/eigen/3.4.0/patches/module_dot_bazel.patch": "sha256-xDle81SJcU6payWsaWbrWyrFbalx9tSW4bKuTBUVBV4=" + }, + "remote_patch_strip": 0 + } + } + }, + "embree@4.3.1": { + "name": "embree", + "version": "4.3.1", + "key": "embree@4.3.1", + "repoName": "embree", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "onetbb": "onetbb@2021.11.0", + "platforms": "platforms@0.0.9", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/embree/embree/archive/refs/tags/v4.3.1.tar.gz" + ], + "integrity": "sha256-gk7cu3qM05PFvbehZzhIeyHsxOHQBKyfdh6TT5e7AqQ=", + "strip_prefix": "embree-4.3.1", + "remote_patches": { + "https://bcr.bazel.build/modules/embree/4.3.1/patches/bazel_build.patch": "sha256-LbbJo5VAEt2zg+pNQbPKlmqJIgLp9mi36VJdiy3IEes=", + "https://bcr.bazel.build/modules/embree/4.3.1/patches/default_h.patch": "sha256-7vawEsvpbsphjyHtFG+QkgXCEqkRlztyKf+1ymBJYlM=", + "https://bcr.bazel.build/modules/embree/4.3.1/patches/device_cpp.patch": "sha256-F/lGciIfImXOcpvRhHQZbM+f7oHtZi2IICk2YIGSOhM=", + "https://bcr.bazel.build/modules/embree/4.3.1/patches/module_dot_bazel.patch": "sha256-zizkoSE/6lCwRglag2EBeDS9TY6uLtk5HMtKdxvsacs=", + "https://bcr.bazel.build/modules/embree/4.3.1/patches/rtcore_common_h.patch": "sha256-lMYTbofdcrFxV49BA6PfOuLUlg+HuT72Rq9Wcev0pTI=", + "https://bcr.bazel.build/modules/embree/4.3.1/patches/rtcore_h.patch": "sha256-oL+AZd1F4BAiliTlZZCTadReGzj3VZV216eFON0ZcMI=" + }, + "remote_patch_strip": 0 + } + } + }, + "flip@1.3": { + "name": "flip", + "version": "1.3", + "key": "flip@1.3", + "repoName": "flip", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/NVlabs/flip/archive/a00bc7d4b8730bdaddfe0627ff94fdb01ca79e77.tar.gz" + ], + "integrity": "sha256-LOjrk/BIrxB7/n+C0bbe6CSfaCTEdAir2i4EUYnWZo8=", + "strip_prefix": "flip-a00bc7d4b8730bdaddfe0627ff94fdb01ca79e77", + "remote_patches": { + "https://bcr.bazel.build/modules/flip/1.3/patches/add_build_file.patch": "sha256-ZCvGiVB5hRv9sFJ8atbmIDQEnPCDnqKVVdRdN7no8rQ=", + "https://bcr.bazel.build/modules/flip/1.3/patches/module_dot_bazel.patch": "sha256-1qMqu/ACZB1oemR3u1UHnqnGpWiy/woSpKt9fW0uQhk=" + }, + "remote_patch_strip": 0 + } + } + }, + "fmt@_": { + "name": "fmt", + "version": "", + "key": "fmt@_", + "repoName": "fmt", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "gazelle@0.35.0": { + "name": "gazelle", + "version": "0.35.0", + "key": "gazelle@0.35.0", + "repoName": "bazel_gazelle", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@io_bazel_rules_go//go:extensions.bzl", + "extensionName": "go_sdk", + "usingModule": "gazelle@0.35.0", + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.35.0/MODULE.bazel", + "line": 12, + "column": 23 + }, + "imports": { + "go_host_compatible_sdk_label": "go_host_compatible_sdk_label" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_gazelle//internal/bzlmod:non_module_deps.bzl", + "extensionName": "non_module_deps", + "usingModule": "gazelle@0.35.0", + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.35.0/MODULE.bazel", + "line": 20, + "column": 32 + }, + "imports": { + "bazel_gazelle_go_repository_cache": "bazel_gazelle_go_repository_cache", + "bazel_gazelle_go_repository_tools": "bazel_gazelle_go_repository_tools", + "bazel_gazelle_is_bazel_module": "bazel_gazelle_is_bazel_module" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_gazelle//:extensions.bzl", + "extensionName": "go_deps", + "usingModule": "gazelle@0.35.0", + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.35.0/MODULE.bazel", + "line": 28, + "column": 24 + }, + "imports": { + "com_github_bazelbuild_buildtools": "com_github_bazelbuild_buildtools", + "com_github_bmatcuk_doublestar_v4": "com_github_bmatcuk_doublestar_v4", + "com_github_fsnotify_fsnotify": "com_github_fsnotify_fsnotify", + "com_github_google_go_cmp": "com_github_google_go_cmp", + "com_github_pmezard_go_difflib": "com_github_pmezard_go_difflib", + "org_golang_x_mod": "org_golang_x_mod", + "org_golang_x_sync": "org_golang_x_sync", + "org_golang_x_tools": "org_golang_x_tools", + "org_golang_x_tools_go_vcs": "org_golang_x_tools_go_vcs", + "bazel_gazelle_go_repository_config": "bazel_gazelle_go_repository_config", + "com_github_golang_protobuf": "com_github_golang_protobuf", + "org_golang_google_protobuf": "org_golang_google_protobuf" + }, + "devImports": [], + "tags": [ + { + "tagName": "from_file", + "attributeValues": { + "go_mod": "//:go.mod" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.35.0/MODULE.bazel", + "line": 29, + "column": 18 + } + }, + { + "tagName": "module", + "attributeValues": { + "path": "golang.org/x/tools", + "sum": "h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=", + "version": "v0.15.0" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.35.0/MODULE.bazel", + "line": 33, + "column": 15 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "com_google_protobuf": "protobuf@21.7", + "io_bazel_rules_go": "rules_go@0.44.0", + "rules_proto": "rules_proto@5.3.0-21.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz" + ], + "integrity": "sha256-MpOL2hbmcABjA1R5Bj2dJMYO2o15/Uc5Vj9Q0zHLMgk=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "glog@_": { + "name": "glog", + "version": "", + "key": "glog@_", + "repoName": "glog", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "com_github_gflags_gflags": "gflags@2.2.2", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "hypothesis@_": { + "name": "hypothesis", + "version": "head", + "key": "hypothesis@_", + "repoName": "hypothesis", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "imath@_": { + "name": "imath", + "version": "head", + "key": "imath@_", + "repoName": "imath", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "libdeflate@1.20.bcr.1": { + "name": "libdeflate", + "version": "1.20.bcr.1", + "key": "libdeflate@1.20.bcr.1", + "repoName": "libdeflate", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.20.tar.gz" + ], + "integrity": "sha256-7RRUFmzteJE/84CYcKQAW3Fwpv0wdn3EeKCbloR7nCo=", + "strip_prefix": "libdeflate-1.20", + "remote_patches": { + "https://bcr.bazel.build/modules/libdeflate/1.20.bcr.1/patches/add_build_file.patch": "sha256-fmX/WuLQrAMoXm/lyPaAe1DCFSKJAbXUOmYmUOF1Ze0=", + "https://bcr.bazel.build/modules/libdeflate/1.20.bcr.1/patches/module_dot_bazel.patch": "sha256-E80NwgQ5XOIfDsbeesMnzCSE8JXpK/Zkc58clqE6Wy0=" + }, + "remote_patch_strip": 0 + } + } + }, + "libjpeg_turbo@2.1.4": { + "name": "libjpeg_turbo", + "version": "2.1.4", + "key": "libjpeg_turbo@2.1.4", + "repoName": "libjpeg_turbo", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "nasm": "nasm@2.14.02", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/2.1.4.tar.gz" + ], + "integrity": "sha256-p4sFwNhCepDrW06wivJTCXcMg3lZK7C4qGM3MSjmFD8=", + "strip_prefix": "libjpeg-turbo-2.1.4", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/libjpeg_turbo/2.1.4/patches/add_build_file.patch": "sha256-0+Tt3h6HDSqHkQVbsRgyj7of2+XdWoIOryp6PZgOh3I=", + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/libjpeg_turbo/2.1.4/patches/add_module_dot_bazel.patch": "sha256-u/yHXyLgAeMuezVm8d9OiFx5wEM+RZfFZN8XkJUbeCs=" + }, + "remote_patch_strip": 0 + } + } + }, + "libpng@_": { + "name": "libpng", + "version": "1.6.43", + "key": "libpng@_", + "repoName": "libpng", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "zlib": "zlib@1.3.1.bcr.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "libwebp@1.3.2": { + "name": "libwebp", + "version": "1.3.2", + "key": "libwebp@1.3.2", + "repoName": "libwebp", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.2.tar.gz" + ], + "integrity": "sha256-wsL1IfpGjjxZSatpjC2kEPXc4cXpn1rZ5w4OhEa4ZQU=", + "strip_prefix": "libwebp-1.3.2", + "remote_patches": { + "https://bcr.bazel.build/modules/libwebp/1.3.2/patches/add_build_file.patch": "sha256-3HLHhRR77AbDAt1hkJfITaztgFpt9++a8PM0hQIN6Ho=", + "https://bcr.bazel.build/modules/libwebp/1.3.2/patches/module_dot_bazel.patch": "sha256-Ipy8mhkGtRK8MluHkRmFTkrB/fTO8Bd5h53jO7OWqEs=" + }, + "remote_patch_strip": 0 + } + } + }, + "nasm@2.14.02": { + "name": "nasm", + "version": "2.14.02", + "key": "nasm@2.14.02", + "repoName": "nasm", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz" + ], + "integrity": "sha256-s0uuNEo/Ltk7LKe/JfHtP7EtqJ7tpgluNVH9Zq3q6fw=", + "strip_prefix": "nasm-2.14.02", + "remote_patches": { + "https://bcr.bazel.build/modules/nasm/2.14.02/patches/add_build_file.patch": "sha256-ATUObHn2vcp0VuaKDdiF7V1ixPBfAzUl2sjdV9jW3C4=", + "https://bcr.bazel.build/modules/nasm/2.14.02/patches/add_config_h.patch": "sha256-6BT5sGqwRJ9kadF7YEG1sl3Bn5i5INm0R+meqOLJuuE=", + "https://bcr.bazel.build/modules/nasm/2.14.02/patches/add_module_dot_bazel.patch": "sha256-OEWbgVuCPXPv90/3ULrwQRoohnavn3x7YezRbMq+Mm0=" + }, + "remote_patch_strip": 0 + } + } + }, + "nlohmann_json@3.11.3": { + "name": "nlohmann_json", + "version": "3.11.3", + "key": "nlohmann_json@3.11.3", + "repoName": "nlohmann_json", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/nlohmann/json/releases/download/v3.11.3/include.zip" + ], + "integrity": "sha256-oiRh0TEZrFx48gXT3x2xNAPljOG7F5TtyTE2dzE/Sp0=", + "strip_prefix": "", + "remote_patches": { + "https://bcr.bazel.build/modules/nlohmann_json/3.11.3/patches/module_dot_bazel.patch": "sha256-OmeSCp1IqWbHGPJs0v5taUiPLEsI9KEJPLsnPpKB/B8=" + }, + "remote_patch_strip": 0 + } + } + }, + "openexr@_": { + "name": "openexr", + "version": "", + "key": "openexr@_", + "repoName": "openexr", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "imath": "imath@_", + "libdeflate": "libdeflate@1.20.bcr.1", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "pcg@_": { + "name": "pcg", + "version": "head", + "key": "pcg@_", + "repoName": "pcg", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "platforms@0.0.9": { + "name": "platforms", + "version": "0.0.9", + "key": "platforms@0.0.9", + "repoName": "platforms", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@platforms//host:extension.bzl", + "extensionName": "host_platform", + "usingModule": "platforms@0.0.9", + "location": { + "file": "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel", + "line": 9, + "column": 30 + }, + "imports": { + "host_platform": "host_platform" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "rules_license": "rules_license@0.0.8", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/platforms/releases/download/0.0.9/platforms-0.0.9.tar.gz" + ], + "integrity": "sha256-XtpTnIQSZQMcL4LYrno6ZJC9YhduDAOPxGnqv5H2FJs=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "pugixml@_": { + "name": "pugixml", + "version": "1.14", + "key": "pugixml@_", + "repoName": "pugixml", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "rules_cc@0.0.9": { + "name": "rules_cc", + "version": "0.0.9", + "key": "rules_cc@0.0.9", + "repoName": "rules_cc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "rules_cc@0.0.9", + "location": { + "file": "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel", + "line": 9, + "column": 29 + }, + "imports": { + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz" + ], + "integrity": "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8=", + "strip_prefix": "rules_cc-0.0.9", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch": "sha256-mM+qzOI0SgAdaJBlWOSMwMPKpaA9b7R37Hj/tp5bb4g=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_license@0.0.8": { + "name": "rules_license", + "version": "0.0.8", + "key": "rules_license@0.0.8", + "repoName": "rules_license", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_license/releases/download/0.0.8/rules_license-0.0.8.tar.gz" + ], + "integrity": "sha256-JBsG8wl/0Yb/RogyFQ1swUIkfcQqMqrvtW0AmYlf0ik=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_pkg@0.10.1": { + "name": "rules_pkg", + "version": "0.10.1", + "key": "rules_pkg@0.10.1", + "repoName": "rules_pkg", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_license": "rules_license@0.0.8", + "rules_python": "rules_python@0.31.0", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_pkg/releases/download/0.10.1/rules_pkg-0.10.1.tar.gz" + ], + "integrity": "sha256-0lCSSi7MUXaAj8TCXVz16eeeY0bXnVqxxJPiieci0dA=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_python@0.31.0": { + "name": "rules_python", + "version": "0.31.0", + "key": "rules_python@0.31.0", + "repoName": "rules_python", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@pythons_hub//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_python//python/private/bzlmod:internal_deps.bzl", + "extensionName": "internal_deps", + "usingModule": "rules_python@0.31.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel", + "line": 15, + "column": 30 + }, + "imports": { + "rules_python_internal": "rules_python_internal", + "pypi__build": "pypi__build", + "pypi__click": "pypi__click", + "pypi__colorama": "pypi__colorama", + "pypi__importlib_metadata": "pypi__importlib_metadata", + "pypi__installer": "pypi__installer", + "pypi__more_itertools": "pypi__more_itertools", + "pypi__packaging": "pypi__packaging", + "pypi__pep517": "pypi__pep517", + "pypi__pip": "pypi__pip", + "pypi__pip_tools": "pypi__pip_tools", + "pypi__pyproject_hooks": "pypi__pyproject_hooks", + "pypi__setuptools": "pypi__setuptools", + "pypi__tomli": "pypi__tomli", + "pypi__wheel": "pypi__wheel", + "pypi__zipp": "pypi__zipp" + }, + "devImports": [], + "tags": [ + { + "tagName": "install", + "attributeValues": {}, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel", + "line": 16, + "column": 22 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_python//python/extensions:python.bzl", + "extensionName": "python", + "usingModule": "rules_python@0.31.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel", + "line": 41, + "column": 23 + }, + "imports": { + "pythons_hub": "pythons_hub" + }, + "devImports": [], + "tags": [ + { + "tagName": "toolchain", + "attributeValues": { + "is_default": true, + "python_version": "3.11" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel", + "line": 47, + "column": 17 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_features": "bazel_features@1.1.1", + "bazel_skylib": "bazel_skylib@_", + "platforms": "platforms@0.0.9", + "rules_proto": "rules_proto@5.3.0-21.7", + "com_google_protobuf": "protobuf@21.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz" + ], + "integrity": "sha256-xovcT77CXeW1STuIGc/Id8TqKZwNyxXCRMWgAgjN4xE=", + "strip_prefix": "rules_python-0.31.0", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_python/0.31.0/patches/module_dot_bazel_version.patch": "sha256-j2KF6j66J2fRAGtc56Zj7Hp1dTGqOWPAR3+IODr0oLQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "xtensor@_": { + "name": "xtensor", + "version": "head", + "key": "xtensor@_", + "repoName": "xtensor", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "xtl": "xtl@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "xtl@_": { + "name": "xtl", + "version": "", + "key": "xtl@_", + "repoName": "xtl", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "yaml-cpp@_": { + "name": "yaml-cpp", + "version": "0.8.0", + "key": "yaml-cpp@_", + "repoName": "yaml-cpp", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "zlib@1.3.1.bcr.1": { + "name": "zlib", + "version": "1.3.1.bcr.1", + "key": "zlib@1.3.1.bcr.1", + "repoName": "zlib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz" + ], + "integrity": "sha256-mpOyt9/ax3zrpaVYpYDnRmfdb+3kWFuR7vtg8Dty3yM=", + "strip_prefix": "zlib-1.3.1", + "remote_patches": { + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.1/patches/add_build_file.patch": "sha256-0MCgNjvE1kGfdKTdDt4PEBHJMIwtDYHB7h69zhxDSNI=", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.1/patches/add_module_file.patch": "sha256-euR5cSrSZnUKPOIJKRu3BY/Dphe1+ekPC6OWaAQfDjQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "catch2@_": { + "name": "catch2", + "version": "", + "key": "catch2@_", + "repoName": "catch2", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "google_benchmark@1.8.3": { + "name": "google_benchmark", + "version": "1.8.3", + "key": "google_benchmark@1.8.3", + "repoName": "google_benchmark", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "platforms": "platforms@0.0.9", + "rules_foreign_cc": "rules_foreign_cc@0.10.1", + "rules_cc": "rules_cc@0.0.9", + "libpfm": "libpfm@4.11.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz" + ], + "integrity": "sha256-a8GApX0j1NlRVRn5KwyD1hsFtbqxiJYfNqx7BrDZ6c4=", + "strip_prefix": "benchmark-1.8.3", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "googletest@1.14.0.bcr.1": { + "name": "googletest", + "version": "1.14.0.bcr.1", + "key": "googletest@1.14.0.bcr.1", + "repoName": "googletest", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "com_google_absl": "abseil-cpp@_", + "platforms": "platforms@0.0.9", + "rules_cc": "rules_cc@0.0.9", + "com_googlesource_code_re2": "re2@2023-09-01", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz" + ], + "integrity": "sha256-itWYxzrXluDYKAsILOvYKmMNc+c808cAV5OKZQG7pdc=", + "strip_prefix": "googletest-1.14.0", + "remote_patches": { + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/patches/module_dot_bazel.patch": "sha256-jijctisPYOzP4X4cl0K7neRh/kqJB+yODNHf8V8heCE=" + }, + "remote_patch_strip": 0 + } + } + }, + "toolchains_llvm@_": { + "name": "toolchains_llvm", + "version": "0.0.0", + "key": "toolchains_llvm@_", + "repoName": "toolchains_llvm", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "rules_cc": "rules_cc@0.0.9", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "rules_foreign_cc@0.10.1": { + "name": "rules_foreign_cc", + "version": "0.10.1", + "key": "rules_foreign_cc@0.10.1", + "repoName": "rules_foreign_cc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@rules_foreign_cc_framework_toolchains//:all", + "@rules_foreign_cc//toolchains:built_make_toolchain", + "@rules_foreign_cc//toolchains:built_meson_toolchain", + "@rules_foreign_cc//toolchains:built_pkgconfig_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_autoconf_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_automake_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_m4_toolchain", + "@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain", + "@cmake_3.23.2_toolchains//:all", + "@ninja_1.11.1_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_foreign_cc//foreign_cc:extensions.bzl", + "extensionName": "tools", + "usingModule": "rules_foreign_cc@0.10.1", + "location": { + "file": "https://bcr.bazel.build/modules/rules_foreign_cc/0.10.1/MODULE.bazel", + "line": 14, + "column": 22 + }, + "imports": { + "cmake_3.23.2_toolchains": "cmake_3.23.2_toolchains", + "cmake_src": "cmake_src", + "gnumake_src": "gnumake_src", + "meson_src": "meson_src", + "ninja_1.11.1_toolchains": "ninja_1.11.1_toolchains", + "ninja_build_src": "ninja_build_src", + "pkgconfig_src": "pkgconfig_src", + "rules_foreign_cc_framework_toolchains": "rules_foreign_cc_framework_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "platforms": "platforms@0.0.9", + "rules_python": "rules_python@0.31.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.10.1/rules_foreign_cc-0.10.1.tar.gz" + ], + "integrity": "sha256-R2MDvQ8bBMwxH8JY8XCKX274LTCR5T/Rl3+iA4NCWmo=", + "strip_prefix": "rules_foreign_cc-0.10.1", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_foreign_cc/0.10.1/patches/module_dot_bazel.patch": "sha256-hDvLi+Nx91lvhEd2qRrPfPu0RjiG5w3a/c4N4AiJb3U=" + }, + "remote_patch_strip": 0 + } + } + }, + "bazel_tools@_": { + "name": "bazel_tools", + "version": "", + "key": "bazel_tools@_", + "repoName": "bazel_tools", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all", + "@local_config_sh//:local_sh_toolchain" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 18, + "column": 29 + }, + "imports": { + "local_config_cc": "local_config_cc", + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/osx:xcode_configure.bzl", + "extensionName": "xcode_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 22, + "column": 32 + }, + "imports": { + "local_config_xcode": "local_config_xcode" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 25, + "column": 32 + }, + "imports": { + "local_jdk": "local_jdk", + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/sh:sh_configure.bzl", + "extensionName": "sh_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 36, + "column": 39 + }, + "imports": { + "local_config_sh": "local_config_sh" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/test:extensions.bzl", + "extensionName": "remote_coverage_tools_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 40, + "column": 48 + }, + "imports": { + "remote_coverage_tools": "remote_coverage_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/android:android_extensions.bzl", + "extensionName": "remote_android_tools_extensions", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 43, + "column": 42 + }, + "imports": { + "android_gmaven_r8": "android_gmaven_r8", + "android_tools": "android_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", + "extensionName": "buildozer_binary", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 47, + "column": 33 + }, + "imports": { + "buildozer_binary": "buildozer_binary" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "rules_java": "rules_java@7.4.0", + "rules_license": "rules_license@0.0.8", + "rules_proto": "rules_proto@5.3.0-21.7", + "rules_python": "rules_python@0.31.0", + "buildozer": "buildozer@6.4.0.2", + "platforms": "platforms@0.0.9", + "com_google_protobuf": "protobuf@21.7", + "zlib": "zlib@1.3.1.bcr.1", + "build_bazel_apple_support": "apple_support@1.15.1", + "local_config_platform": "local_config_platform@_" + } + }, + "local_config_platform@_": { + "name": "local_config_platform", + "version": "", + "key": "local_config_platform@_", + "repoName": "local_config_platform", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_" + } + }, + "boost@1.83.0.bcr.1": { + "name": "boost", + "version": "1.83.0.bcr.1", + "key": "boost@1.83.0.bcr.1", + "repoName": "boost", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost.accumulators": "boost.accumulators@1.83.0.bcr.1", + "boost.algorithm": "boost.algorithm@1.83.0.bcr.1", + "boost.align": "boost.align@1.83.0.bcr.1", + "boost.any": "boost.any@1.83.0.bcr.1", + "boost.array": "boost.array@1.83.0.bcr.1", + "boost.asio": "boost.asio@1.83.0.bcr.1", + "boost.assert": "boost.assert@1.83.0.bcr.1", + "boost.assign": "boost.assign@1.83.0.bcr.1", + "boost.atomic": "boost.atomic@1.83.0.bcr.1", + "boost.beast": "boost.beast@1.83.0.bcr.1", + "boost.bimap": "boost.bimap@1.83.0.bcr.1", + "boost.bind": "boost.bind@1.83.0.bcr.1", + "boost.callable_traits": "boost.callable_traits@1.83.0.bcr.1", + "boost.chrono": "boost.chrono@1.83.0.bcr.1", + "boost.circular_buffer": "boost.circular_buffer@1.83.0.bcr.1", + "boost.compatibility": "boost.compatibility@1.83.0.bcr.1", + "boost.compute": "boost.compute@1.83.0.bcr.1", + "boost.concept_check": "boost.concept_check@1.83.0.bcr.1", + "boost.config": "boost.config@1.83.0.bcr.1", + "boost.container": "boost.container@1.83.0.bcr.1", + "boost.container_hash": "boost.container_hash@1.83.0.bcr.1", + "boost.context": "boost.context@1.83.0.bcr.1", + "boost.contract": "boost.contract@1.83.0.bcr.1", + "boost.conversion": "boost.conversion@1.83.0.bcr.1", + "boost.convert": "boost.convert@1.83.0.bcr.1", + "boost.core": "boost.core@1.83.0.bcr.1", + "boost.coroutine": "boost.coroutine@1.83.0.bcr.1", + "boost.coroutine2": "boost.coroutine2@1.83.0.bcr.1", + "boost.crc": "boost.crc@1.83.0.bcr.1", + "boost.date_time": "boost.date_time@1.83.0.bcr.1", + "boost.describe": "boost.describe@1.83.0.bcr.1", + "boost.detail": "boost.detail@1.83.0.bcr.1", + "boost.dll": "boost.dll@1.83.0.bcr.1", + "boost.dynamic_bitset": "boost.dynamic_bitset@1.83.0.bcr.1", + "boost.endian": "boost.endian@1.83.0.bcr.1", + "boost.exception": "boost.exception@1.83.0.bcr.1", + "boost.fiber": "boost.fiber@1.83.0.bcr.1", + "boost.filesystem": "boost.filesystem@1.83.0.bcr.1", + "boost.flyweight": "boost.flyweight@1.83.0.bcr.1", + "boost.foreach": "boost.foreach@1.83.0.bcr.1", + "boost.format": "boost.format@1.83.0.bcr.1", + "boost.function": "boost.function@1.83.0.bcr.1", + "boost.function_types": "boost.function_types@1.83.0.bcr.1", + "boost.functional": "boost.functional@1.83.0.bcr.1", + "boost.fusion": "boost.fusion@1.83.0.bcr.1", + "boost.geometry": "boost.geometry@1.83.0.bcr.1", + "boost.gil": "boost.gil@1.83.0.bcr.1", + "boost.graph": "boost.graph@1.83.0.bcr.1", + "boost.graph.parallel": "boost.graph.parallel@1.83.0.bcr.1", + "boost.hana": "boost.hana@1.83.0.bcr.1", + "boost.heap": "boost.heap@1.83.0.bcr.1", + "boost.histogram": "boost.histogram@1.83.0.bcr.1", + "boost.hof": "boost.hof@1.83.0.bcr.1", + "boost.icl": "boost.icl@1.83.0.bcr.1", + "boost.integer": "boost.integer@1.83.0.bcr.1", + "boost.interprocess": "boost.interprocess@1.83.0.bcr.1", + "boost.intrusive": "boost.intrusive@1.83.0.bcr.1", + "boost.io": "boost.io@1.83.0.bcr.1", + "boost.iostreams": "boost.iostreams@1.83.0.bcr.1", + "boost.iterator": "boost.iterator@1.83.0.bcr.1", + "boost.json": "boost.json@1.83.0.bcr.1", + "boost.lambda": "boost.lambda@1.83.0.bcr.1", + "boost.lambda2": "boost.lambda2@1.83.0.bcr.1", + "boost.leaf": "boost.leaf@1.83.0.bcr.1", + "boost.lexical_cast": "boost.lexical_cast@1.83.0.bcr.1", + "boost.local_function": "boost.local_function@1.83.0.bcr.1", + "boost.locale": "boost.locale@1.83.0.bcr.1", + "boost.lockfree": "boost.lockfree@1.83.0.bcr.1", + "boost.log": "boost.log@1.83.0.bcr.1", + "boost.logic": "boost.logic@1.83.0.bcr.1", + "boost.math": "boost.math@1.83.0.bcr.1", + "boost.metaparse": "boost.metaparse@1.83.0.bcr.1", + "boost.move": "boost.move@1.83.0.bcr.1", + "boost.mp11": "boost.mp11@1.83.0.bcr.1", + "boost.mpi": "boost.mpi@1.83.0.bcr.1", + "boost.mpl": "boost.mpl@1.83.0.bcr.1", + "boost.msm": "boost.msm@1.83.0.bcr.1", + "boost.multi_array": "boost.multi_array@1.83.0.bcr.1", + "boost.multi_index": "boost.multi_index@1.83.0.bcr.1", + "boost.multiprecision": "boost.multiprecision@1.83.0.bcr.1", + "boost.nowide": "boost.nowide@1.83.0.bcr.1", + "boost.numeric.conversion": "boost.numeric.conversion@1.83.0.bcr.1", + "boost.numeric.interval": "boost.numeric.interval@1.83.0.bcr.1", + "boost.numeric.odeint": "boost.numeric.odeint@1.83.0.bcr.1", + "boost.numeric.ublas": "boost.numeric.ublas@1.83.0.bcr.1", + "boost.optional": "boost.optional@1.83.0.bcr.1", + "boost.outcome": "boost.outcome@1.83.0.bcr.1", + "boost.parameter": "boost.parameter@1.83.0.bcr.1", + "boost.parameter_python": "boost.parameter_python@1.83.0.bcr.1", + "boost.pfr": "boost.pfr@1.83.0.bcr.1", + "boost.phoenix": "boost.phoenix@1.83.0.bcr.1", + "boost.poly_collection": "boost.poly_collection@1.83.0.bcr.1", + "boost.polygon": "boost.polygon@1.83.0.bcr.1", + "boost.pool": "boost.pool@1.83.0.bcr.1", + "boost.predef": "boost.predef@1.83.0.bcr.1", + "boost.preprocessor": "boost.preprocessor@1.83.0.bcr.1", + "boost.process": "boost.process@1.83.0.bcr.1", + "boost.program_options": "boost.program_options@1.83.0.bcr.1", + "boost.property_map": "boost.property_map@1.83.0.bcr.1", + "boost.property_map.parallel": "boost.property_map.parallel@1.83.0.bcr.1", + "boost.property_tree": "boost.property_tree@1.83.0.bcr.1", + "boost.proto": "boost.proto@1.83.0.bcr.1", + "boost.ptr_container": "boost.ptr_container@1.83.0.bcr.1", + "boost.python": "boost.python@1.83.0.bcr.1", + "boost.qvm": "boost.qvm@1.83.0.bcr.1", + "boost.random": "boost.random@1.83.0.bcr.1", + "boost.range": "boost.range@1.83.0.bcr.1", + "boost.ratio": "boost.ratio@1.83.0.bcr.1", + "boost.rational": "boost.rational@1.83.0.bcr.1", + "boost.regex": "boost.regex@1.83.0.bcr.1", + "boost.safe_numerics": "boost.safe_numerics@1.83.0.bcr.1", + "boost.scope_exit": "boost.scope_exit@1.83.0.bcr.1", + "boost.serialization": "boost.serialization@1.83.0.bcr.1", + "boost.signals2": "boost.signals2@1.83.0.bcr.1", + "boost.smart_ptr": "boost.smart_ptr@1.83.0.bcr.1", + "boost.sort": "boost.sort@1.83.0.bcr.1", + "boost.spirit": "boost.spirit@1.83.0.bcr.1", + "boost.stacktrace": "boost.stacktrace@1.83.0.bcr.1", + "boost.statechart": "boost.statechart@1.83.0.bcr.1", + "boost.static_assert": "boost.static_assert@1.83.0.bcr.1", + "boost.static_string": "boost.static_string@1.83.0.bcr.1", + "boost.stl_interfaces": "boost.stl_interfaces@1.83.0.bcr.1", + "boost.system": "boost.system@1.83.0.bcr.1", + "boost.test": "boost.test@1.83.0.bcr.1", + "boost.thread": "boost.thread@1.83.0.bcr.1", + "boost.throw_exception": "boost.throw_exception@1.83.0.bcr.1", + "boost.timer": "boost.timer@1.83.0.bcr.1", + "boost.tokenizer": "boost.tokenizer@1.83.0.bcr.1", + "boost.tti": "boost.tti@1.83.0.bcr.1", + "boost.tuple": "boost.tuple@1.83.0.bcr.1", + "boost.type_erasure": "boost.type_erasure@1.83.0.bcr.1", + "boost.type_index": "boost.type_index@1.83.0.bcr.1", + "boost.type_traits": "boost.type_traits@1.83.0.bcr.1", + "boost.typeof": "boost.typeof@1.83.0.bcr.1", + "boost.units": "boost.units@1.83.0.bcr.1", + "boost.unordered": "boost.unordered@1.83.0.bcr.1", + "boost.url": "boost.url@1.83.0.bcr.1", + "boost.utility": "boost.utility@1.83.0.bcr.1", + "boost.uuid": "boost.uuid@1.83.0.bcr.1", + "boost.variant": "boost.variant@1.83.0.bcr.1", + "boost.variant2": "boost.variant2@1.83.0.bcr.1", + "boost.vmd": "boost.vmd@1.83.0.bcr.1", + "boost.wave": "boost.wave@1.83.0.bcr.1", + "boost.winapi": "boost.winapi@1.83.0.bcr.1", + "boost.xpressive": "boost.xpressive@1.83.0.bcr.1", + "boost.yap": "boost.yap@1.83.0.bcr.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/dynacondev/boost.rules/archive/refs/tags/v1.83.0.bcr.1-pre2.tar.gz" + ], + "integrity": "sha256-8h96Q1mMMoNzfIOGXZMOVikSv2cSjWRieVCWCoQjn4A=", + "strip_prefix": "boost.rules-1.83.0.bcr.1-pre2", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "boost.rules.tools@1.0.0": { + "name": "boost.rules.tools", + "version": "1.0.0", + "key": "boost.rules.tools@1.0.0", + "repoName": "boost.rules.tools", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/dynacondev/boost.rules.tools/archive/refs/tags/v1.0.0-pre4.tar.gz" + ], + "integrity": "sha256-dUdX77iBjtQKNhp2/VN4hzVIRntFS0HCCw2mXx4Zyfc=", + "strip_prefix": "boost.rules.tools-1.0.0-pre4", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "boringssl@0.0.0-20230215-5c22014": { + "name": "boringssl", + "version": "0.0.0-20230215-5c22014", + "key": "boringssl@0.0.0-20230215-5c22014", + "repoName": "boringssl", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/google/boringssl/archive/5c22014ca513807ed03c657e8ede076164663979.zip" + ], + "integrity": "sha256-hj/GcMRW8wkjdAwWOTBRMv37nRslujhaZ644Yu8SqK8=", + "strip_prefix": "boringssl-5c22014ca513807ed03c657e8ede076164663979", + "remote_patches": { + "https://bcr.bazel.build/modules/boringssl/0.0.0-20230215-5c22014/patches/module_dot_bazel.patch": "sha256-TbAx9h+pBkDT3JmKw1bRchtNcLK1dnvsW1IlCkl/yd0=" + }, + "remote_patch_strip": 0 + } + } + }, + "boost.serialization@1.83.0.bcr.1": { + "name": "boost.serialization", + "version": "1.83.0.bcr.1", + "key": "boost.serialization@1.83.0.bcr.1", + "repoName": "boost.serialization", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/serialization/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-8ffXlVncPPopFkLDWVyPtre66ttm4IWR45evkhaNe1w=", + "strip_prefix": "serialization-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.serialization/1.83.0.bcr.1/patches/patch.diff": "sha256-0715b22+TB4Y0El4oBzTgRvCIN1hwFph/jBUR4WBDlI=" + }, + "remote_patch_strip": 1 + } + } + }, + "onetbb@2021.11.0": { + "name": "onetbb", + "version": "2021.11.0", + "key": "onetbb@2021.11.0", + "repoName": "onetbb", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.11.0.tar.gz" + ], + "integrity": "sha256-eCzgyrYt+eoSXN6iU6UFNIYrVj8dhdTNp61Od1UKw2M=", + "strip_prefix": "oneTBB-2021.11.0", + "remote_patches": { + "https://bcr.bazel.build/modules/onetbb/2021.11.0/patches/add_module_dot_bazel.patch": "sha256-bk5ZcnT3OETFGkIwjggE7V8WiGpfSkHa3enUT/ycixE=" + }, + "remote_patch_strip": 0 + } + } + }, + "protobuf@21.7": { + "name": "protobuf", + "version": "21.7", + "key": "protobuf@21.7", + "repoName": "protobuf", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_jvm_external//:extensions.bzl", + "extensionName": "maven", + "usingModule": "protobuf@21.7", + "location": { + "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel", + "line": 22, + "column": 22 + }, + "imports": { + "maven": "maven" + }, + "devImports": [], + "tags": [ + { + "tagName": "install", + "attributeValues": { + "name": "maven", + "artifacts": [ + "com.google.code.findbugs:jsr305:3.0.2", + "com.google.code.gson:gson:2.8.9", + "com.google.errorprone:error_prone_annotations:2.3.2", + "com.google.j2objc:j2objc-annotations:1.3", + "com.google.guava:guava:31.1-jre", + "com.google.guava:guava-testlib:31.1-jre", + "com.google.truth:truth:1.1.2", + "junit:junit:4.13.2", + "org.mockito:mockito-core:4.3.1" + ] + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel", + "line": 24, + "column": 14 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "rules_python": "rules_python@0.31.0", + "rules_cc": "rules_cc@0.0.9", + "rules_proto": "rules_proto@5.3.0-21.7", + "rules_java": "rules_java@7.4.0", + "rules_pkg": "rules_pkg@0.10.1", + "com_google_abseil": "abseil-cpp@_", + "zlib": "zlib@1.3.1.bcr.1", + "upb": "upb@0.0.0-20220923-a547704", + "rules_jvm_external": "rules_jvm_external@4.4.2", + "com_google_googletest": "googletest@1.14.0.bcr.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-all-21.7.zip" + ], + "integrity": "sha256-VJOiH17T/FAuZv7GuUScBqVRztYwAvpIkDxA36jeeko=", + "strip_prefix": "protobuf-21.7", + "remote_patches": { + "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel.patch": "sha256-q3V2+eq0v2XF0z8z+V+QF4cynD6JvHI1y3kI/+rzl5s=", + "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel_for_examples.patch": "sha256-O7YP6s3lo/1opUiO0jqXYORNHdZ/2q3hjz1QGy8QdIU=", + "https://bcr.bazel.build/modules/protobuf/21.7/patches/relative_repo_names.patch": "sha256-RK9RjW8T5UJNG7flIrnFiNE9vKwWB+8uWWtJqXYT0w4=", + "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_missing_files.patch": "sha256-Hyne4DG2u5bXcWHNxNMirA2QFAe/2Cl8oMm1XJdkQIY=" + }, + "remote_patch_strip": 1 + } + } + }, + "rules_go@0.44.0": { + "name": "rules_go", + "version": "0.44.0", + "key": "rules_go@0.44.0", + "repoName": "io_bazel_rules_go", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@go_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@io_bazel_rules_go//go:extensions.bzl", + "extensionName": "go_sdk", + "usingModule": "rules_go@0.44.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.44.0/MODULE.bazel", + "line": 14, + "column": 23 + }, + "imports": { + "go_toolchains": "go_toolchains", + "io_bazel_rules_nogo": "io_bazel_rules_nogo" + }, + "devImports": [], + "tags": [ + { + "tagName": "download", + "attributeValues": { + "name": "go_default_sdk", + "version": "1.21.1" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.44.0/MODULE.bazel", + "line": 15, + "column": 16 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@gazelle//:extensions.bzl", + "extensionName": "go_deps", + "usingModule": "rules_go@0.44.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.44.0/MODULE.bazel", + "line": 30, + "column": 24 + }, + "imports": { + "com_github_gogo_protobuf": "com_github_gogo_protobuf", + "com_github_golang_mock": "com_github_golang_mock", + "com_github_golang_protobuf": "com_github_golang_protobuf", + "org_golang_google_genproto": "org_golang_google_genproto", + "org_golang_google_grpc": "org_golang_google_grpc", + "org_golang_google_grpc_cmd_protoc_gen_go_grpc": "org_golang_google_grpc_cmd_protoc_gen_go_grpc", + "org_golang_google_protobuf": "org_golang_google_protobuf", + "org_golang_x_net": "org_golang_x_net", + "org_golang_x_tools": "org_golang_x_tools" + }, + "devImports": [], + "tags": [ + { + "tagName": "from_file", + "attributeValues": { + "go_mod": "//:go.mod" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.44.0/MODULE.bazel", + "line": 31, + "column": 18 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_features": "bazel_features@1.1.1", + "bazel_skylib": "bazel_skylib@_", + "platforms": "platforms@0.0.9", + "rules_proto": "rules_proto@5.3.0-21.7", + "com_google_protobuf": "protobuf@21.7", + "gazelle": "gazelle@0.35.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_go/releases/download/v0.44.0/rules_go-v0.44.0.zip" + ], + "integrity": "sha256-yANeiuJItWBAplrT8LdDRxLiA35d/c6/6XV25iBCJwk=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_proto@5.3.0-21.7": { + "name": "rules_proto", + "version": "5.3.0-21.7", + "key": "rules_proto@5.3.0-21.7", + "repoName": "rules_proto", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "com_google_protobuf": "protobuf@21.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz" + ], + "integrity": "sha256-3D+yBqLLNEG0heseQjFlsjEjWh6psDG0Qzz3vB+kYN0=", + "strip_prefix": "rules_proto-5.3.0-21.7", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "gflags@2.2.2": { + "name": "gflags", + "version": "2.2.2", + "key": "gflags@2.2.2", + "repoName": "gflags", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.tar.gz" + ], + "integrity": "sha256-NK8vFc9zZ1E7NSvc0kk6sUzkNpLS3NnfxJlJKWbGTc8=", + "strip_prefix": "gflags-2.2.2", + "remote_patches": { + "https://bcr.bazel.build/modules/gflags/2.2.2/patches/module_dot_bazel.patch": "sha256-BVSk+8ijV+s6djcokSgSZGlP153Q+rvF2h9W/AG53Zo=" + }, + "remote_patch_strip": 0 + } + } + }, + "bazel_features@1.1.1": { + "name": "bazel_features", + "version": "1.1.1", + "key": "bazel_features@1.1.1", + "repoName": "bazel_features", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_features//private:extensions.bzl", + "extensionName": "version_extension", + "usingModule": "bazel_features@1.1.1", + "location": { + "file": "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel", + "line": 6, + "column": 24 + }, + "imports": { + "bazel_features_globals": "bazel_features_globals", + "bazel_features_version": "bazel_features_version" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazel-contrib/bazel_features/releases/download/v1.1.1/bazel_features-v1.1.1.tar.gz" + ], + "integrity": "sha256-YsJuQn5cvHUQJERpJ2IuOYqdzfMsZDJSOIFXCdEcEag=", + "strip_prefix": "bazel_features-1.1.1", + "remote_patches": { + "https://bcr.bazel.build/modules/bazel_features/1.1.1/patches/module_dot_bazel_version.patch": "sha256-+56MAEsc7bYN/Pzhn252ZQUxiRzZg9bynXj1qpsmCYs=" + }, + "remote_patch_strip": 1 + } + } + }, + "libpfm@4.11.0": { + "name": "libpfm", + "version": "4.11.0", + "key": "libpfm@4.11.0", + "repoName": "libpfm", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "rules_foreign_cc": "rules_foreign_cc@0.10.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://sourceforge.net/projects/perfmon2/files/libpfm4/libpfm-4.11.0.tar.gz" + ], + "integrity": "sha256-XaX4hyveFLNjTJaI2YD2i9ootRAmhyPMEpc+7bq5/sw=", + "strip_prefix": "libpfm-4.11.0", + "remote_patches": { + "https://bcr.bazel.build/modules/libpfm/4.11.0/patches/module_dot_bazel.patch": "sha256-G0wQJ2mVEoW/L5LGzmbNfuZaxI2+9NDuWJtqvCpM1pc=", + "https://bcr.bazel.build/modules/libpfm/4.11.0/patches/add_build_file.patch": "sha256-E61d/qQgmeOcUliWaveHPp1EZoOjkvZJsqhGhHofqUg=" + }, + "remote_patch_strip": 0 + } + } + }, + "re2@2023-09-01": { + "name": "re2", + "version": "2023-09-01", + "key": "re2@2023-09-01", + "repoName": "re2", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@pybind11_bazel//:python_configure.bzl", + "extensionName": "extension", + "usingModule": "re2@2023-09-01", + "location": { + "file": "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel", + "line": 22, + "column": 33 + }, + "imports": { + "local_config_python": "local_config_python", + "pybind11": "pybind11" + }, + "devImports": [], + "tags": [ + { + "tagName": "toolchain", + "attributeValues": { + "python_version": "3" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel", + "line": 23, + "column": 27 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.9", + "rules_cc": "rules_cc@0.0.9", + "com_google_absl": "abseil-cpp@_", + "rules_python": "rules_python@0.31.0", + "pybind11_bazel": "pybind11_bazel@2.11.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/google/re2/releases/download/2023-09-01/re2-2023-09-01.zip" + ], + "integrity": "sha256-IkuDUdxGM7EBLb2EdWTgYKRr5goioUY9S1uZP9S/Wcw=", + "strip_prefix": "re2-2023-09-01", + "remote_patches": { + "https://bcr.bazel.build/modules/re2/2023-09-01/patches/module_dot_bazel.patch": "sha256-MUQkRNgPJ0lbYqOXoBu2m2vLH7IuKEbK/VWTw7WWrnA=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_java@7.4.0": { + "name": "rules_java", + "version": "7.4.0", + "key": "rules_java@7.4.0", + "repoName": "rules_java", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains:all", + "@local_jdk//:runtime_toolchain_definition", + "@local_jdk//:bootstrap_runtime_toolchain_definition", + "@remotejdk11_linux_toolchain_config_repo//:all", + "@remotejdk11_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk11_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk11_linux_s390x_toolchain_config_repo//:all", + "@remotejdk11_macos_toolchain_config_repo//:all", + "@remotejdk11_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk11_win_toolchain_config_repo//:all", + "@remotejdk11_win_arm64_toolchain_config_repo//:all", + "@remotejdk17_linux_toolchain_config_repo//:all", + "@remotejdk17_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk17_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk17_linux_s390x_toolchain_config_repo//:all", + "@remotejdk17_macos_toolchain_config_repo//:all", + "@remotejdk17_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk17_win_toolchain_config_repo//:all", + "@remotejdk17_win_arm64_toolchain_config_repo//:all", + "@remotejdk21_linux_toolchain_config_repo//:all", + "@remotejdk21_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk21_macos_toolchain_config_repo//:all", + "@remotejdk21_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk21_win_toolchain_config_repo//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "rules_java@7.4.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_java/7.4.0/MODULE.bazel", + "line": 19, + "column": 27 + }, + "imports": { + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64", + "local_jdk": "local_jdk", + "remotejdk11_linux_toolchain_config_repo": "remotejdk11_linux_toolchain_config_repo", + "remotejdk11_linux_aarch64_toolchain_config_repo": "remotejdk11_linux_aarch64_toolchain_config_repo", + "remotejdk11_linux_ppc64le_toolchain_config_repo": "remotejdk11_linux_ppc64le_toolchain_config_repo", + "remotejdk11_linux_s390x_toolchain_config_repo": "remotejdk11_linux_s390x_toolchain_config_repo", + "remotejdk11_macos_toolchain_config_repo": "remotejdk11_macos_toolchain_config_repo", + "remotejdk11_macos_aarch64_toolchain_config_repo": "remotejdk11_macos_aarch64_toolchain_config_repo", + "remotejdk11_win_toolchain_config_repo": "remotejdk11_win_toolchain_config_repo", + "remotejdk11_win_arm64_toolchain_config_repo": "remotejdk11_win_arm64_toolchain_config_repo", + "remotejdk17_linux_toolchain_config_repo": "remotejdk17_linux_toolchain_config_repo", + "remotejdk17_linux_aarch64_toolchain_config_repo": "remotejdk17_linux_aarch64_toolchain_config_repo", + "remotejdk17_linux_ppc64le_toolchain_config_repo": "remotejdk17_linux_ppc64le_toolchain_config_repo", + "remotejdk17_linux_s390x_toolchain_config_repo": "remotejdk17_linux_s390x_toolchain_config_repo", + "remotejdk17_macos_toolchain_config_repo": "remotejdk17_macos_toolchain_config_repo", + "remotejdk17_macos_aarch64_toolchain_config_repo": "remotejdk17_macos_aarch64_toolchain_config_repo", + "remotejdk17_win_toolchain_config_repo": "remotejdk17_win_toolchain_config_repo", + "remotejdk17_win_arm64_toolchain_config_repo": "remotejdk17_win_arm64_toolchain_config_repo", + "remotejdk21_linux_toolchain_config_repo": "remotejdk21_linux_toolchain_config_repo", + "remotejdk21_linux_aarch64_toolchain_config_repo": "remotejdk21_linux_aarch64_toolchain_config_repo", + "remotejdk21_macos_toolchain_config_repo": "remotejdk21_macos_toolchain_config_repo", + "remotejdk21_macos_aarch64_toolchain_config_repo": "remotejdk21_macos_aarch64_toolchain_config_repo", + "remotejdk21_win_toolchain_config_repo": "remotejdk21_win_toolchain_config_repo" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.9", + "rules_cc": "rules_cc@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "rules_proto": "rules_proto@5.3.0-21.7", + "rules_license": "rules_license@0.0.8", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_java/releases/download/7.4.0/rules_java-7.4.0.tar.gz" + ], + "integrity": "sha256-l27wi0nJKXQfIBeQ5Z44B8cq2B9CjIvJU82+/1/tFes=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "buildozer@6.4.0.2": { + "name": "buildozer", + "version": "6.4.0.2", + "key": "buildozer@6.4.0.2", + "repoName": "buildozer", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", + "extensionName": "buildozer_binary", + "usingModule": "buildozer@6.4.0.2", + "location": { + "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", + "line": 7, + "column": 33 + }, + "imports": { + "buildozer_binary": "buildozer_binary" + }, + "devImports": [], + "tags": [ + { + "tagName": "buildozer", + "attributeValues": { + "sha256": { + "darwin-amd64": "d29e347ecd6b5673d72cb1a8de05bf1b06178dd229ff5eb67fad5100c840cc8e", + "darwin-arm64": "9b9e71bdbec5e7223871e913b65d12f6d8fa026684daf991f00e52ed36a6978d", + "linux-amd64": "8dfd6345da4e9042daa738d7fdf34f699c5dfce4632f7207956fceedd8494119", + "linux-arm64": "6559558fded658c8fa7432a9d011f7c4dcbac6b738feae73d2d5c352e5f605fa", + "windows-amd64": "e7f05bf847f7c3689dd28926460ce6e1097ae97380ac8e6ae7147b7b706ba19b" + }, + "version": "6.4.0" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", + "line": 8, + "column": 27 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/fmeum/buildozer/releases/download/v6.4.0.2/buildozer-v6.4.0.2.tar.gz" + ], + "integrity": "sha256-k7tFKQMR2AygxpmZfH0yEPnQmF3efFgD9rBPkj+Yz/8=", + "strip_prefix": "buildozer-6.4.0.2", + "remote_patches": { + "https://bcr.bazel.build/modules/buildozer/6.4.0.2/patches/module_dot_bazel_version.patch": "sha256-gKANF2HMilj7bWmuXs4lbBIAAansuWC4IhWGB/CerjU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.accumulators@1.83.0.bcr.1": { + "name": "boost.accumulators", + "version": "1.83.0.bcr.1", + "key": "boost.accumulators@1.83.0.bcr.1", + "repoName": "boost.accumulators", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/accumulators/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-DTiaqt1IzLk3MivdrZmOyrL1Gno7IT1ggN4RjBf/rkA=", + "strip_prefix": "accumulators-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.accumulators/1.83.0.bcr.1/patches/patch.diff": "sha256-ZwevdPlRA59qzb0WFHQz4+vkH2eFoS88rE7pprfCtUU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.align@1.83.0.bcr.1": { + "name": "boost.align", + "version": "1.83.0.bcr.1", + "key": "boost.align@1.83.0.bcr.1", + "repoName": "boost.align", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/align/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-z2TFJIdZBeHwmDjhcyvk4fMc/McVQ6HP9+ewtIRLzFQ=", + "strip_prefix": "align-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.align/1.83.0.bcr.1/patches/patch.diff": "sha256-zZsqWu68+aY91Pn+GKSQ0Pq2+5A/qlpUOp22ymKJQY4=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.any@1.83.0.bcr.1": { + "name": "boost.any", + "version": "1.83.0.bcr.1", + "key": "boost.any@1.83.0.bcr.1", + "repoName": "boost.any", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/any/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-inZUM02cr9F9uYiEzj0gxMwLRuwzrbCymjlI0KJ4Rvc=", + "strip_prefix": "any-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.any/1.83.0.bcr.1/patches/patch.diff": "sha256-fba0QtI/dqN6lAtkF8NuurBALLXdbGs6425F4wWI6tc=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.array@1.83.0.bcr.1": { + "name": "boost.array", + "version": "1.83.0.bcr.1", + "key": "boost.array@1.83.0.bcr.1", + "repoName": "boost.array", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/array/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-b3X1Ov5KAosAdEY0DnPZaSVAnrTNofwY04kIS3ofNiA=", + "strip_prefix": "array-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.array/1.83.0.bcr.1/patches/patch.diff": "sha256-R7D2LgKKv42RM9zUYWiMJuKipHJEerPxrMwpGT+ktzs=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.assert@1.83.0.bcr.1": { + "name": "boost.assert", + "version": "1.83.0.bcr.1", + "key": "boost.assert@1.83.0.bcr.1", + "repoName": "boost.assert", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/assert/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-HSrhT/hAiMvtdHKWyIOB3RPrV7JeAJnrjdd4MmpvpHY=", + "strip_prefix": "assert-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.assert/1.83.0.bcr.1/patches/patch.diff": "sha256-Dvp/kvQFUHkoFLXM+2dcnqS3XUyKm+s2DuBeLYmjDvo=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.assign@1.83.0.bcr.1": { + "name": "boost.assign", + "version": "1.83.0.bcr.1", + "key": "boost.assign@1.83.0.bcr.1", + "repoName": "boost.assign", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/assign/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-HHZKV4rwNH+NGldsGo7YQ7goD0oDXPIH48y+N3I58CI=", + "strip_prefix": "assign-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.assign/1.83.0.bcr.1/patches/patch.diff": "sha256-adHw8b6Clv5Tfh+jCFOLoyZsmVNMOp/pFKnmwOaygME=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.atomic@1.83.0.bcr.1": { + "name": "boost.atomic", + "version": "1.83.0.bcr.1", + "key": "boost.atomic@1.83.0.bcr.1", + "repoName": "boost.atomic", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/atomic/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-LlB2gfzajDR88EjFHKMioLuoDH+6iGs8jeJNBW0AzNY=", + "strip_prefix": "atomic-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.atomic/1.83.0.bcr.1/patches/patch.diff": "sha256-nwLjd3u7CBN0RqQEYIgQSpR81hUBJLFnizHR8gHkHsk=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.beast@1.83.0.bcr.1": { + "name": "boost.beast", + "version": "1.83.0.bcr.1", + "key": "boost.beast@1.83.0.bcr.1", + "repoName": "boost.beast", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/beast/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-mwWy8hmRe+ToiX74I7k3qZNKGPKCUWcfWVlubZNQ+Gw=", + "strip_prefix": "beast-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.beast/1.83.0.bcr.1/patches/patch.diff": "sha256-i9TPieR2AvMga9iFzBqYcEJsx7Vfojy4ZC6Py4dMiRM=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.bimap@1.83.0.bcr.1": { + "name": "boost.bimap", + "version": "1.83.0.bcr.1", + "key": "boost.bimap@1.83.0.bcr.1", + "repoName": "boost.bimap", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/bimap/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-uMwzi0N9NQqe18kPCF6LYFpq32dKn2z3qWz3JdeK03U=", + "strip_prefix": "bimap-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.bimap/1.83.0.bcr.1/patches/patch.diff": "sha256-KPOEVhKhiy30HWTQ+58rVoS5jf4CaKM+PWd/FmMi64U=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.bind@1.83.0.bcr.1": { + "name": "boost.bind", + "version": "1.83.0.bcr.1", + "key": "boost.bind@1.83.0.bcr.1", + "repoName": "boost.bind", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/bind/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-U+HLqJ68bQ4dATYDq47bCPiy+792BrkeurgxCsSqwa8=", + "strip_prefix": "bind-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.bind/1.83.0.bcr.1/patches/patch.diff": "sha256-fdTEXJGT8TJRSNfoc7l0sLplxyPpHsb9IJEFfDhfhjk=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.callable_traits@1.83.0.bcr.1": { + "name": "boost.callable_traits", + "version": "1.83.0.bcr.1", + "key": "boost.callable_traits@1.83.0.bcr.1", + "repoName": "boost.callable_traits", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/callable_traits/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-iZUkWa35AhVdf2wdmtWRNzX+H8H+CqeFY2Jzww26h0M=", + "strip_prefix": "callable_traits-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.callable_traits/1.83.0.bcr.1/patches/patch.diff": "sha256-3A56uo0cT0m8bdOp71RZxJof6oosuITvcIx/0W8yjwM=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.chrono@1.83.0.bcr.1": { + "name": "boost.chrono", + "version": "1.83.0.bcr.1", + "key": "boost.chrono@1.83.0.bcr.1", + "repoName": "boost.chrono", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/chrono/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-8yY3CTFEpL06EULrgBE66txS4ubmK/G4QVYE4vnHJ8o=", + "strip_prefix": "chrono-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.chrono/1.83.0.bcr.1/patches/patch.diff": "sha256-43J1UBfFWLtdTtjSKA2VpglimPyQIeDu+ThfIRazg6c=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.circular_buffer@1.83.0.bcr.1": { + "name": "boost.circular_buffer", + "version": "1.83.0.bcr.1", + "key": "boost.circular_buffer@1.83.0.bcr.1", + "repoName": "boost.circular_buffer", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/circular_buffer/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-ye+CkaNtEUo1skESyi6IRFcrfUxN1akK5DUcXbm7k7U=", + "strip_prefix": "circular_buffer-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.circular_buffer/1.83.0.bcr.1/patches/patch.diff": "sha256-dvB68aHHJEAxkl/AEXLhGzQITF3VvM/O37OU7w1a1Ec=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.compatibility@1.83.0.bcr.1": { + "name": "boost.compatibility", + "version": "1.83.0.bcr.1", + "key": "boost.compatibility@1.83.0.bcr.1", + "repoName": "boost.compatibility", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/compatibility/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-kPbQ969eUIFEECj9/GzRki1a0xYwpyaFOy9ffKAlSpk=", + "strip_prefix": "compatibility-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.compatibility/1.83.0.bcr.1/patches/patch.diff": "sha256-eT4fYE9HviORY0cbK9QPT7womwCF7SAkjoRPOK7CeoY=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.compute@1.83.0.bcr.1": { + "name": "boost.compute", + "version": "1.83.0.bcr.1", + "key": "boost.compute@1.83.0.bcr.1", + "repoName": "boost.compute", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/compute/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-zsCIAA5CkQqMdb5PeesLcs3+XRBvIEjjnii7gOncKEE=", + "strip_prefix": "compute-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.compute/1.83.0.bcr.1/patches/patch.diff": "sha256-Guo6XNW5rygZCr27Tl3cwze5cY1Pk8z2Oe96eakhQYE=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.concept_check@1.83.0.bcr.1": { + "name": "boost.concept_check", + "version": "1.83.0.bcr.1", + "key": "boost.concept_check@1.83.0.bcr.1", + "repoName": "boost.concept_check", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/concept_check/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-XYNoKdHVdNG/Abb4ESI0OsjbW3bQ0gtFvnz4HbavWpY=", + "strip_prefix": "concept_check-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.concept_check/1.83.0.bcr.1/patches/patch.diff": "sha256-ZgQGupla7HdX4FvkfE+240XFKuoiAG8ojtAI4o8Lijc=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.config@1.83.0.bcr.1": { + "name": "boost.config", + "version": "1.83.0.bcr.1", + "key": "boost.config@1.83.0.bcr.1", + "repoName": "boost.config", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/config/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-uSfF4CxBqoM7fVxPnAnddmjnr/EIal47YlfU5IJWAbA=", + "strip_prefix": "config-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.config/1.83.0.bcr.1/patches/patch.diff": "sha256-IJc7YcHuA2wO0nLbyt1MAmfwUjUyt3noBGoJoS5rD+A=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.container@1.83.0.bcr.1": { + "name": "boost.container", + "version": "1.83.0.bcr.1", + "key": "boost.container@1.83.0.bcr.1", + "repoName": "boost.container", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "boost.intrusive": "boost.intrusive@1.83.0.bcr.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/container/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-DcVI5iyC2hxWpnJ0CWDAedfcO3W+f+GLohos8pIBU80=", + "strip_prefix": "container-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.container/1.83.0.bcr.1/patches/patch.diff": "sha256-IM75RBiwx6Mq3pwYEn6wCYwFfcQh1g0uW9AnS+eaKCY=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.container_hash@1.83.0.bcr.1": { + "name": "boost.container_hash", + "version": "1.83.0.bcr.1", + "key": "boost.container_hash@1.83.0.bcr.1", + "repoName": "boost.container_hash", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/container_hash/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-6j4lpgLEsMQsZC/cENLn4GTja2z842j5PrXyDLvZUDU=", + "strip_prefix": "container_hash-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.container_hash/1.83.0.bcr.1/patches/patch.diff": "sha256-NJAh0tlLH02Aa0nEaXKh38hr9bBTiyMIoxO736o7dvU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.context@1.83.0.bcr.1": { + "name": "boost.context", + "version": "1.83.0.bcr.1", + "key": "boost.context@1.83.0.bcr.1", + "repoName": "boost.context", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/context/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-/MbSfQikFDWSwmkTTdI7K3qGkW36YhmZW9JKTu/P5Oo=", + "strip_prefix": "context-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.context/1.83.0.bcr.1/patches/patch.diff": "sha256-P4BNPIB0VQHb5x1KYFgrUqgK2j8+A5bo/+6bFzT444c=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.contract@1.83.0.bcr.1": { + "name": "boost.contract", + "version": "1.83.0.bcr.1", + "key": "boost.contract@1.83.0.bcr.1", + "repoName": "boost.contract", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/contract/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-7Zw20ZH5fgzbYXdK+X2pU4jWo8LaMk7mAaFugA+0BDM=", + "strip_prefix": "contract-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.contract/1.83.0.bcr.1/patches/patch.diff": "sha256-rFq9jrR96q7h68hKT2RUZTujagtjh06nM/nNELcDSaY=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.conversion@1.83.0.bcr.1": { + "name": "boost.conversion", + "version": "1.83.0.bcr.1", + "key": "boost.conversion@1.83.0.bcr.1", + "repoName": "boost.conversion", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/conversion/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-LcTvJVMEQpJDhbqOL6fzecbKWiMDUxwizzhdDAQo4HE=", + "strip_prefix": "conversion-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.conversion/1.83.0.bcr.1/patches/patch.diff": "sha256-DYj7qYGIKTQKcSM/7Jcszts/XtESOZFWEVfgN6Qm0AA=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.convert@1.83.0.bcr.1": { + "name": "boost.convert", + "version": "1.83.0.bcr.1", + "key": "boost.convert@1.83.0.bcr.1", + "repoName": "boost.convert", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/convert/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-QAzeZPQ/Hn2Q2d5kv9UxuwntGsUab4sD3VX2V93QDjc=", + "strip_prefix": "convert-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.convert/1.83.0.bcr.1/patches/patch.diff": "sha256-3XRZEQ84ajbnXATHqHbei9FbgxMxrDkrXyvg+9VqhiY=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.coroutine@1.83.0.bcr.1": { + "name": "boost.coroutine", + "version": "1.83.0.bcr.1", + "key": "boost.coroutine@1.83.0.bcr.1", + "repoName": "boost.coroutine", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/coroutine/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-HiQlJBznuKTGgXKLya2v9a2Ow4Pl8/nLIuYpUZL6Qlg=", + "strip_prefix": "coroutine-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.coroutine/1.83.0.bcr.1/patches/patch.diff": "sha256-YoCCY1LOcZ/j8Dlle2ZiuWzGe3d03LJ//9laILxLY2c=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.coroutine2@1.83.0.bcr.1": { + "name": "boost.coroutine2", + "version": "1.83.0.bcr.1", + "key": "boost.coroutine2@1.83.0.bcr.1", + "repoName": "boost.coroutine2", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/coroutine2/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-RcxOTlmpSW5BLp8ReWNkNWhkiOgAMvCwRmjOjGQKXn0=", + "strip_prefix": "coroutine2-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.coroutine2/1.83.0.bcr.1/patches/patch.diff": "sha256-RHlOvX/Gt77is8x/Rei7GhcBmxSLs3LYXSYs8z02m8Y=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.crc@1.83.0.bcr.1": { + "name": "boost.crc", + "version": "1.83.0.bcr.1", + "key": "boost.crc@1.83.0.bcr.1", + "repoName": "boost.crc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/crc/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-A43+dRI19p8ZsDPduhL3bI40gNtv9Gr9KnFdBpXSLXo=", + "strip_prefix": "crc-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.crc/1.83.0.bcr.1/patches/patch.diff": "sha256-32LoPs2I9PABp6FdcOvw8Iusz7maR/ilOO61BTiwRNc=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.date_time@1.83.0.bcr.1": { + "name": "boost.date_time", + "version": "1.83.0.bcr.1", + "key": "boost.date_time@1.83.0.bcr.1", + "repoName": "boost.date_time", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "boost.serialization": "boost.serialization@1.83.0.bcr.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/date_time/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-lREanNKGi0H/rS7yq7HhdDftXmFBvinR8FxvX+DNHHQ=", + "strip_prefix": "date_time-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.date_time/1.83.0.bcr.1/patches/patch.diff": "sha256-yWVChApNwVo8tiNUhPZywnngm/iluvXJbgdNsyRh02A=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.describe@1.83.0.bcr.1": { + "name": "boost.describe", + "version": "1.83.0.bcr.1", + "key": "boost.describe@1.83.0.bcr.1", + "repoName": "boost.describe", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/describe/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-pIPnzATQYMAUljW4HM9fYqfiqQYvXUtO52i40p2j/U8=", + "strip_prefix": "describe-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.describe/1.83.0.bcr.1/patches/patch.diff": "sha256-HOxFdXyt3PRx5QM9UuHg+GAsaJ9szkjTulh24LdfH8Y=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.detail@1.83.0.bcr.1": { + "name": "boost.detail", + "version": "1.83.0.bcr.1", + "key": "boost.detail@1.83.0.bcr.1", + "repoName": "boost.detail", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/detail/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-bR2mqmLf56CyWpmlciUYscTTKAq9S05hEloNTWLBuuE=", + "strip_prefix": "detail-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.detail/1.83.0.bcr.1/patches/patch.diff": "sha256-j7oAc/VojgfBAmGuKUkjlnX7Fcgt/m3clLEwxDuKAbg=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.dll@1.83.0.bcr.1": { + "name": "boost.dll", + "version": "1.83.0.bcr.1", + "key": "boost.dll@1.83.0.bcr.1", + "repoName": "boost.dll", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/dll/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-qkcaFiWhO/boOdPpmRSmXzq5PCoFLGdT32DdK+psCSo=", + "strip_prefix": "dll-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.dll/1.83.0.bcr.1/patches/patch.diff": "sha256-3xeBVPzotMcpnp+NRnh6q5E3eJylD9S5T18ju6tJQKQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.dynamic_bitset@1.83.0.bcr.1": { + "name": "boost.dynamic_bitset", + "version": "1.83.0.bcr.1", + "key": "boost.dynamic_bitset@1.83.0.bcr.1", + "repoName": "boost.dynamic_bitset", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/dynamic_bitset/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-WVdk7ci9FDJinetJ/4fnRSpuQ5MKL/+kJLJUPtzyrYA=", + "strip_prefix": "dynamic_bitset-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.dynamic_bitset/1.83.0.bcr.1/patches/patch.diff": "sha256-WbrkvAcaPx8m9sIjkVW3yNcliCejWzr0h6PFWppQQts=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.endian@1.83.0.bcr.1": { + "name": "boost.endian", + "version": "1.83.0.bcr.1", + "key": "boost.endian@1.83.0.bcr.1", + "repoName": "boost.endian", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/endian/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-C3ZBOfQ3xeh1TBA3v7Fcfb5LSEbDLYvCPMsP9yiMreo=", + "strip_prefix": "endian-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.endian/1.83.0.bcr.1/patches/patch.diff": "sha256-yG/9kDobry3fuZqYvEMzcZHjMWNpQR/Yef9pTBr6z38=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.exception@1.83.0.bcr.1": { + "name": "boost.exception", + "version": "1.83.0.bcr.1", + "key": "boost.exception@1.83.0.bcr.1", + "repoName": "boost.exception", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/exception/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-SYJ8+mfZ7RtL1a6Ay05y7EQOYxxWSV7zyiBJYWqnfJE=", + "strip_prefix": "exception-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.exception/1.83.0.bcr.1/patches/patch.diff": "sha256-3o4CVNLe5jrDD2dMuNJWAzX2WIP51vXdYArjtEfe8vA=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.fiber@1.83.0.bcr.1": { + "name": "boost.fiber", + "version": "1.83.0.bcr.1", + "key": "boost.fiber@1.83.0.bcr.1", + "repoName": "boost.fiber", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/fiber/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-nm8G3HbbOV6IUY+yxEvUvU8cx9KB3wUEH7nIPvt7/JE=", + "strip_prefix": "fiber-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.fiber/1.83.0.bcr.1/patches/patch.diff": "sha256-oSw+NLQuSLg40vs8gC6mf/9qGnyukOh4UzhaygjcDJQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.filesystem@1.83.0.bcr.1": { + "name": "boost.filesystem", + "version": "1.83.0.bcr.1", + "key": "boost.filesystem@1.83.0.bcr.1", + "repoName": "boost.filesystem", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/filesystem/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-zXgXNEHxVZNe/ke1x84Jwp+BTH5cLK2p+zfUDI6mn00=", + "strip_prefix": "filesystem-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.filesystem/1.83.0.bcr.1/patches/patch.diff": "sha256-0tvpQRWY7KmA+1OU/zigeih1ypIUejAM59GVovokLx8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.flyweight@1.83.0.bcr.1": { + "name": "boost.flyweight", + "version": "1.83.0.bcr.1", + "key": "boost.flyweight@1.83.0.bcr.1", + "repoName": "boost.flyweight", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "boost.serialization": "boost.serialization@1.83.0.bcr.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/flyweight/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-g33RIs0QOihJRgsWnHFbWiLM6D90zD4N3GqMhWIh4yw=", + "strip_prefix": "flyweight-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.flyweight/1.83.0.bcr.1/patches/patch.diff": "sha256-v0u8YdzBWF5SOZ8ZNMivmosMyqCFM+gK5AIKAIgz9Zw=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.foreach@1.83.0.bcr.1": { + "name": "boost.foreach", + "version": "1.83.0.bcr.1", + "key": "boost.foreach@1.83.0.bcr.1", + "repoName": "boost.foreach", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/foreach/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-tLLFkIOzO7LWZZrKqE3ZFNa7JUOO0ritZ57E0VPLhvs=", + "strip_prefix": "foreach-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.foreach/1.83.0.bcr.1/patches/patch.diff": "sha256-Ocv7dpPVbAw/JgB/tKxdaFvqMoEPIS1DPW+LSATyOHk=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.format@1.83.0.bcr.1": { + "name": "boost.format", + "version": "1.83.0.bcr.1", + "key": "boost.format@1.83.0.bcr.1", + "repoName": "boost.format", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/format/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-q2j6WSaQ7E5Mf56HjxoZR5mnn8lWqwHOCEWho0Uqwww=", + "strip_prefix": "format-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.format/1.83.0.bcr.1/patches/patch.diff": "sha256-eqoVCz1hhlyou806yhOixC7D0biEQ4TeYAYDlFGHcUw=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.function@1.83.0.bcr.1": { + "name": "boost.function", + "version": "1.83.0.bcr.1", + "key": "boost.function@1.83.0.bcr.1", + "repoName": "boost.function", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/function/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-AEMEbJJjtSsMYSZJgb3p/H7ImZ/wYsGH1hiy5upro/I=", + "strip_prefix": "function-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.function/1.83.0.bcr.1/patches/patch.diff": "sha256-Fr7/Q4mPBLu9rJvv9n3O6B3G1YZSO/64Gwndwb2+X2w=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.function_types@1.83.0.bcr.1": { + "name": "boost.function_types", + "version": "1.83.0.bcr.1", + "key": "boost.function_types@1.83.0.bcr.1", + "repoName": "boost.function_types", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/function_types/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-e42k0zTpAo6pBT3ojtCjz+HQT0xI1fAsfMX31GTSwPA=", + "strip_prefix": "function_types-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.function_types/1.83.0.bcr.1/patches/patch.diff": "sha256-16vcnOQOnRaCG7IMR53SsCgYxO+iQmex1nJNBr3HN0c=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.functional@1.83.0.bcr.1": { + "name": "boost.functional", + "version": "1.83.0.bcr.1", + "key": "boost.functional@1.83.0.bcr.1", + "repoName": "boost.functional", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/functional/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-DbZLDFQJx8Ko0pHwXmDBuNgVotKqK6EjNS3iNgB1VHg=", + "strip_prefix": "functional-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.functional/1.83.0.bcr.1/patches/patch.diff": "sha256-UoSLDiQwAdRYCqRLy4DIOFix7QepQD231Ig1SaQ2YUw=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.fusion@1.83.0.bcr.1": { + "name": "boost.fusion", + "version": "1.83.0.bcr.1", + "key": "boost.fusion@1.83.0.bcr.1", + "repoName": "boost.fusion", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/fusion/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-cd2i+wxpBttO75Z5CL6LFJVM6YRM6enaKQ91BWiPdD0=", + "strip_prefix": "fusion-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.fusion/1.83.0.bcr.1/patches/patch.diff": "sha256-ZPoQu4OHrlS5vYUt0LNlhn0JzqFOvVrHxzar3Gl6pRE=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.geometry@1.83.0.bcr.1": { + "name": "boost.geometry", + "version": "1.83.0.bcr.1", + "key": "boost.geometry@1.83.0.bcr.1", + "repoName": "boost.geometry", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/geometry/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-gMsY87cYGKv477M0RkvngBbxUEbVzlNZGWjMPmXyiDY=", + "strip_prefix": "geometry-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.geometry/1.83.0.bcr.1/patches/patch.diff": "sha256-XXyy45AEiWuAGF+gZfKQsgIkF8dvZrIPcM+SdTTkW7o=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.gil@1.83.0.bcr.1": { + "name": "boost.gil", + "version": "1.83.0.bcr.1", + "key": "boost.gil@1.83.0.bcr.1", + "repoName": "boost.gil", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/gil/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-2b2olw2rzbxPp/rC9y+IDLJSMJGTZY6u7OZQ39YyBt4=", + "strip_prefix": "gil-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.gil/1.83.0.bcr.1/patches/patch.diff": "sha256-6gJbQSjkxH2z6G2ZffzM9wl97LIVQ2amBHaFlW/2Wc0=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.graph@1.83.0.bcr.1": { + "name": "boost.graph", + "version": "1.83.0.bcr.1", + "key": "boost.graph@1.83.0.bcr.1", + "repoName": "boost.graph", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/graph/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Zfx4iyDDdH/p2X+mU7ynQPmPLlOb03djfKRu2DLVoFs=", + "strip_prefix": "graph-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.graph/1.83.0.bcr.1/patches/patch.diff": "sha256-0UzlKawMEOH2W4Iv9lZVd92otA/28YjRjp59ZeYXnfM=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.graph.parallel@1.83.0.bcr.1": { + "name": "boost.graph.parallel", + "version": "1.83.0.bcr.1", + "key": "boost.graph.parallel@1.83.0.bcr.1", + "repoName": "boost.graph.parallel", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/graph_parallel/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-siFmLHzo7mLIkFtSeuT0NSfrBw5DoQR5VYyhlqAm0m8=", + "strip_prefix": "graph_parallel-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.graph.parallel/1.83.0.bcr.1/patches/patch.diff": "sha256-SR9Y8fXSiftqYnPJMK8WODj4cQu2x6lScbhWgpyorLA=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.hana@1.83.0.bcr.1": { + "name": "boost.hana", + "version": "1.83.0.bcr.1", + "key": "boost.hana@1.83.0.bcr.1", + "repoName": "boost.hana", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/hana/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-WSKMdEuyLpARvW2Bc1hdh0mAGmAoHJKSmoe7u41yG0k=", + "strip_prefix": "hana-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.hana/1.83.0.bcr.1/patches/patch.diff": "sha256-X6ZG74Szd+EBNrsBDr4s01jwo9fDsIqUepJQONQ2N7s=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.heap@1.83.0.bcr.1": { + "name": "boost.heap", + "version": "1.83.0.bcr.1", + "key": "boost.heap@1.83.0.bcr.1", + "repoName": "boost.heap", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/heap/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-gblkIzYguK5V5vbHO7IHWr5Tz9vPz52URVLW1a6yD5w=", + "strip_prefix": "heap-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.heap/1.83.0.bcr.1/patches/patch.diff": "sha256-w0sRP/On2YIDY1+8pJmwiJqDMLPmqwhI03uBx02tHOo=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.histogram@1.83.0.bcr.1": { + "name": "boost.histogram", + "version": "1.83.0.bcr.1", + "key": "boost.histogram@1.83.0.bcr.1", + "repoName": "boost.histogram", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/histogram/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-jA36jyPpJzR+PMa/7JqoeODBv9M3iaUwZxzNeRAH1oo=", + "strip_prefix": "histogram-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.histogram/1.83.0.bcr.1/patches/patch.diff": "sha256-HsLwy3Dfd7/4kAXc7fPTzwV4CkwXXaffD2/z8tN6pfg=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.hof@1.83.0.bcr.1": { + "name": "boost.hof", + "version": "1.83.0.bcr.1", + "key": "boost.hof@1.83.0.bcr.1", + "repoName": "boost.hof", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/hof/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-orQPtW7q0tnIWgKRwxtOgkK6beDvXBtQDDcyMHIfejU=", + "strip_prefix": "hof-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.hof/1.83.0.bcr.1/patches/patch.diff": "sha256-TIKs1+9jeW32tLFPAstnFvOX+HnFtOU4LRn30ebdCJU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.icl@1.83.0.bcr.1": { + "name": "boost.icl", + "version": "1.83.0.bcr.1", + "key": "boost.icl@1.83.0.bcr.1", + "repoName": "boost.icl", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/icl/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-/iUG2bUmf92k7TCA0Vo7s637EpjG/psIy4EhAhhR3lM=", + "strip_prefix": "icl-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.icl/1.83.0.bcr.1/patches/patch.diff": "sha256-6RWmdFGOFeYt0er4CN8NT5j7HyGZwl5oHCigu955xoA=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.integer@1.83.0.bcr.1": { + "name": "boost.integer", + "version": "1.83.0.bcr.1", + "key": "boost.integer@1.83.0.bcr.1", + "repoName": "boost.integer", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/integer/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-tlh87M1ox4iHMUDzZYH06KU8w2W6qSmBjhXwI5tUvRQ=", + "strip_prefix": "integer-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.integer/1.83.0.bcr.1/patches/patch.diff": "sha256-CWooeAnJxV7ZvOlYJBK5bqkbSF+wyKtZc8fMGNB5ZUc=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.interprocess@1.83.0.bcr.1": { + "name": "boost.interprocess", + "version": "1.83.0.bcr.1", + "key": "boost.interprocess@1.83.0.bcr.1", + "repoName": "boost.interprocess", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/interprocess/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-VBDvzDye7VkT+DpIQ0rz2IIhRbq5Zgm1etACNOCUOMk=", + "strip_prefix": "interprocess-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.interprocess/1.83.0.bcr.1/patches/patch.diff": "sha256-lLbv8lW34yx4WLFhkuQ1eu7vZ/P+shzTpSgnR15oSl4=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.intrusive@1.83.0.bcr.1": { + "name": "boost.intrusive", + "version": "1.83.0.bcr.1", + "key": "boost.intrusive@1.83.0.bcr.1", + "repoName": "boost.intrusive", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/intrusive/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-T96q/xIwSFzM8BJ4/PefK+kHiqHu5RPc5YzNzMB7xqQ=", + "strip_prefix": "intrusive-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.intrusive/1.83.0.bcr.1/patches/patch.diff": "sha256-WkK0OkUl9kCAC+uCPkhXB+np6dwAz2JHnhC8UR4XGJI=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.io@1.83.0.bcr.1": { + "name": "boost.io", + "version": "1.83.0.bcr.1", + "key": "boost.io@1.83.0.bcr.1", + "repoName": "boost.io", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/io/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-2gS/1jh06gSFTT3ha8LOztJ7AcIJasoy/c49G0IVRN8=", + "strip_prefix": "io-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.io/1.83.0.bcr.1/patches/patch.diff": "sha256-g4WQd3EegLUAYgUn4OW7aoF3bhQ4lGwkfvNVkjApFE4=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.iostreams@1.83.0.bcr.1": { + "name": "boost.iostreams", + "version": "1.83.0.bcr.1", + "key": "boost.iostreams@1.83.0.bcr.1", + "repoName": "boost.iostreams", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bzip2": "bzip2@1.0.8", + "zlib": "zlib@1.3.1.bcr.1", + "zstd": "zstd@1.5.5.bcr.2", + "xz": "xz@5.4.5", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/iostreams/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-al5R/nuBd47r4jmRBpnmX2BPHMVA10PvGW7al7KYrE8=", + "strip_prefix": "iostreams-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.iostreams/1.83.0.bcr.1/patches/patch.diff": "sha256-NLyFzCppRkGeEp0KUSZljeMdMUhSppXOl36SBTX0mbI=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.iterator@1.83.0.bcr.1": { + "name": "boost.iterator", + "version": "1.83.0.bcr.1", + "key": "boost.iterator@1.83.0.bcr.1", + "repoName": "boost.iterator", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/iterator/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-fZub0GVtQlf2DuScpGzAaIIwC3CJJGY/FGzCLx7TSQU=", + "strip_prefix": "iterator-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.iterator/1.83.0.bcr.1/patches/patch.diff": "sha256-hN0JFBcFA4vtvcpF4Hfix7MK1+veidQTpFLjtD5bUr4=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.json@1.83.0.bcr.1": { + "name": "boost.json", + "version": "1.83.0.bcr.1", + "key": "boost.json@1.83.0.bcr.1", + "repoName": "boost.json", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/json/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-KbOy09aVOIK+104qRaoosKlVipP7JIHD2bbL3AWvyX4=", + "strip_prefix": "json-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.json/1.83.0.bcr.1/patches/patch.diff": "sha256-Nnm8/wx+AK711DNDnQrFyqFGE8ko3FWVJzeGca8bFyg=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.lambda@1.83.0.bcr.1": { + "name": "boost.lambda", + "version": "1.83.0.bcr.1", + "key": "boost.lambda@1.83.0.bcr.1", + "repoName": "boost.lambda", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/lambda/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-AHwE22E2NDBAuK1wT8W6Hl1aKgqPTlmdOls7T5O2HP8=", + "strip_prefix": "lambda-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.lambda/1.83.0.bcr.1/patches/patch.diff": "sha256-RKs39HJd8MpGq366RUt5UlJLYvXPSGukn3wRJ+6xLfE=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.lambda2@1.83.0.bcr.1": { + "name": "boost.lambda2", + "version": "1.83.0.bcr.1", + "key": "boost.lambda2@1.83.0.bcr.1", + "repoName": "boost.lambda2", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/lambda2/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-I+H05aqT20E4WDAYbT+5Fgi1Pm5Imn5MMoe9MvcOKjk=", + "strip_prefix": "lambda2-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.lambda2/1.83.0.bcr.1/patches/patch.diff": "sha256-IfTVpEnOs0C44SL2Oew+GBYjzHr75izhmKcDJ/rYIh8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.leaf@1.83.0.bcr.1": { + "name": "boost.leaf", + "version": "1.83.0.bcr.1", + "key": "boost.leaf@1.83.0.bcr.1", + "repoName": "boost.leaf", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/leaf/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-VZsWrCzSh4hRBPbSuTzHd/E22Y6J47mRUBNWHYk/USg=", + "strip_prefix": "leaf-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.leaf/1.83.0.bcr.1/patches/patch.diff": "sha256-Gwoy15yBEgwBMqmxaGBOf2+bVNA8grutYzLj0Z2MMVQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.lexical_cast@1.83.0.bcr.1": { + "name": "boost.lexical_cast", + "version": "1.83.0.bcr.1", + "key": "boost.lexical_cast@1.83.0.bcr.1", + "repoName": "boost.lexical_cast", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/lexical_cast/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-5QXqwGcj8JUXSnmuxm0zLzbz9MmJrm6IKgxXegt60LQ=", + "strip_prefix": "lexical_cast-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.lexical_cast/1.83.0.bcr.1/patches/patch.diff": "sha256-aLVh5lnwgibQYdaCtu01mOHOpepMFR5nGBhPWQ441ZY=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.local_function@1.83.0.bcr.1": { + "name": "boost.local_function", + "version": "1.83.0.bcr.1", + "key": "boost.local_function@1.83.0.bcr.1", + "repoName": "boost.local_function", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/local_function/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-z+LWzKeLqoj/4tQd4VwWFf+uPfb9kHH6dbr3wKx8fq0=", + "strip_prefix": "local_function-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.local_function/1.83.0.bcr.1/patches/patch.diff": "sha256-y8KIKLUqlmLTfQ8jNg4EMSfG9qvxug42SlOoXCSGK50=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.locale@1.83.0.bcr.1": { + "name": "boost.locale", + "version": "1.83.0.bcr.1", + "key": "boost.locale@1.83.0.bcr.1", + "repoName": "boost.locale", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/locale/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-gXwHNNslTD38E/f79JFWQHqF3EU2oxOM8Rsepmemb/4=", + "strip_prefix": "locale-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.locale/1.83.0.bcr.1/patches/patch.diff": "sha256-3/KTVbK/OynFokJd88AbB6E2367Gt4xChpldIFcq7rI=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.lockfree@1.83.0.bcr.1": { + "name": "boost.lockfree", + "version": "1.83.0.bcr.1", + "key": "boost.lockfree@1.83.0.bcr.1", + "repoName": "boost.lockfree", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/lockfree/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-g8rSRTDkR7o/2BYKLhAuwUkSaF7pNQ4kbVoXGfcNYKo=", + "strip_prefix": "lockfree-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.lockfree/1.83.0.bcr.1/patches/patch.diff": "sha256-JOYvgeiMMKeLWTxfkqG0WnOcbIR4jzLrkV3s4gnQPRU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.log@1.83.0.bcr.1": { + "name": "boost.log", + "version": "1.83.0.bcr.1", + "key": "boost.log@1.83.0.bcr.1", + "repoName": "boost.log", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/log/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Tie9MOq6CoEiUkQBDj2piICIqffAoOnCYfgG9i4YNn4=", + "strip_prefix": "log-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.log/1.83.0.bcr.1/patches/patch.diff": "sha256-THsmqLEKRenOdk0dOl917FhVx3t9FVeHVb3anQixdLU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.logic@1.83.0.bcr.1": { + "name": "boost.logic", + "version": "1.83.0.bcr.1", + "key": "boost.logic@1.83.0.bcr.1", + "repoName": "boost.logic", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/logic/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Su/u6Q8xIbzo2DiyMrbuVJvQBL1boKs5ejdva2XEyl0=", + "strip_prefix": "logic-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.logic/1.83.0.bcr.1/patches/patch.diff": "sha256-EQCul6iVCMv+cpGCkIPDVN8BVx1+4yhNHhaNJy4vjRY=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.math@1.83.0.bcr.1": { + "name": "boost.math", + "version": "1.83.0.bcr.1", + "key": "boost.math@1.83.0.bcr.1", + "repoName": "boost.math", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/math/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-U+X3U5pmiZ/g/KMIBAXL1feVnaU5TsE2ZHRnQa7OFwU=", + "strip_prefix": "math-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.math/1.83.0.bcr.1/patches/patch.diff": "sha256-WAT7owkEznxKYmcUwf4qWcTjy3+sGWyUe8EH6p0rzmg=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.metaparse@1.83.0.bcr.1": { + "name": "boost.metaparse", + "version": "1.83.0.bcr.1", + "key": "boost.metaparse@1.83.0.bcr.1", + "repoName": "boost.metaparse", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/metaparse/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-d7/udqG3faNrftGJNZDNCDKSbs0UlKKDLgkCoQwS6gg=", + "strip_prefix": "metaparse-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.metaparse/1.83.0.bcr.1/patches/patch.diff": "sha256-KRiVkilV9IRs8I4xd5vj4o2AGCpNZQG4KRB7CIFsTn8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.move@1.83.0.bcr.1": { + "name": "boost.move", + "version": "1.83.0.bcr.1", + "key": "boost.move@1.83.0.bcr.1", + "repoName": "boost.move", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/move/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Y6C/bco+qpe94T8rLI+FmXwbvmloGsXhlR2VX0FUue0=", + "strip_prefix": "move-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.move/1.83.0.bcr.1/patches/patch.diff": "sha256-lrhpQet3pwSyj+nrkq6Cxx4WQlAWKBcVkSbcO/p5VbQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.mp11@1.83.0.bcr.1": { + "name": "boost.mp11", + "version": "1.83.0.bcr.1", + "key": "boost.mp11@1.83.0.bcr.1", + "repoName": "boost.mp11", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/mp11/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-WwpDl/84bguU5m8Yzm09vJIwrOQESLvHmjljwWbDJtE=", + "strip_prefix": "mp11-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.mp11/1.83.0.bcr.1/patches/patch.diff": "sha256-feS0WE7Ux8HICPi5CjzuFdC1iYtf2MWmxxxwMtWQ6Dw=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.mpi@1.83.0.bcr.1": { + "name": "boost.mpi", + "version": "1.83.0.bcr.1", + "key": "boost.mpi@1.83.0.bcr.1", + "repoName": "boost.mpi", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/mpi/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-vmX0oe4VMdj8CYD6WzOIn/1ep9DJdNZLDf2HhNap0lo=", + "strip_prefix": "mpi-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.mpi/1.83.0.bcr.1/patches/patch.diff": "sha256-TRj60d/LmYXyD11pXr6EDeH9LhG8yZz+AcQg/vzViRk=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.mpl@1.83.0.bcr.1": { + "name": "boost.mpl", + "version": "1.83.0.bcr.1", + "key": "boost.mpl@1.83.0.bcr.1", + "repoName": "boost.mpl", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/mpl/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-ckylsTYlc6p5gSHIDSPQdzGg33QcYaRvDYurMxgQPNQ=", + "strip_prefix": "mpl-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.mpl/1.83.0.bcr.1/patches/patch.diff": "sha256-cCPbBxNSFCfNjeu/utvzwGxjqco9wPUVrDnEYaJgKZ8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.msm@1.83.0.bcr.1": { + "name": "boost.msm", + "version": "1.83.0.bcr.1", + "key": "boost.msm@1.83.0.bcr.1", + "repoName": "boost.msm", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/msm/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Xye1f2Y8mcAFI4MZHuYK0J7bElTrBcg2CBScs88luFo=", + "strip_prefix": "msm-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.msm/1.83.0.bcr.1/patches/patch.diff": "sha256-+oZUVUna29X+CMsFURyrInxgcZNrT7KPZWjjvLCUQr8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.multi_array@1.83.0.bcr.1": { + "name": "boost.multi_array", + "version": "1.83.0.bcr.1", + "key": "boost.multi_array@1.83.0.bcr.1", + "repoName": "boost.multi_array", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/multi_array/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-8BFAkI3dlZdRuffzXYOOJ5YFDOgGrOJXZLu0vxPmxco=", + "strip_prefix": "multi_array-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.multi_array/1.83.0.bcr.1/patches/patch.diff": "sha256-1cxwYImWrqeLczJsBD6+AxcQ3Wpdxq8pI3Ncg8boCKo=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.multi_index@1.83.0.bcr.1": { + "name": "boost.multi_index", + "version": "1.83.0.bcr.1", + "key": "boost.multi_index@1.83.0.bcr.1", + "repoName": "boost.multi_index", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/multi_index/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-HH/jSMQaRWFetZcFI5AUGUbhoWfwgyVJ3k1FALoCwD4=", + "strip_prefix": "multi_index-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.multi_index/1.83.0.bcr.1/patches/patch.diff": "sha256-4HTAZYr/ihqi3VXFjrM3rUQRNw5y/gY+IOLOXsTfy2c=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.multiprecision@1.83.0.bcr.1": { + "name": "boost.multiprecision", + "version": "1.83.0.bcr.1", + "key": "boost.multiprecision@1.83.0.bcr.1", + "repoName": "boost.multiprecision", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/multiprecision/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-rJgUVSZlBR+lKCBtjT+EFQFeKrcyIOHXwCd7qwO9bT4=", + "strip_prefix": "multiprecision-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.multiprecision/1.83.0.bcr.1/patches/patch.diff": "sha256-IqW6og8UU8NZbd7OOv6dPHiJDCuEN/5UoJNdAU4YIJ8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.nowide@1.83.0.bcr.1": { + "name": "boost.nowide", + "version": "1.83.0.bcr.1", + "key": "boost.nowide@1.83.0.bcr.1", + "repoName": "boost.nowide", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/nowide/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-/9u/blrXQlU2vxj4vrk+OKU9oDRnFTf/WOQwzlccltE=", + "strip_prefix": "nowide-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.nowide/1.83.0.bcr.1/patches/patch.diff": "sha256-AgjOlKmDhIWE0ujZL/StTkMbzBhiDpNb07wbwievg14=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.numeric.conversion@1.83.0.bcr.1": { + "name": "boost.numeric.conversion", + "version": "1.83.0.bcr.1", + "key": "boost.numeric.conversion@1.83.0.bcr.1", + "repoName": "boost.numeric.conversion", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/numeric_conversion/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-/PKczBsLK7T+8MNQD3q5TFxlbN11iqUGB+d71kd9J5c=", + "strip_prefix": "numeric_conversion-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.numeric.conversion/1.83.0.bcr.1/patches/patch.diff": "sha256-luw37widLCzg7xIWj/WqlIKRjGj6xDGCpBIDbf9ylKA=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.numeric.interval@1.83.0.bcr.1": { + "name": "boost.numeric.interval", + "version": "1.83.0.bcr.1", + "key": "boost.numeric.interval@1.83.0.bcr.1", + "repoName": "boost.numeric.interval", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/interval/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-CFhPNYiC1iPMWhejN8Dau6MVKq57+4u32/G7wi/RY6I=", + "strip_prefix": "interval-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.numeric.interval/1.83.0.bcr.1/patches/patch.diff": "sha256-iPDRDaTFqJYhBIJY29wa6IsLNeniWSSDFhId+A9Vyc0=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.numeric.odeint@1.83.0.bcr.1": { + "name": "boost.numeric.odeint", + "version": "1.83.0.bcr.1", + "key": "boost.numeric.odeint@1.83.0.bcr.1", + "repoName": "boost.numeric.odeint", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/odeint/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Sdu7Vf9K9Qg/Hy6Uo3nJNFZH0hIQ6nFrCe5OTj/rWp4=", + "strip_prefix": "odeint-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.numeric.odeint/1.83.0.bcr.1/patches/patch.diff": "sha256-nQAE1gn6drW2iBLbK5aFIrYxCFp/w3bFKlCeDgf3dIA=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.numeric.ublas@1.83.0.bcr.1": { + "name": "boost.numeric.ublas", + "version": "1.83.0.bcr.1", + "key": "boost.numeric.ublas@1.83.0.bcr.1", + "repoName": "boost.numeric.ublas", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/ublas/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-evCThlweVmZrE2/GD0vqnP8O3XJD29khnXqRA+qUD8Q=", + "strip_prefix": "ublas-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.numeric.ublas/1.83.0.bcr.1/patches/patch.diff": "sha256-UY7B1GcC5KVtLpv1BtMIejREG/YMgyKZO0bh5B48PIs=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.optional@1.83.0.bcr.1": { + "name": "boost.optional", + "version": "1.83.0.bcr.1", + "key": "boost.optional@1.83.0.bcr.1", + "repoName": "boost.optional", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/optional/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Q2ub2unT9FSJ5zzssfsD7IQWMRD67/CgOa0esv09kDE=", + "strip_prefix": "optional-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.optional/1.83.0.bcr.1/patches/patch.diff": "sha256-yHsx0QN1CGMLVwmFcbIUPGodqn+VMb7GAfzVKzJu+EY=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.outcome@1.83.0.bcr.1": { + "name": "boost.outcome", + "version": "1.83.0.bcr.1", + "key": "boost.outcome@1.83.0.bcr.1", + "repoName": "boost.outcome", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/outcome/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-tDVF6QBQxX0K0gX65qPDzrBvz5+bAWNATsW8v9s3uiM=", + "strip_prefix": "outcome-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.outcome/1.83.0.bcr.1/patches/patch.diff": "sha256-jqpkkiLmkxjh5RadLVQhpwqUeIfMOwCStlIQidFfn4A=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.parameter@1.83.0.bcr.1": { + "name": "boost.parameter", + "version": "1.83.0.bcr.1", + "key": "boost.parameter@1.83.0.bcr.1", + "repoName": "boost.parameter", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/parameter/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-ts0/KzWljf/+CmvcdLNDEQrZ+WCNsQnuT3Vzuy+4VPU=", + "strip_prefix": "parameter-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.parameter/1.83.0.bcr.1/patches/patch.diff": "sha256-yUcG6IUt0XY7PGez+MTCgb7/49jJfcG8HA+iOMo21D8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.parameter_python@1.83.0.bcr.1": { + "name": "boost.parameter_python", + "version": "1.83.0.bcr.1", + "key": "boost.parameter_python@1.83.0.bcr.1", + "repoName": "boost.parameter_python", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/parameter_python/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-rrpwHX7st1u1DEWiCPvDcoZK9yihuo7mih1U+/g/9Lk=", + "strip_prefix": "parameter_python-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.parameter_python/1.83.0.bcr.1/patches/patch.diff": "sha256-gjtnFotF4jpt/1qjCtchN3yTjczq1p4y9q0j8R5zFtM=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.pfr@1.83.0.bcr.1": { + "name": "boost.pfr", + "version": "1.83.0.bcr.1", + "key": "boost.pfr@1.83.0.bcr.1", + "repoName": "boost.pfr", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/pfr/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-KPu5/VnMsEGTWryU4zh9JT85Kz5tQdx/Ob9KYHuQOWI=", + "strip_prefix": "pfr-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.pfr/1.83.0.bcr.1/patches/patch.diff": "sha256-DCEdX0HLMAKEVnLpJ3Bh3BNVKNhuMwBDfXk64FzPz8c=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.phoenix@1.83.0.bcr.1": { + "name": "boost.phoenix", + "version": "1.83.0.bcr.1", + "key": "boost.phoenix@1.83.0.bcr.1", + "repoName": "boost.phoenix", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/phoenix/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Sd478RPSWZmYqkjRXVgFedilHVBR794b58Fg5Iesdnk=", + "strip_prefix": "phoenix-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.phoenix/1.83.0.bcr.1/patches/patch.diff": "sha256-1SG+7DlCp/Y4I4nft6tqgrwbjaUNBiLwXTP+jiN3QJ4=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.poly_collection@1.83.0.bcr.1": { + "name": "boost.poly_collection", + "version": "1.83.0.bcr.1", + "key": "boost.poly_collection@1.83.0.bcr.1", + "repoName": "boost.poly_collection", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/poly_collection/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-MolknbszrczBQ9oJDWu7qem/O4+xeFXm3Gur+bz6ISo=", + "strip_prefix": "poly_collection-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.poly_collection/1.83.0.bcr.1/patches/patch.diff": "sha256-/UPEUJTJfqR4giYnFIU4M51iY9xVoqLcQcZ4aGr8in0=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.polygon@1.83.0.bcr.1": { + "name": "boost.polygon", + "version": "1.83.0.bcr.1", + "key": "boost.polygon@1.83.0.bcr.1", + "repoName": "boost.polygon", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/polygon/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-uKkYuoPnpDxp+YP6pXNcK47UOI7jcQxWH+LB98WXY4o=", + "strip_prefix": "polygon-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.polygon/1.83.0.bcr.1/patches/patch.diff": "sha256-s8UPPL6WfVmDkb/zp+tVbYsAl9mVVdg21wRTVoxYOtg=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.pool@1.83.0.bcr.1": { + "name": "boost.pool", + "version": "1.83.0.bcr.1", + "key": "boost.pool@1.83.0.bcr.1", + "repoName": "boost.pool", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/pool/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-rUf96POXlmx04eOU8dzWao1CEyixKXoEnrvSkNeuJfI=", + "strip_prefix": "pool-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.pool/1.83.0.bcr.1/patches/patch.diff": "sha256-94vHGnlZiiGIa2v9nLmqHQha8pqwf2ld7DfcVtk9bY8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.preprocessor@1.83.0.bcr.1": { + "name": "boost.preprocessor", + "version": "1.83.0.bcr.1", + "key": "boost.preprocessor@1.83.0.bcr.1", + "repoName": "boost.preprocessor", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/preprocessor/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-a8hKNH8rYwDETG7kjVRpErZBZvM+BNpH34McLweS8XU=", + "strip_prefix": "preprocessor-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.preprocessor/1.83.0.bcr.1/patches/patch.diff": "sha256-BrHvxB74YojV4JdJZqN16bzeasz5eVkcV7fJYIvX/BQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.process@1.83.0.bcr.1": { + "name": "boost.process", + "version": "1.83.0.bcr.1", + "key": "boost.process@1.83.0.bcr.1", + "repoName": "boost.process", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/process/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-7NM3CrPe+ZkKaRdmcRhiGVtwLTMUcQKjlZJpkGKn/4w=", + "strip_prefix": "process-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.process/1.83.0.bcr.1/patches/patch.diff": "sha256-+cyoNbsxT+iFj31qSGKBZDUK8sP/5Z6JsdWqs+v56IA=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.property_map@1.83.0.bcr.1": { + "name": "boost.property_map", + "version": "1.83.0.bcr.1", + "key": "boost.property_map@1.83.0.bcr.1", + "repoName": "boost.property_map", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/property_map/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-dcJOIC018eIpoVqb++SVT0fPgFbWuRMWBEbJJtzk4yE=", + "strip_prefix": "property_map-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.property_map/1.83.0.bcr.1/patches/patch.diff": "sha256-lovKTsvmoMgE5mnu/IccuXIfQuTF8nzl7sB/rfEWjGc=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.property_map.parallel@1.83.0.bcr.1": { + "name": "boost.property_map.parallel", + "version": "1.83.0.bcr.1", + "key": "boost.property_map.parallel@1.83.0.bcr.1", + "repoName": "boost.property_map.parallel", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/property_map_parallel/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-HZbHLmSQenMZJJEVt/etIk8FG41U+ftS2VnRHqLy7HY=", + "strip_prefix": "property_map_parallel-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.property_map.parallel/1.83.0.bcr.1/patches/patch.diff": "sha256-6D0dsFZVJg/ybi1wMsXvJ/MbUgTB4Amzexse0MSHch8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.property_tree@1.83.0.bcr.1": { + "name": "boost.property_tree", + "version": "1.83.0.bcr.1", + "key": "boost.property_tree@1.83.0.bcr.1", + "repoName": "boost.property_tree", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/property_tree/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-fLRhIcwRCI1vgrLfLyfq3RIiQ/l98ydTeRYOhu/q2mE=", + "strip_prefix": "property_tree-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.property_tree/1.83.0.bcr.1/patches/patch.diff": "sha256-9eoNlhacp5EcC1LjTWqXeGSt6yvQAWt2vZRd5A7EF6w=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.proto@1.83.0.bcr.1": { + "name": "boost.proto", + "version": "1.83.0.bcr.1", + "key": "boost.proto@1.83.0.bcr.1", + "repoName": "boost.proto", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/proto/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-6ipe2Zxc+1e5uATgVLABrp5AM3UXEXhNWp6dsqMWDYE=", + "strip_prefix": "proto-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.proto/1.83.0.bcr.1/patches/patch.diff": "sha256-ZFQ3xcym9ZqTfHwTlVXSQ0lMX/Z4pKUnEnghZRcXOrI=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.ptr_container@1.83.0.bcr.1": { + "name": "boost.ptr_container", + "version": "1.83.0.bcr.1", + "key": "boost.ptr_container@1.83.0.bcr.1", + "repoName": "boost.ptr_container", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/ptr_container/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-4WKtqbfuF9YxvnmFKpN1qENGR+fSraHXL0nXnGyUKus=", + "strip_prefix": "ptr_container-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.ptr_container/1.83.0.bcr.1/patches/patch.diff": "sha256-oPReA4lbftT3ChAxKBl91v6CH2W80astMzMtLigWXjM=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.python@1.83.0.bcr.1": { + "name": "boost.python", + "version": "1.83.0.bcr.1", + "key": "boost.python@1.83.0.bcr.1", + "repoName": "boost.python", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/python/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-ZwLOzZdZsVXnb8GZmPtukHwRVRX4Lq6AcEuaNSEJnj8=", + "strip_prefix": "python-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.python/1.83.0.bcr.1/patches/patch.diff": "sha256-0FbWOTmiIAElNr6NjoiDFJZmzMe2hZL6WeQP+LCXudw=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.qvm@1.83.0.bcr.1": { + "name": "boost.qvm", + "version": "1.83.0.bcr.1", + "key": "boost.qvm@1.83.0.bcr.1", + "repoName": "boost.qvm", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/qvm/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Q/cWYWh1BZxLbEwb25ngIn6gwg6VTQcy7ssfLXEn9mg=", + "strip_prefix": "qvm-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.qvm/1.83.0.bcr.1/patches/patch.diff": "sha256-d6cBelOuI5ItDg3NyuPf2vDR3J7ICJQXWXJF4iQIJiQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.random@1.83.0.bcr.1": { + "name": "boost.random", + "version": "1.83.0.bcr.1", + "key": "boost.random@1.83.0.bcr.1", + "repoName": "boost.random", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/random/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-5qVfaZ7Uy/d5CaYd+MBJGxqt5GxSrnYMDC3zdhkZrV8=", + "strip_prefix": "random-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.random/1.83.0.bcr.1/patches/patch.diff": "sha256-Osd0tgT8BbIslgmO7Ta8B1rug9DzD8hJgkiOLNLlH3o=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.range@1.83.0.bcr.1": { + "name": "boost.range", + "version": "1.83.0.bcr.1", + "key": "boost.range@1.83.0.bcr.1", + "repoName": "boost.range", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/range/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-f3PxqvkgpskYyvcRHlCvZSCiq9IpUHydi3WLRs514s8=", + "strip_prefix": "range-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.range/1.83.0.bcr.1/patches/patch.diff": "sha256-yIYvcS/VX2UICsaOSQ8dP3RlBhifI2lwGF/N+NGznow=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.ratio@1.83.0.bcr.1": { + "name": "boost.ratio", + "version": "1.83.0.bcr.1", + "key": "boost.ratio@1.83.0.bcr.1", + "repoName": "boost.ratio", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/ratio/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-bTeBpdDcRYAZlmueV+feIQziQlQDWNU5t55f+o1V7QE=", + "strip_prefix": "ratio-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.ratio/1.83.0.bcr.1/patches/patch.diff": "sha256-UEjMrg5nLvaWISUbm08K6S6egEn5YAfEio23lOb2l4c=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.rational@1.83.0.bcr.1": { + "name": "boost.rational", + "version": "1.83.0.bcr.1", + "key": "boost.rational@1.83.0.bcr.1", + "repoName": "boost.rational", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/rational/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-+TpeLEKGV0D32e8YBD3gHHVYYJ3dVBQaRDaK5e00xqU=", + "strip_prefix": "rational-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.rational/1.83.0.bcr.1/patches/patch.diff": "sha256-aPGgInX4KfQEZKyFrTGOLTq2Y2HHFJxkCIiYF3KBmeo=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.regex@1.83.0.bcr.1": { + "name": "boost.regex", + "version": "1.83.0.bcr.1", + "key": "boost.regex@1.83.0.bcr.1", + "repoName": "boost.regex", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/regex/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-GqnL6F6aAHeyCj2j0aSNvyuVZNHHcODMWJU1Sv+fRhY=", + "strip_prefix": "regex-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.regex/1.83.0.bcr.1/patches/patch.diff": "sha256-vIrYYwnIcntYuqnq19VwmomnTjnzcKsTm8AT+wYho+g=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.safe_numerics@1.83.0.bcr.1": { + "name": "boost.safe_numerics", + "version": "1.83.0.bcr.1", + "key": "boost.safe_numerics@1.83.0.bcr.1", + "repoName": "boost.safe_numerics", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/safe_numerics/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Ongm7T8tNCVrfaQKqA5FcIg6FTFEig/mDrwmQSmS2NI=", + "strip_prefix": "safe_numerics-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.safe_numerics/1.83.0.bcr.1/patches/patch.diff": "sha256-VoVgwASi62ZHbMQekHCRFz4JYeTIoYlwiRzHH596eqA=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.scope_exit@1.83.0.bcr.1": { + "name": "boost.scope_exit", + "version": "1.83.0.bcr.1", + "key": "boost.scope_exit@1.83.0.bcr.1", + "repoName": "boost.scope_exit", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/scope_exit/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-aENAR6nUVmGHyQ8dID6hpR/lc+5kKm4zzroN2LcgXi8=", + "strip_prefix": "scope_exit-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.scope_exit/1.83.0.bcr.1/patches/patch.diff": "sha256-09/m0mAu5cJvgb4lSc8vp+iSPv5dcPd7Q0MBmPiJZJY=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.signals2@1.83.0.bcr.1": { + "name": "boost.signals2", + "version": "1.83.0.bcr.1", + "key": "boost.signals2@1.83.0.bcr.1", + "repoName": "boost.signals2", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/signals2/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Ykzi3l28HZ/ViGp1Jtn/fFxdIIVRqGLuAFIzg5Yb61Y=", + "strip_prefix": "signals2-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.signals2/1.83.0.bcr.1/patches/patch.diff": "sha256-IbOUGP18hNEkNIIwpGlrVHFy6+QXMkW9lfSUjC9rKmQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.smart_ptr@1.83.0.bcr.1": { + "name": "boost.smart_ptr", + "version": "1.83.0.bcr.1", + "key": "boost.smart_ptr@1.83.0.bcr.1", + "repoName": "boost.smart_ptr", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/smart_ptr/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-E5t/4giJOpB5BqFXZrY0nX3e2N5qRVEo8k3xX57zrBc=", + "strip_prefix": "smart_ptr-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.smart_ptr/1.83.0.bcr.1/patches/patch.diff": "sha256-/QB/9prVNOfVCQZRz3t0jfMg1Rwk8YglWIglPZgAwhU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.sort@1.83.0.bcr.1": { + "name": "boost.sort", + "version": "1.83.0.bcr.1", + "key": "boost.sort@1.83.0.bcr.1", + "repoName": "boost.sort", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/sort/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-8TGxMuHFerMfYe1BvZeEN6fRQuxwYfwrBX3gVnBwMvA=", + "strip_prefix": "sort-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.sort/1.83.0.bcr.1/patches/patch.diff": "sha256-6rzGtmKXYaeBKnSXnziBF+kr/PRyra7+8G8xxDkq/oU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.spirit@1.83.0.bcr.1": { + "name": "boost.spirit", + "version": "1.83.0.bcr.1", + "key": "boost.spirit@1.83.0.bcr.1", + "repoName": "boost.spirit", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/spirit/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-nOswpDKJwnT7kwFGQwFN9bLTYnIlfZv1/Jp/cog24VA=", + "strip_prefix": "spirit-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.spirit/1.83.0.bcr.1/patches/patch.diff": "sha256-hSbfInHL6RNUR6bmex2WsdKhJTES4R1/4uUyyhkI5yw=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.stacktrace@1.83.0.bcr.1": { + "name": "boost.stacktrace", + "version": "1.83.0.bcr.1", + "key": "boost.stacktrace@1.83.0.bcr.1", + "repoName": "boost.stacktrace", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/stacktrace/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-WCwGoYuquz3wv6bCHkXhD4BjOPJ75CYNtn8Rr1IPPeU=", + "strip_prefix": "stacktrace-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.stacktrace/1.83.0.bcr.1/patches/patch.diff": "sha256-+hGcovDwVNo8R9LyZBo7p+7YJyBGdYojueeSjVnrjDk=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.statechart@1.83.0.bcr.1": { + "name": "boost.statechart", + "version": "1.83.0.bcr.1", + "key": "boost.statechart@1.83.0.bcr.1", + "repoName": "boost.statechart", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/statechart/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-bPI8NjxbXXaHzvGEFJHNnBN138XmoOWAtR0FX+1LnRU=", + "strip_prefix": "statechart-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.statechart/1.83.0.bcr.1/patches/patch.diff": "sha256-ggslUYMwNQs3aw91hQzUH/XXltM4ZbELzSrKTepCtaM=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.static_assert@1.83.0.bcr.1": { + "name": "boost.static_assert", + "version": "1.83.0.bcr.1", + "key": "boost.static_assert@1.83.0.bcr.1", + "repoName": "boost.static_assert", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/static_assert/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-7Zi41407qa/Fqkdyk1NL4W+oWwza4EFMSMK3xHXDhtM=", + "strip_prefix": "static_assert-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.static_assert/1.83.0.bcr.1/patches/patch.diff": "sha256-uhukunyZZe45DDLvqhD2RhPVHur7ZqCKKVQc4KXzG6k=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.static_string@1.83.0.bcr.1": { + "name": "boost.static_string", + "version": "1.83.0.bcr.1", + "key": "boost.static_string@1.83.0.bcr.1", + "repoName": "boost.static_string", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/static_string/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-+wdUaIOWTQq4Bc8wv6fqoWmUnEoeJt9ndEf7YaD63II=", + "strip_prefix": "static_string-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.static_string/1.83.0.bcr.1/patches/patch.diff": "sha256-8ZelDrzKttczjD2h8xrTFvZox9FNsEgI4lHSQwHYP4I=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.stl_interfaces@1.83.0.bcr.1": { + "name": "boost.stl_interfaces", + "version": "1.83.0.bcr.1", + "key": "boost.stl_interfaces@1.83.0.bcr.1", + "repoName": "boost.stl_interfaces", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/stl_interfaces/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-PAnu6HlJY8FqiaGCOAaOFKW5CtYxY/L2ObUpJKqqPPw=", + "strip_prefix": "stl_interfaces-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.stl_interfaces/1.83.0.bcr.1/patches/patch.diff": "sha256-+i3qau2hFXp1mjlKX22oLW1pqnuPvyrsKh1fn9Op8dM=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.system@1.83.0.bcr.1": { + "name": "boost.system", + "version": "1.83.0.bcr.1", + "key": "boost.system@1.83.0.bcr.1", + "repoName": "boost.system", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/system/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-t0k31L8jYoUkdNU7WtIx52BJEg/ILcL2RNPxAwuQdH4=", + "strip_prefix": "system-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.system/1.83.0.bcr.1/patches/patch.diff": "sha256-4n2T6jAYogjVQnOCl+vaIk42Z0cDQyG6BXbDZVX6FkU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.test@1.83.0.bcr.1": { + "name": "boost.test", + "version": "1.83.0.bcr.1", + "key": "boost.test@1.83.0.bcr.1", + "repoName": "boost.test", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/test/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-q3+iX705rJf8r7dp3OreQM+yYXNJiagBLFu6HD5Ljlw=", + "strip_prefix": "test-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.test/1.83.0.bcr.1/patches/patch.diff": "sha256-aiSbi4CFkHozI23y+ebKy4lmKy/b05ioxwKZB8w5b3g=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.thread@1.83.0.bcr.1": { + "name": "boost.thread", + "version": "1.83.0.bcr.1", + "key": "boost.thread@1.83.0.bcr.1", + "repoName": "boost.thread", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/thread/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-zIFNyvMDzgajwBoU+gvJoAGXbEPKHOoeATxxNeoxB5s=", + "strip_prefix": "thread-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.thread/1.83.0.bcr.1/patches/patch.diff": "sha256-Drqm1/zkbB2Olt2wLkKZKspnxE5LIjNs+20QHtr7+7E=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.throw_exception@1.83.0.bcr.1": { + "name": "boost.throw_exception", + "version": "1.83.0.bcr.1", + "key": "boost.throw_exception@1.83.0.bcr.1", + "repoName": "boost.throw_exception", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/throw_exception/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-VG/INzzr/W/aKroeUVJricbw/26lVtFTVGXCvMrsP1M=", + "strip_prefix": "throw_exception-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.throw_exception/1.83.0.bcr.1/patches/patch.diff": "sha256-Hnw1neNYWKC5G33DReZ7E0uBfBHuIrDm8IQ7kMfXdfI=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.timer@1.83.0.bcr.1": { + "name": "boost.timer", + "version": "1.83.0.bcr.1", + "key": "boost.timer@1.83.0.bcr.1", + "repoName": "boost.timer", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/timer/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-CGzESZRhRsrUlZCiwYSbcpJehk2qMWt7dHvEvgeFht8=", + "strip_prefix": "timer-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.timer/1.83.0.bcr.1/patches/patch.diff": "sha256-iXZSHIG4iUycU9kqJ7FrDRqdGvWq+Aal4AxaXVq0Jsk=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.tokenizer@1.83.0.bcr.1": { + "name": "boost.tokenizer", + "version": "1.83.0.bcr.1", + "key": "boost.tokenizer@1.83.0.bcr.1", + "repoName": "boost.tokenizer", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/tokenizer/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-P9YNzNje3qo8qU6X8C2zv/Sxtx0I8ls6oCZNFf7p7TM=", + "strip_prefix": "tokenizer-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.tokenizer/1.83.0.bcr.1/patches/patch.diff": "sha256-1yCiqX90sWuG7xSHPuGBpZhMhnPFDx64FT0I07UlZQs=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.tti@1.83.0.bcr.1": { + "name": "boost.tti", + "version": "1.83.0.bcr.1", + "key": "boost.tti@1.83.0.bcr.1", + "repoName": "boost.tti", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/tti/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-W8phytYVKvyHv7W0dDGRQ+tB3ZopPf+P8DKtLUh3gr4=", + "strip_prefix": "tti-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.tti/1.83.0.bcr.1/patches/patch.diff": "sha256-tbMOV2q+Ls2aQd5QWUvQd3Zh9Qg86j/o+96UsZRJtcU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.tuple@1.83.0.bcr.1": { + "name": "boost.tuple", + "version": "1.83.0.bcr.1", + "key": "boost.tuple@1.83.0.bcr.1", + "repoName": "boost.tuple", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/tuple/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-TGjPfu0CwK/0u2C/aVwyNJbsNd5NS8xIXEu39eKYmXw=", + "strip_prefix": "tuple-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.tuple/1.83.0.bcr.1/patches/patch.diff": "sha256-BuuKUbdyhrOZ+SXH6Fp5qoUooddMv7xwIJEAY7Bw6Bk=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.type_erasure@1.83.0.bcr.1": { + "name": "boost.type_erasure", + "version": "1.83.0.bcr.1", + "key": "boost.type_erasure@1.83.0.bcr.1", + "repoName": "boost.type_erasure", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/type_erasure/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-klsj6rj/M5+tzA77NpoRv4iLSdVrcpOnsXgULnzIDyA=", + "strip_prefix": "type_erasure-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.type_erasure/1.83.0.bcr.1/patches/patch.diff": "sha256-LJfkZg0f1NoBFJtmfgWKPZlAXYhB8LzUSHRIPmVvE1s=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.type_index@1.83.0.bcr.1": { + "name": "boost.type_index", + "version": "1.83.0.bcr.1", + "key": "boost.type_index@1.83.0.bcr.1", + "repoName": "boost.type_index", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/type_index/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-68hhd3L2LF9As395hGKLtklZASWdqY+mokrw9hddQsw=", + "strip_prefix": "type_index-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.type_index/1.83.0.bcr.1/patches/patch.diff": "sha256-9tJlG/n5wdIy5jKxU9gG5zNynmvv+6ALygEyQU3R+o4=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.type_traits@1.83.0.bcr.1": { + "name": "boost.type_traits", + "version": "1.83.0.bcr.1", + "key": "boost.type_traits@1.83.0.bcr.1", + "repoName": "boost.type_traits", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/type_traits/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-w7gOSDuQ8vng6bT98x7bfU1SIa7TrkxKehoU7gJXaSA=", + "strip_prefix": "type_traits-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.type_traits/1.83.0.bcr.1/patches/patch.diff": "sha256-u4CY0NGWxRJ9yLRnNNi6gq1urvVo0MBijAZibtBPFFw=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.typeof@1.83.0.bcr.1": { + "name": "boost.typeof", + "version": "1.83.0.bcr.1", + "key": "boost.typeof@1.83.0.bcr.1", + "repoName": "boost.typeof", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/typeof/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-jIfc34VUdh7LjsUFGpGLTD2K9lkrOQftMBQ6J34kuw0=", + "strip_prefix": "typeof-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.typeof/1.83.0.bcr.1/patches/patch.diff": "sha256-l041fiWRFb4nzDJoj5J93oyeJ3X10vFEVLH2A5APR2A=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.units@1.83.0.bcr.1": { + "name": "boost.units", + "version": "1.83.0.bcr.1", + "key": "boost.units@1.83.0.bcr.1", + "repoName": "boost.units", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/units/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-govV7ZYdjARezF6Zer4Bf45HkCS0JJR/oTaOi//R/2w=", + "strip_prefix": "units-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.units/1.83.0.bcr.1/patches/patch.diff": "sha256-kJ4xdUHqg4cNVtM7XPz3p+tyuzxs8gHmF9aDoCZOkR8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.unordered@1.83.0.bcr.1": { + "name": "boost.unordered", + "version": "1.83.0.bcr.1", + "key": "boost.unordered@1.83.0.bcr.1", + "repoName": "boost.unordered", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/unordered/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-XuQDLyUsTD5cxZpZOBUCVTFupnVRop1IseSmWw8WJUk=", + "strip_prefix": "unordered-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.unordered/1.83.0.bcr.1/patches/patch.diff": "sha256-l0zpNxF5jpCBBToiZ4qOkuZP5rA0vTQ5rBjNZ4JGsYc=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.url@1.83.0.bcr.1": { + "name": "boost.url", + "version": "1.83.0.bcr.1", + "key": "boost.url@1.83.0.bcr.1", + "repoName": "boost.url", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/url/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-Lidl7umKI3R5veigmZtR3iOD+vrV1Ijq7eqTonqKu98=", + "strip_prefix": "url-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.url/1.83.0.bcr.1/patches/patch.diff": "sha256-vvRvqmMmbip6YXCjwM5+5neCJEvXTP9UnYX+fyNvStA=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.utility@1.83.0.bcr.1": { + "name": "boost.utility", + "version": "1.83.0.bcr.1", + "key": "boost.utility@1.83.0.bcr.1", + "repoName": "boost.utility", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/utility/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-bhEtQjLibNdxc/y9TwCjHbz55HayK7ScepBghxrjdsM=", + "strip_prefix": "utility-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.utility/1.83.0.bcr.1/patches/patch.diff": "sha256-2zv7ZG9zrl72bJiSLVyAHg28EF7vzEZgs5xyDYMuuaE=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.variant@1.83.0.bcr.1": { + "name": "boost.variant", + "version": "1.83.0.bcr.1", + "key": "boost.variant@1.83.0.bcr.1", + "repoName": "boost.variant", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/variant/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-2TSEiVGnUzS/5z+Ig9tNx+Xscfei/Wu2B+5OkBrya7w=", + "strip_prefix": "variant-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.variant/1.83.0.bcr.1/patches/patch.diff": "sha256-5tkgWrsftEdwHRvqusJgcZnF6jYB8nmtz5SOgSygSRo=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.variant2@1.83.0.bcr.1": { + "name": "boost.variant2", + "version": "1.83.0.bcr.1", + "key": "boost.variant2@1.83.0.bcr.1", + "repoName": "boost.variant2", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/variant2/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-80QXswAcgFA4wQJQMg+9k8nKs6jtmcu2ZxWD3tpwXn8=", + "strip_prefix": "variant2-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.variant2/1.83.0.bcr.1/patches/patch.diff": "sha256-/zXhp21tKxet6kItQdtLe9nDXIt7e21YvG4pn8ngBoU=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.vmd@1.83.0.bcr.1": { + "name": "boost.vmd", + "version": "1.83.0.bcr.1", + "key": "boost.vmd@1.83.0.bcr.1", + "repoName": "boost.vmd", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/vmd/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-YJYMZDeuINSAl0GjG1ZzXGDwox8w+YGsjZYYwlE/EpA=", + "strip_prefix": "vmd-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.vmd/1.83.0.bcr.1/patches/patch.diff": "sha256-z5+7bLTuo0J1Zrd+acT7F751qDGDKlFAKIxKj7uM514=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.wave@1.83.0.bcr.1": { + "name": "boost.wave", + "version": "1.83.0.bcr.1", + "key": "boost.wave@1.83.0.bcr.1", + "repoName": "boost.wave", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/wave/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-ZdTtbYyePwkyax1QdNDLWrHAvHMmAonzEDgtqKzIqSg=", + "strip_prefix": "wave-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.wave/1.83.0.bcr.1/patches/patch.diff": "sha256-gPXedzAXLK+SZkLsfP+gWONQCRGHc8oEZLoic3qS4x8=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.winapi@1.83.0.bcr.1": { + "name": "boost.winapi", + "version": "1.83.0.bcr.1", + "key": "boost.winapi@1.83.0.bcr.1", + "repoName": "boost.winapi", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/winapi/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-ZI//e/w2tWsU6R8qfLaMNd6+ETxcE5JidZSoJPe6jGU=", + "strip_prefix": "winapi-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.winapi/1.83.0.bcr.1/patches/patch.diff": "sha256-f01uOngbWVYOAgzkC0PokDLRnGameFIPNSBoMz9U4RQ=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.xpressive@1.83.0.bcr.1": { + "name": "boost.xpressive", + "version": "1.83.0.bcr.1", + "key": "boost.xpressive@1.83.0.bcr.1", + "repoName": "boost.xpressive", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/xpressive/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-7tbpIAyTGZYIyBthIEnUl8VYj8boJlAB2KKnyDup9zU=", + "strip_prefix": "xpressive-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.xpressive/1.83.0.bcr.1/patches/patch.diff": "sha256-+7lBiVQcdn+vdkD1zPJar8CaD9Ukua3V5qaGArug2ZM=" + }, + "remote_patch_strip": 1 + } + } + }, + "boost.yap@1.83.0.bcr.1": { + "name": "boost.yap", + "version": "1.83.0.bcr.1", + "key": "boost.yap@1.83.0.bcr.1", + "repoName": "boost.yap", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "boost": "boost@1.83.0.bcr.1", + "boost.rules.tools": "boost.rules.tools@1.0.0", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/boostorg/yap/archive/refs/tags/boost-1.83.0.tar.gz" + ], + "integrity": "sha256-uRdIfHmDVDDFhhxvvsHJ2ukOZUEdpKiSZ4M5jX5gABE=", + "strip_prefix": "yap-boost-1.83.0", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/boost.yap/1.83.0.bcr.1/patches/patch.diff": "sha256-sIe5HLx411TSo3Lxmkv4A7rdh1KiJclu0DrVVn/KNUw=" + }, + "remote_patch_strip": 1 + } + } + }, + "upb@0.0.0-20220923-a547704": { + "name": "upb", + "version": "0.0.0-20220923-a547704", + "key": "upb@0.0.0-20220923-a547704", + "repoName": "upb", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "rules_proto": "rules_proto@5.3.0-21.7", + "com_google_protobuf": "protobuf@21.7", + "com_google_absl": "abseil-cpp@_", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/protocolbuffers/upb/archive/a5477045acaa34586420942098f5fecd3570f577.tar.gz" + ], + "integrity": "sha256-z39x6v+QskwaKLSWRan/A6mmwecTQpHOcJActj5zZLU=", + "strip_prefix": "upb-a5477045acaa34586420942098f5fecd3570f577", + "remote_patches": { + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/patches/module_dot_bazel.patch": "sha256-wH4mNS6ZYy+8uC0HoAft/c7SDsq2Kxf+J8dUakXhaB0=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_jvm_external@4.4.2": { + "name": "rules_jvm_external", + "version": "4.4.2", + "key": "rules_jvm_external@4.4.2", + "repoName": "rules_jvm_external", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_jvm_external//:non-module-deps.bzl", + "extensionName": "non_module_deps", + "usingModule": "rules_jvm_external@4.4.2", + "location": { + "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", + "line": 9, + "column": 32 + }, + "imports": { + "io_bazel_rules_kotlin": "io_bazel_rules_kotlin" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_jvm_external//:extensions.bzl", + "extensionName": "maven", + "usingModule": "rules_jvm_external@4.4.2", + "location": { + "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", + "line": 16, + "column": 22 + }, + "imports": { + "rules_jvm_external_deps": "rules_jvm_external_deps" + }, + "devImports": [], + "tags": [ + { + "tagName": "install", + "attributeValues": { + "name": "rules_jvm_external_deps", + "artifacts": [ + "com.google.cloud:google-cloud-core:1.93.10", + "com.google.cloud:google-cloud-storage:1.113.4", + "com.google.code.gson:gson:2.9.0", + "org.apache.maven:maven-artifact:3.8.6", + "software.amazon.awssdk:s3:2.17.183" + ], + "lock_file": "@rules_jvm_external//:rules_jvm_external_deps_install.json" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", + "line": 18, + "column": 14 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "io_bazel_stardoc": "stardoc@0.5.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_jvm_external/archive/refs/tags/4.4.2.zip" + ], + "integrity": "sha256-c1YC9QgT6y6pPKP15DsZWb2AshO4NqB6YqKddXZwt3s=", + "strip_prefix": "rules_jvm_external-4.4.2", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "pybind11_bazel@2.11.1": { + "name": "pybind11_bazel", + "version": "2.11.1", + "key": "pybind11_bazel@2.11.1", + "repoName": "pybind11_bazel", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/pybind/pybind11_bazel/releases/download/v2.11.1/pybind11_bazel-2.11.1.zip" + ], + "integrity": "sha256-LEZsmzzKeFK0fgeFADEomE/PDV1hoaLkxazu/ZNawiA=", + "strip_prefix": "pybind11_bazel-2.11.1", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "bzip2@1.0.8": { + "name": "bzip2", + "version": "1.0.8", + "key": "bzip2@1.0.8", + "repoName": "bzip2", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" + ], + "integrity": "sha256-q1oDF27hBtPw+pDjgdpHjdrkBZGBU8yiSOaCzQxKImk=", + "strip_prefix": "bzip2-1.0.8", + "remote_patches": { + "https://bcr.bazel.build/modules/bzip2/1.0.8/patches/add_build_file.patch": "sha256-xJNk2k+qB6WjPQYB00KeIXmH/9k3asL6en5schN9hMI=", + "https://bcr.bazel.build/modules/bzip2/1.0.8/patches/module_dot_bazel.patch": "sha256-0L0dzTSwiKpuEZAqbpUf+x+WOXt0qyCX8lBR+bRZ7so=" + }, + "remote_patch_strip": 0 + } + } + }, + "zstd@1.5.5.bcr.2": { + "name": "zstd", + "version": "1.5.5.bcr.2", + "key": "zstd@1.5.5.bcr.2", + "repoName": "zstd", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "platforms": "platforms@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz" + ], + "integrity": "sha256-nEOWzIKc+uMZpuJhUgLoKq1BNyBzSC/OKG+seGRtPuQ=", + "strip_prefix": "zstd-1.5.5", + "remote_patches": { + "https://raw.githubusercontent.com/Vertexwahn/bazel-registry/main/modules/zstd/1.5.5.bcr.2/patches/add_bazel_files.patch": "sha256-RQOCmd8VQVo4fBHIh+vGPIb0HQVJSwCrO/4g6j4tVI0=" + }, + "remote_patch_strip": 1 + } + } + }, + "xz@5.4.5": { + "name": "xz", + "version": "5.4.5", + "key": "xz@5.4.5", + "repoName": "xz", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.9", + "bazel_skylib": "bazel_skylib@_", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/tukaani-project/xz/releases/download/v5.4.5/xz-5.4.5.tar.gz" + ], + "integrity": "sha256-E1yQuTSu6PvA1Gfeh6Bctw1ifaNqvlGMNXqHNwnlt9Y=", + "strip_prefix": "xz-5.4.5", + "remote_patches": { + "https://bcr.bazel.build/modules/xz/5.4.5/patches/patch.diff": "sha256-jNwmcPc8HWCbtFHDrJixLBsKruD4ji3hEf6Xsc4jIGo=" + }, + "remote_patch_strip": 1 + } + } + }, + "stardoc@0.5.1": { + "name": "stardoc", + "version": "0.5.1", + "key": "stardoc@0.5.1", + "repoName": "stardoc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@_", + "rules_java": "rules_java@7.4.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/stardoc/releases/download/0.5.1/stardoc-0.5.1.tar.gz" + ], + "integrity": "sha256-qoFNrgrEALurLoiB+ZFcb0fElmS/CHxAmhX5BDjSwj4=", + "strip_prefix": "", + "remote_patches": { + "https://bcr.bazel.build/modules/stardoc/0.5.1/patches/module_dot_bazel.patch": "sha256-UAULCuTpJE7SG0YrR9XLjMfxMRmbP+za3uW9ONZ5rjI=" + }, + "remote_patch_strip": 0 + } + } + } + }, + "moduleExtensions": { + "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "RyR+EbN4fAzxxZSQKwXXrxEtMVrezn79MOR/2mmcmYk=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_apple_cc": { + "bzlFile": "@@apple_support~//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf", + "attributes": {} + }, + "local_config_apple_cc_toolchains": { + "bzlFile": "@@apple_support~//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf_toolchains", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [ + [ + "apple_support~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@bazel_features~//private:extensions.bzl%version_extension": { + "general": { + "bzlTransitiveDigest": "xm7Skm1Las5saxzFWt2hbS+e68BWi+MXyt6+lKIhjPA=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "bazel_features_version": { + "bzlFile": "@@bazel_features~//private:version_repo.bzl", + "ruleClassName": "version_repo", + "attributes": {} + }, + "bazel_features_globals": { + "bzlFile": "@@bazel_features~//private:globals_repo.bzl", + "ruleClassName": "globals_repo", + "attributes": { + "globals": { + "RunEnvironmentInfo": "5.3.0", + "DefaultInfo": "0.0.1", + "__TestingOnly_NeverAvailable": "1000000000.0.0" + } + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@bazel_tools//tools/cpp:cc_configure.bzl%cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "PHpT2yqMGms2U4L3E/aZ+WcQalmZWm+ILdP3yiLsDhA=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_cc": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf", + "attributes": {} + }, + "local_config_cc_toolchains": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf_toolchains", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_tools", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@bazel_tools//tools/osx:xcode_configure.bzl%xcode_configure_extension": { + "general": { + "bzlTransitiveDigest": "Qh2bWTU6QW6wkrd87qrU4YeY+SG37Nvw3A0PR4Y0L2Y=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_xcode": { + "bzlFile": "@@bazel_tools//tools/osx:xcode_configure.bzl", + "ruleClassName": "xcode_autoconf", + "attributes": { + "xcode_locator": "@bazel_tools//tools/osx:xcode_locator.m", + "remote_xcode": "" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@bazel_tools//tools/sh:sh_configure.bzl%sh_configure_extension": { + "general": { + "bzlTransitiveDigest": "hp4NgmNjEg5+xgvzfh6L83bt9/aiiWETuNpwNuF1MSU=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_sh": { + "bzlFile": "@@bazel_tools//tools/sh:sh_configure.bzl", + "ruleClassName": "sh_config", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_foreign_cc~//foreign_cc:extensions.bzl%tools": { + "general": { + "bzlTransitiveDigest": "UEPdhQf5CZ34jRiR5yDtMgI+Xr7dttO7reC5MGURXpk=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "cmake-3.23.2-linux-aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-linux-aarch64.tar.gz" + ], + "sha256": "f2654bf780b53f170bbbec44d8ac67d401d24788e590faa53036a89476efa91e", + "strip_prefix": "cmake-3.23.2-linux-aarch64", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake\",\n target = \":cmake_data\",\n)\n" + } + }, + "rules_foreign_cc_framework_toolchain_macos": { + "bzlFile": "@@rules_foreign_cc~//foreign_cc/private/framework:toolchain.bzl", + "ruleClassName": "framework_toolchain_repository", + "attributes": { + "commands_src": "@rules_foreign_cc//foreign_cc/private/framework/toolchains:macos_commands.bzl", + "exec_compatible_with": [ + "@platforms//os:macos" + ] + } + }, + "gnumake_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "581f4d4e872da74b3941c874215898a7d35802f03732bdccee1d4a7979105d18", + "strip_prefix": "make-4.4", + "urls": [ + "https://mirror.bazel.build/ftpmirror.gnu.org/gnu/make/make-4.4.tar.gz", + "http://ftpmirror.gnu.org/gnu/make/make-4.4.tar.gz" + ] + } + }, + "gettext_runtime": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\ncc_import(\n name = \"gettext_runtime\",\n shared_library = \"bin/libintl-8.dll\",\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "1f4269c0e021076d60a54e98da6f978a3195013f6de21674ba0edbc339c5b079", + "urls": [ + "https://download.gnome.org/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip" + ] + } + }, + "cmake_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "f316b40053466f9a416adf981efda41b160ca859e97f6a484b447ea299ff26aa", + "strip_prefix": "cmake-3.23.2", + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2.tar.gz" + ] + } + }, + "bazel_skylib": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz" + ], + "sha256": "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728" + } + }, + "cmake-3.23.2-macos-universal": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-macos-universal.tar.gz" + ], + "sha256": "853a0f9af148c5ef47282ffffee06c4c9f257be2635936755f39ca13c3286c88", + "strip_prefix": "cmake-3.23.2-macos-universal/CMake.app/Contents", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake\",\n target = \":cmake_data\",\n)\n" + } + }, + "meson_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "exports_files([\"meson.py\"])\n\nfilegroup(\n name = \"runtime\",\n srcs = glob([\"mesonbuild/**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "strip_prefix": "meson-1.1.1", + "url": "https://github.com/mesonbuild/meson/releases/download/1.1.1/meson-1.1.1.tar.gz" + } + }, + "rules_foreign_cc_framework_toolchain_freebsd": { + "bzlFile": "@@rules_foreign_cc~//foreign_cc/private/framework:toolchain.bzl", + "ruleClassName": "framework_toolchain_repository", + "attributes": { + "commands_src": "@rules_foreign_cc//foreign_cc/private/framework/toolchains:freebsd_commands.bzl", + "exec_compatible_with": [ + "@platforms//os:freebsd" + ] + } + }, + "rules_foreign_cc_framework_toolchain_linux": { + "bzlFile": "@@rules_foreign_cc~//foreign_cc/private/framework:toolchain.bzl", + "ruleClassName": "framework_toolchain_repository", + "attributes": { + "commands_src": "@rules_foreign_cc//foreign_cc/private/framework/toolchains:linux_commands.bzl", + "exec_compatible_with": [ + "@platforms//os:linux" + ] + } + }, + "rules_python": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "84aec9e21cc56fbc7f1335035a71c850d1b9b5cc6ff497306f84cced9a769841", + "strip_prefix": "rules_python-0.23.1", + "url": "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.23.1.tar.gz" + } + }, + "pkgconfig_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591", + "strip_prefix": "pkg-config-0.29.2", + "patches": [ + "@@rules_foreign_cc~//toolchains:pkgconfig-detectenv.patch", + "@@rules_foreign_cc~//toolchains:pkgconfig-makefile-vc.patch" + ], + "urls": [ + "https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz" + ] + } + }, + "ninja_build_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "31747ae633213f1eda3842686f83c2aa1412e0f5691d1c14dbbcc67fe7400cea", + "strip_prefix": "ninja-1.11.1", + "urls": [ + "https://github.com/ninja-build/ninja/archive/v1.11.1.tar.gz" + ] + } + }, + "ninja_1.11.1_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip" + ], + "sha256": "b901ba96e486dce377f9a070ed4ef3f79deb45f4ffe2938f8e7ddc69cfb3df77", + "strip_prefix": "", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"ninja_bin\",\n srcs = [\"ninja\"],\n)\n\nnative_tool_toolchain(\n name = \"ninja_tool\",\n env = {\"NINJA\": \"$(execpath :ninja_bin)\"},\n path = \"$(execpath :ninja_bin)\",\n target = \":ninja_bin\",\n)\n" + } + }, + "glib_src": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\ncc_import(\n name = \"msvc_hdr\",\n hdrs = [\"msvc_recommended_pragmas.h\"],\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "bc96f63112823b7d6c9f06572d2ad626ddac7eb452c04d762592197f6e07898e", + "strip_prefix": "glib-2.26.1", + "urls": [ + "https://download.gnome.org/sources/glib/2.26/glib-2.26.1.tar.gz" + ] + } + }, + "cmake-3.23.2-windows-x86_64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-windows-x86_64.zip" + ], + "sha256": "2329387f3166b84c25091c86389fb891193967740c9bcf01e7f6d3306f7ffda0", + "strip_prefix": "cmake-3.23.2-windows-x86_64", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake.exe\",\n target = \":cmake_data\",\n)\n" + } + }, + "glib_runtime": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\nexports_files(\n [\n \"bin/libgio-2.0-0.dll\",\n \"bin/libglib-2.0-0.dll\",\n \"bin/libgmodule-2.0-0.dll\",\n \"bin/libgobject-2.0-0.dll\",\n \"bin/libgthread-2.0-0.dll\",\n ],\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "88d857087e86f16a9be651ee7021880b3f7ba050d34a1ed9f06113b8799cb973", + "urls": [ + "https://download.gnome.org/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip" + ] + } + }, + "rules_foreign_cc_framework_toolchains": { + "bzlFile": "@@rules_foreign_cc~//foreign_cc/private/framework:toolchain.bzl", + "ruleClassName": "framework_toolchain_repository_hub", + "attributes": {} + }, + "glib_dev": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\nload(\"@rules_cc//cc:defs.bzl\", \"cc_library\")\n\ncc_import(\n name = \"glib_dev\",\n hdrs = glob([\"include/**\"]),\n shared_library = \"@glib_runtime//:bin/libglib-2.0-0.dll\",\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "bdf18506df304d38be98a4b3f18055b8b8cca81beabecad0eece6ce95319c369", + "urls": [ + "https://download.gnome.org/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip" + ] + } + }, + "ninja_1.11.1_mac": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-mac.zip" + ], + "sha256": "482ecb23c59ae3d4f158029112de172dd96bb0e97549c4b1ca32d8fad11f873e", + "strip_prefix": "", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"ninja_bin\",\n srcs = [\"ninja\"],\n)\n\nnative_tool_toolchain(\n name = \"ninja_tool\",\n env = {\"NINJA\": \"$(execpath :ninja_bin)\"},\n path = \"$(execpath :ninja_bin)\",\n target = \":ninja_bin\",\n)\n" + } + }, + "cmake_3.23.2_toolchains": { + "bzlFile": "@@rules_foreign_cc~//toolchains:prebuilt_toolchains_repository.bzl", + "ruleClassName": "prebuilt_toolchains_repository", + "attributes": { + "repos": { + "cmake-3.23.2-linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux" + ], + "cmake-3.23.2-linux-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux" + ], + "cmake-3.23.2-macos-universal": [ + "@platforms//os:macos" + ], + "cmake-3.23.2-windows-i386": [ + "@platforms//cpu:x86_32", + "@platforms//os:windows" + ], + "cmake-3.23.2-windows-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows" + ] + }, + "tool": "cmake" + } + }, + "ninja_1.11.1_toolchains": { + "bzlFile": "@@rules_foreign_cc~//toolchains:prebuilt_toolchains_repository.bzl", + "ruleClassName": "prebuilt_toolchains_repository", + "attributes": { + "repos": { + "ninja_1.11.1_linux": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux" + ], + "ninja_1.11.1_mac": [ + "@platforms//cpu:x86_64", + "@platforms//os:macos" + ], + "ninja_1.11.1_win": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows" + ] + }, + "tool": "ninja" + } + }, + "ninja_1.11.1_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip" + ], + "sha256": "524b344a1a9a55005eaf868d991e090ab8ce07fa109f1820d40e74642e289abc", + "strip_prefix": "", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"ninja_bin\",\n srcs = [\"ninja.exe\"],\n)\n\nnative_tool_toolchain(\n name = \"ninja_tool\",\n env = {\"NINJA\": \"$(execpath :ninja_bin)\"},\n path = \"$(execpath :ninja_bin)\",\n target = \":ninja_bin\",\n)\n" + } + }, + "cmake-3.23.2-windows-i386": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-windows-i386.zip" + ], + "sha256": "6a4fcd6a2315b93cb23c93507efccacc30c449c2bf98f14d6032bb226c582e07", + "strip_prefix": "cmake-3.23.2-windows-i386", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake.exe\",\n target = \":cmake_data\",\n)\n" + } + }, + "cmake-3.23.2-linux-x86_64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-linux-x86_64.tar.gz" + ], + "sha256": "aaced6f745b86ce853661a595bdac6c5314a60f8181b6912a0a4920acfa32708", + "strip_prefix": "cmake-3.23.2-linux-x86_64", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake\",\n target = \":cmake_data\",\n)\n" + } + }, + "rules_foreign_cc_framework_toolchain_windows": { + "bzlFile": "@@rules_foreign_cc~//foreign_cc/private/framework:toolchain.bzl", + "ruleClassName": "framework_toolchain_repository", + "attributes": { + "commands_src": "@rules_foreign_cc//foreign_cc/private/framework/toolchains:windows_commands.bzl", + "exec_compatible_with": [ + "@platforms//os:windows" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_foreign_cc~", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_foreign_cc~", + "rules_foreign_cc", + "rules_foreign_cc~" + ] + ] + } + }, + "@@rules_go~//go:extensions.bzl%go_sdk": { + "os:linux,arch:amd64": { + "bzlTransitiveDigest": "ar1YLbhR11M5TCnDCO7Xk7Z25BLUy+Db1ZBjRa5Gwmw=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "io_bazel_rules_nogo": { + "bzlFile": "@@rules_go~//go/private:nogo.bzl", + "ruleClassName": "go_register_nogo", + "attributes": { + "nogo": "@io_bazel_rules_go//:default_nogo", + "includes": [ + "'@@//:__subpackages__'" + ], + "excludes": [] + } + }, + "rules_go__download_0_windows_arm64": { + "bzlFile": "@@rules_go~//go/private:sdk.bzl", + "ruleClassName": "go_download_sdk_rule", + "attributes": { + "goos": "", + "goarch": "", + "sdks": {}, + "urls": [ + "https://dl.google.com/go/{}" + ], + "version": "1.21.1" + } + }, + "rules_go__download_0_linux_arm64": { + "bzlFile": "@@rules_go~//go/private:sdk.bzl", + "ruleClassName": "go_download_sdk_rule", + "attributes": { + "goos": "", + "goarch": "", + "sdks": {}, + "urls": [ + "https://dl.google.com/go/{}" + ], + "version": "1.21.1" + } + }, + "go_default_sdk": { + "bzlFile": "@@rules_go~//go/private:sdk.bzl", + "ruleClassName": "go_download_sdk_rule", + "attributes": { + "goos": "", + "goarch": "", + "sdks": {}, + "experiments": [], + "patches": [], + "patch_strip": 0, + "urls": [ + "https://dl.google.com/go/{}" + ], + "version": "1.21.1", + "strip_prefix": "go" + } + }, + "rules_go__download_0_darwin_arm64": { + "bzlFile": "@@rules_go~//go/private:sdk.bzl", + "ruleClassName": "go_download_sdk_rule", + "attributes": { + "goos": "", + "goarch": "", + "sdks": {}, + "urls": [ + "https://dl.google.com/go/{}" + ], + "version": "1.21.1" + } + }, + "go_host_compatible_sdk_label": { + "bzlFile": "@@rules_go~//go/private:extensions.bzl", + "ruleClassName": "host_compatible_toolchain", + "attributes": { + "toolchain": "@go_default_sdk//:ROOT" + } + }, + "rules_go__download_0_darwin_amd64": { + "bzlFile": "@@rules_go~//go/private:sdk.bzl", + "ruleClassName": "go_download_sdk_rule", + "attributes": { + "goos": "", + "goarch": "", + "sdks": {}, + "urls": [ + "https://dl.google.com/go/{}" + ], + "version": "1.21.1" + } + }, + "go_toolchains": { + "bzlFile": "@@rules_go~//go/private:sdk.bzl", + "ruleClassName": "go_multiple_toolchains", + "attributes": { + "prefixes": [ + "_0000_go_default_sdk_", + "_0001_rules_go__download_0_darwin_amd64_", + "_0002_rules_go__download_0_darwin_arm64_", + "_0003_rules_go__download_0_linux_arm64_", + "_0004_rules_go__download_0_windows_amd64_", + "_0005_rules_go__download_0_windows_arm64_" + ], + "geese": [ + "", + "darwin", + "darwin", + "linux", + "windows", + "windows" + ], + "goarchs": [ + "", + "amd64", + "arm64", + "arm64", + "amd64", + "arm64" + ], + "sdk_repos": [ + "go_default_sdk", + "rules_go__download_0_darwin_amd64", + "rules_go__download_0_darwin_arm64", + "rules_go__download_0_linux_arm64", + "rules_go__download_0_windows_amd64", + "rules_go__download_0_windows_arm64" + ], + "sdk_types": [ + "remote", + "remote", + "remote", + "remote", + "remote", + "remote" + ], + "sdk_versions": [ + "1.21.1", + "1.21.1", + "1.21.1", + "1.21.1", + "1.21.1", + "1.21.1" + ] + } + }, + "rules_go__download_0_windows_amd64": { + "bzlFile": "@@rules_go~//go/private:sdk.bzl", + "ruleClassName": "go_download_sdk_rule", + "attributes": { + "goos": "", + "goarch": "", + "sdks": {}, + "urls": [ + "https://dl.google.com/go/{}" + ], + "version": "1.21.1" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_features~", + "bazel_features_globals", + "bazel_features~~version_extension~bazel_features_globals" + ], + [ + "bazel_features~", + "bazel_features_version", + "bazel_features~~version_extension~bazel_features_version" + ], + [ + "rules_go~", + "bazel_features", + "bazel_features~" + ], + [ + "rules_go~", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_go~", + "io_bazel_rules_go", + "rules_go~" + ] + ] + } + }, + "@@rules_java~//java:extensions.bzl%toolchains": { + "general": { + "bzlTransitiveDigest": "tJHbmWnq7m+9eUBnUdv7jZziQ26FmcGL9C5/hU3Q9UQ=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "remotejdk21_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "e8260516de8b60661422a725f1df2c36ef888f6fb35393566b00e7325db3d04e", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "314b04568ec0ae9b36ba03c9cbd42adc9e1265f74678923b19297d66eb84dcca", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz" + ] + } + }, + "remote_java_tools_windows": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "fe2f88169696d6c6fc6e90ba61bb46be7d0ae3693cbafdf336041bf56679e8d1", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_windows-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_windows-v13.4.zip" + ] + } + }, + "remotejdk11_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "43408193ce2fa0862819495b5ae8541085b95660153f2adcf91a52d3a1710e83", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip" + ] + } + }, + "remotejdk11_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "54174439f2b3fddd11f1048c397fe7bb45d4c9d66d452d6889b013d04d21c4de", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "b9482f2304a1a68a614dfacddcf29569a72f0fac32e6c74f83dc1b9a157b8340", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\n" + } + }, + "remotejdk11_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "bcaab11cfe586fae7583c6d9d311c64384354fb2638eb9a012eca4c3f1a1d9fd", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz" + ] + } + }, + "remotejdk11_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "b8a28e6e767d90acf793ea6f5bed0bb595ba0ba5ebdf8b99f395266161e53ec2", + "strip_prefix": "jdk-11.0.13+8", + "urls": [ + "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-aarch64.zip" + ] + } + }, + "remotejdk17_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "640453e8afe8ffe0fb4dceb4535fb50db9c283c64665eebb0ba68b19e65f4b1f", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "3ad8fe288eb57d975c2786ae453a036aa46e47ab2ac3d81538ebae2a54d3c025", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "192f2afca57701de6ec496234f7e45d971bf623ff66b8ee4a5c81582054e5637", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip" + ] + } + }, + "remotejdk11_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk21_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "5ad730fbee6bb49bfff10bf39e84392e728d89103d3474a7e5def0fd134b300a", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz" + ] + } + }, + "remote_java_tools_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "ba10f09a138cf185d04cbc807d67a3da42ab13d618c5d1ce20d776e199c33a39", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_linux-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_linux-v13.4.zip" + ] + } + }, + "remotejdk21_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "f7cc15ca17295e69c907402dfe8db240db446e75d3b150da7bf67243cded93de", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip" + ] + } + }, + "remotejdk21_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "ce7df1af5d44a9f455617c4b8891443fbe3e4b269c777d8b82ed66f77167cfe0", + "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_aarch64", + "urls": [ + "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz", + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk11_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a58fc0361966af0a5d5a31a2d8a208e3c9bb0f54f345596fd80b99ea9a39788b", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk17_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6531cef61e416d5a7b691555c8cf2bdff689201b8a001ff45ab6740062b44313", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a34b404f87a08a61148b38e1416d837189e1df7a040d949e743633daf4695a3c", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk17_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6802c99eae0d788e21f52d03cab2e2b3bf42bc334ca03cbf19f71eb70ee19f85", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip" + ] + } + }, + "remote_java_tools_darwin_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "076a7e198ad077f8c7d997986ef5102427fae6bbfce7a7852d2e080ed8767528", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_arm64-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_arm64-v13.4.zip" + ] + } + }, + "remotejdk17_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "00a4c07603d0218cd678461b5b3b7e25b3253102da4022d31fc35907f21a2efd", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk21_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\n" + } + }, + "local_jdk": { + "bzlFile": "@@rules_java~//toolchains:local_java_repository.bzl", + "ruleClassName": "_local_java_repository_rule", + "attributes": { + "java_home": "", + "version": "", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = {RUNTIME_VERSION},\n)\n" + } + }, + "remote_java_tools_darwin_x86_64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "4523aec4d09c587091a2dae6f5c9bc6922c220f3b6030e5aba9c8f015913cc65", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_x86_64-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_x86_64-v13.4.zip" + ] + } + }, + "remote_java_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "e025fd260ac39b47c111f5212d64ec0d00d85dec16e49368aae82fc626a940cf", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools-v13.4.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools-v13.4.zip" + ] + } + }, + "remotejdk17_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "ffacba69c6843d7ca70d572489d6cc7ab7ae52c60f0852cedf4cf0d248b6fc37", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk17_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a8fba686f6eb8ae1d1a9566821dbd5a85a1108b96ad857fdbac5c1e4649fc56f", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk11_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "7632bc29f8a4b7d492b93f3bc75a7b61630894db85d136456035ab2a24d38885", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk21_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\n" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_java~", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_java~", + "remote_java_tools", + "rules_java~~toolchains~remote_java_tools" + ] + ] + } + }, + "@@rules_python~//python/extensions:python.bzl%python": { + "general": { + "bzlTransitiveDigest": "aGxTzdPZbohueOWJunHBtnR6sj5TpdulhPNQPtC0mG0=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "python_3_11_s390x-unknown-linux-gnu": { + "bzlFile": "@@rules_python~//python:repositories.bzl", + "ruleClassName": "python_repository", + "attributes": { + "sha256": "49520e3ff494708020f306e30b0964f079170be83e956be4504f850557378a22", + "patches": [], + "platform": "s390x-unknown-linux-gnu", + "python_version": "3.11.7", + "release_filename": "20240107/cpython-3.11.7+20240107-s390x-unknown-linux-gnu-install_only.tar.gz", + "urls": [ + "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7+20240107-s390x-unknown-linux-gnu-install_only.tar.gz" + ], + "distutils_content": "", + "strip_prefix": "python", + "coverage_tool": "", + "ignore_root_user_error": false + } + }, + "python_3_11_host": { + "bzlFile": "@@rules_python~//python/private:toolchains_repo.bzl", + "ruleClassName": "host_toolchain", + "attributes": { + "python_version": "3.11.7", + "user_repository_name": "python_3_11", + "platforms": [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "ppc64le-unknown-linux-gnu", + "s390x-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu" + ] + } + }, + "python_3_11": { + "bzlFile": "@@rules_python~//python/private:toolchains_repo.bzl", + "ruleClassName": "toolchain_aliases", + "attributes": { + "python_version": "3.11.7", + "user_repository_name": "python_3_11", + "platforms": [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "ppc64le-unknown-linux-gnu", + "s390x-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu" + ] + } + }, + "python_3_11_aarch64-unknown-linux-gnu": { + "bzlFile": "@@rules_python~//python:repositories.bzl", + "ruleClassName": "python_repository", + "attributes": { + "sha256": "b102eaf865eb715aa98a8a2ef19037b6cc3ae7dfd4a632802650f29de635aa13", + "patches": [], + "platform": "aarch64-unknown-linux-gnu", + "python_version": "3.11.7", + "release_filename": "20240107/cpython-3.11.7+20240107-aarch64-unknown-linux-gnu-install_only.tar.gz", + "urls": [ + "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7+20240107-aarch64-unknown-linux-gnu-install_only.tar.gz" + ], + "distutils_content": "", + "strip_prefix": "python", + "coverage_tool": "", + "ignore_root_user_error": false + } + }, + "python_3_11_aarch64-apple-darwin": { + "bzlFile": "@@rules_python~//python:repositories.bzl", + "ruleClassName": "python_repository", + "attributes": { + "sha256": "b042c966920cf8465385ca3522986b12d745151a72c060991088977ca36d3883", + "patches": [], + "platform": "aarch64-apple-darwin", + "python_version": "3.11.7", + "release_filename": "20240107/cpython-3.11.7+20240107-aarch64-apple-darwin-install_only.tar.gz", + "urls": [ + "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7+20240107-aarch64-apple-darwin-install_only.tar.gz" + ], + "distutils_content": "", + "strip_prefix": "python", + "coverage_tool": "", + "ignore_root_user_error": false + } + }, + "python_3_11_ppc64le-unknown-linux-gnu": { + "bzlFile": "@@rules_python~//python:repositories.bzl", + "ruleClassName": "python_repository", + "attributes": { + "sha256": "b44e1b74afe75c7b19143413632c4386708ae229117f8f950c2094e9681d34c7", + "patches": [], + "platform": "ppc64le-unknown-linux-gnu", + "python_version": "3.11.7", + "release_filename": "20240107/cpython-3.11.7+20240107-ppc64le-unknown-linux-gnu-install_only.tar.gz", + "urls": [ + "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7+20240107-ppc64le-unknown-linux-gnu-install_only.tar.gz" + ], + "distutils_content": "", + "strip_prefix": "python", + "coverage_tool": "", + "ignore_root_user_error": false + } + }, + "python_3_11_x86_64-apple-darwin": { + "bzlFile": "@@rules_python~//python:repositories.bzl", + "ruleClassName": "python_repository", + "attributes": { + "sha256": "a0e615eef1fafdc742da0008425a9030b7ea68a4ae4e73ac557ef27b112836d4", + "patches": [], + "platform": "x86_64-apple-darwin", + "python_version": "3.11.7", + "release_filename": "20240107/cpython-3.11.7+20240107-x86_64-apple-darwin-install_only.tar.gz", + "urls": [ + "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7+20240107-x86_64-apple-darwin-install_only.tar.gz" + ], + "distutils_content": "", + "strip_prefix": "python", + "coverage_tool": "", + "ignore_root_user_error": false + } + }, + "pythons_hub": { + "bzlFile": "@@rules_python~//python/private/bzlmod:pythons_hub.bzl", + "ruleClassName": "hub_repo", + "attributes": { + "default_python_version": "3.11", + "toolchain_prefixes": [ + "_0000_python_3_11_" + ], + "toolchain_python_versions": [ + "3.11" + ], + "toolchain_set_python_version_constraints": [ + "False" + ], + "toolchain_user_repository_names": [ + "python_3_11" + ] + } + }, + "python_versions": { + "bzlFile": "@@rules_python~//python/private:toolchains_repo.bzl", + "ruleClassName": "multi_toolchain_aliases", + "attributes": { + "python_versions": { + "3.11": "python_3_11" + } + } + }, + "python_3_11_x86_64-pc-windows-msvc": { + "bzlFile": "@@rules_python~//python:repositories.bzl", + "ruleClassName": "python_repository", + "attributes": { + "sha256": "67077e6fa918e4f4fd60ba169820b00be7c390c497bf9bc9cab2c255ea8e6f3e", + "patches": [], + "platform": "x86_64-pc-windows-msvc", + "python_version": "3.11.7", + "release_filename": "20240107/cpython-3.11.7+20240107-x86_64-pc-windows-msvc-shared-install_only.tar.gz", + "urls": [ + "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7+20240107-x86_64-pc-windows-msvc-shared-install_only.tar.gz" + ], + "distutils_content": "", + "strip_prefix": "python", + "coverage_tool": "", + "ignore_root_user_error": false + } + }, + "python_3_11_x86_64-unknown-linux-gnu": { + "bzlFile": "@@rules_python~//python:repositories.bzl", + "ruleClassName": "python_repository", + "attributes": { + "sha256": "4a51ce60007a6facf64e5495f4cf322e311ba9f39a8cd3f3e4c026eae488e140", + "patches": [], + "platform": "x86_64-unknown-linux-gnu", + "python_version": "3.11.7", + "release_filename": "20240107/cpython-3.11.7+20240107-x86_64-unknown-linux-gnu-install_only.tar.gz", + "urls": [ + "https://github.com/indygreg/python-build-standalone/releases/download/20240107/cpython-3.11.7+20240107-x86_64-unknown-linux-gnu-install_only.tar.gz" + ], + "distutils_content": "", + "strip_prefix": "python", + "coverage_tool": "", + "ignore_root_user_error": false + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_python~", + "bazel_skylib", + "bazel_skylib~" + ], + [ + "rules_python~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_python~//python/private/bzlmod:internal_deps.bzl%internal_deps": { + "general": { + "bzlTransitiveDigest": "GCT33tTSmeE1L4tW7NKpfavsz3c8nKKfHS3mUw6SdGA=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "pypi__wheel": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/b8/8b/31273bf66016be6ad22bb7345c37ff350276cfd46e389a0c2ac5da9d9073/wheel-0.41.2-py3-none-any.whl", + "sha256": "75909db2664838d015e3d9139004ee16711748a52c8f336b52882266540215d8", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__click": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl", + "sha256": "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__importlib_metadata": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/cc/37/db7ba97e676af155f5fcb1a35466f446eadc9104e25b83366e8088c9c926/importlib_metadata-6.8.0-py3-none-any.whl", + "sha256": "3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pyproject_hooks": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/d5/ea/9ae603de7fbb3df820b23a70f6aff92bf8c7770043254ad8d2dc9d6bcba4/pyproject_hooks-1.0.0-py3-none-any.whl", + "sha256": "283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pep517": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/ee/2f/ef63e64e9429111e73d3d6cbee80591672d16f2725e648ebc52096f3d323/pep517-0.13.0-py3-none-any.whl", + "sha256": "4ba4446d80aed5b5eac6509ade100bff3e7943a8489de249654a5ae9b33ee35b", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__packaging": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/ab/c3/57f0601a2d4fe15de7a553c00adbc901425661bf048f2a22dfc500caf121/packaging-23.1-py3-none-any.whl", + "sha256": "994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pip_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/e8/df/47e6267c6b5cdae867adbdd84b437393e6202ce4322de0a5e0b92960e1d6/pip_tools-7.3.0-py3-none-any.whl", + "sha256": "8717693288720a8c6ebd07149c93ab0be1fced0b5191df9e9decd3263e20d85e", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__setuptools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/4f/ab/0bcfebdfc3bfa8554b2b2c97a555569c4c1ebc74ea288741ea8326c51906/setuptools-68.1.2-py3-none-any.whl", + "sha256": "3d8083eed2d13afc9426f227b24fd1659489ec107c0e86cec2ffdde5c92e790b", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__zipp": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/8c/08/d3006317aefe25ea79d3b76c9650afabaf6d63d1c8443b236e7405447503/zipp-3.16.2-py3-none-any.whl", + "sha256": "679e51dd4403591b2d6838a48de3d283f3d188412a9782faadf845f298736ba0", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__colorama": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", + "sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__build": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/58/91/17b00d5fac63d3dca605f1b8269ba3c65e98059e1fd99d00283e42a454f0/build-0.10.0-py3-none-any.whl", + "sha256": "af266720050a66c893a6096a2f410989eeac74ff9a68ba194b3f6473e8e26171", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "rules_python_internal": { + "bzlFile": "@@rules_python~//python/private:internal_config_repo.bzl", + "ruleClassName": "internal_config_repo", + "attributes": {} + }, + "pypi__pip": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/50/c2/e06851e8cc28dcad7c155f4753da8833ac06a5c704c109313b8d5a62968a/pip-23.2.1-py3-none-any.whl", + "sha256": "7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__installer": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl", + "sha256": "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__more_itertools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/5a/cb/6dce742ea14e47d6f565589e859ad225f2a5de576d7696e0623b784e226b/more_itertools-10.1.0-py3-none-any.whl", + "sha256": "64e0735fcfdc6f3464ea133afe8ea4483b1c5fe3a3d69852e6503b43a0b222e6", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__tomli": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl", + "sha256": "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude in /python/pip_install/tools/bazel.py\n # to avoid non-determinism following pip install's behavior.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/* *\",\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_python~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@toolchains_llvm~//toolchain/extensions:llvm.bzl%llvm": { + "general": { + "bzlTransitiveDigest": "uuIgRkIewOOyWzAYOi0SlCf0unZ8OWDSK06X5laJ42Q=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "llvm_toolchain": { + "bzlFile": "@@toolchains_llvm~//toolchain:rules.bzl", + "ruleClassName": "toolchain", + "attributes": { + "absolute_paths": false, + "compile_flags": {}, + "coverage_compile_flags": {}, + "coverage_link_flags": {}, + "cxx_builtin_include_directories": {}, + "cxx_flags": {}, + "cxx_standard": {}, + "dbg_compile_flags": {}, + "link_flags": {}, + "link_libs": {}, + "llvm_versions": { + "": "16.0.0", + "darwin-aarch64": "16.0.5", + "darwin-x86_64": "15.0.7" + }, + "opt_compile_flags": {}, + "opt_link_flags": {}, + "stdlib": {}, + "sysroot": {}, + "target_settings": {}, + "toolchain_roots": {}, + "unfiltered_compile_flags": {} + } + }, + "llvm_toolchain_llvm": { + "bzlFile": "@@toolchains_llvm~//toolchain:rules.bzl", + "ruleClassName": "llvm", + "attributes": { + "alternative_llvm_sources": [], + "auth_patterns": {}, + "distribution": "auto", + "llvm_mirror": "", + "llvm_version": "", + "llvm_versions": { + "": "16.0.0", + "darwin-aarch64": "16.0.5", + "darwin-x86_64": "15.0.7" + }, + "netrc": "", + "sha256": {}, + "strip_prefix": {}, + "urls": {} + } + } + }, + "recordedRepoMappingEntries": [ + [ + "toolchains_llvm~", + "bazel_tools", + "bazel_tools" + ], + [ + "toolchains_llvm~", + "toolchains_llvm", + "toolchains_llvm~" + ] + ] + } + } + } +} diff --git a/devertexwahn/WORKSPACE.bazel b/devertexwahn/WORKSPACE.bazel index 7d75eb55..72c37ddd 100644 --- a/devertexwahn/WORKSPACE.bazel +++ b/devertexwahn/WORKSPACE.bazel @@ -1 +1,6 @@ +""" + SPDX-FileCopyrightText: Copyright 2024 Julian Amann + SPDX-License-Identifier: Apache-2.0 +""" + # Dummy file to keep IDEs happy diff --git a/devertexwahn/WORKSPACE.bzlmod b/devertexwahn/WORKSPACE.bzlmod index e2accc21..83404f55 100644 --- a/devertexwahn/WORKSPACE.bzlmod +++ b/devertexwahn/WORKSPACE.bzlmod @@ -14,29 +14,3 @@ load("//okapi/third_party:okapi_deps.bzl", "okapi_deps") okapi_deps() -# Boost deps -load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps") - -boost_deps() - - -#------------------------------------------------------------------------------------- -# LLVM Toolchain -#------------------------------------------------------------------------------------- - -load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies") - -bazel_toolchain_dependencies() - -load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") - -llvm_toolchain( - name = "llvm_toolchain", - #llvm_version = "15.0.6", - llvm_version = "14.0.0", -) - -load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") - -llvm_register_toolchains() - diff --git a/devertexwahn/ci/macOS-12-apple-clang14.yaml b/devertexwahn/ci/macOS-12-apple-clang14.yaml index af7bb7a2..7232f25d 100644 --- a/devertexwahn/ci/macOS-12-apple-clang14.yaml +++ b/devertexwahn/ci/macOS-12-apple-clang14.yaml @@ -26,36 +26,41 @@ steps: clang --version displayName: "Show Clang version" + + - script: | + cd devertexwahn + bazel run --config=macos -- //tools/compiler_information + displayName: "Show compiler information" # fastbuild - script: | cd devertexwahn - bazel build --config=macos -- //... + bazel build --config=macos -- //... # displayName: "Bazel build macos-fastbuild" - script: | cd devertexwahn - bazel test --config=macos -- //... + bazel test --config=macos -- //... # displayName: "Bazel test macos-fastbuild" # dbg - script: | cd devertexwahn - bazel build --config=macos --compilation_mode=dbg -- //... + bazel build --config=macos --compilation_mode=dbg -- //... # displayName: "Bazel build macos-dbg" - script: | cd devertexwahn - bazel test --config=macos --compilation_mode=dbg -- //... + bazel test --config=macos --compilation_mode=dbg -- //... # displayName: "Bazel test macos-dbg" # opt - script: | cd devertexwahn - bazel build --config=macos --compilation_mode=opt -- //... + bazel build --config=macos --compilation_mode=opt -- //... # displayName: "Bazel build macos-opt" - script: | cd devertexwahn - bazel test --config=macos --compilation_mode=opt -- //... + bazel test --config=macos --compilation_mode=opt -- //... # displayName: "Bazel test macos-opt" diff --git a/devertexwahn/ci/macOS-12-clang14.yaml b/devertexwahn/ci/macOS-12-clang14.yaml index 71f36784..51858dd9 100644 --- a/devertexwahn/ci/macOS-12-clang14.yaml +++ b/devertexwahn/ci/macOS-12-clang14.yaml @@ -28,6 +28,11 @@ steps: displayName: "Show Clang version" + - script: | + cd devertexwahn + bazel run --config=macos -- //tools/compiler_information + displayName: "Show compiler information" + # fastbuild - script: | cd devertexwahn diff --git a/devertexwahn/ci/macOS-13-apple-clang14.yaml b/devertexwahn/ci/macOS-13-apple-clang14.yaml index d037ec20..c64140a3 100644 --- a/devertexwahn/ci/macOS-13-apple-clang14.yaml +++ b/devertexwahn/ci/macOS-13-apple-clang14.yaml @@ -30,36 +30,40 @@ steps: clang --version displayName: "Show Clang version" + - script: | + cd devertexwahn + bazel run --config=macos -- //tools/compiler_information + displayName: "Show compiler information" # fastbuild - script: | cd devertexwahn - bazel build --config=macos -- //... + bazel build --config=macos -- //... # displayName: "Bazel build macos-fastbuild" - script: | cd devertexwahn - bazel test --config=macos -- //... + bazel test --config=macos -- //... # displayName: "Bazel test macos-fastbuild" # dbg - script: | cd devertexwahn - bazel build --config=macos --compilation_mode=dbg -- //... + bazel build --config=macos --compilation_mode=dbg -- //... # displayName: "Bazel build macos-dbg" - script: | cd devertexwahn - bazel test --config=macos --compilation_mode=dbg -- //... + bazel test --config=macos --compilation_mode=dbg -- //... # displayName: "Bazel test macos-dbg" # opt - script: | cd devertexwahn - bazel build --config=macos --compilation_mode=opt -- //... + bazel build --config=macos --compilation_mode=opt -- //... # displayName: "Bazel build macos-opt" - script: | cd devertexwahn - bazel test --config=macos --compilation_mode=opt -- //... + bazel test --config=macos --compilation_mode=opt -- //... # displayName: "Bazel test macos-opt" diff --git a/devertexwahn/ci/macOS-14-apple-clang14.yaml b/devertexwahn/ci/macOS-14-apple-clang14.yaml new file mode 100644 index 00000000..9c65c9d8 --- /dev/null +++ b/devertexwahn/ci/macOS-14-apple-clang14.yaml @@ -0,0 +1,65 @@ +# +# SPDX-FileCopyrightText: Copyright 2024 Julian Amann +# SPDX-License-Identifier: Apache-2.0 +# + +# Apple Clang 14 on macOS 14 +# Make sure we can build with Apple Clang13 in all different compilation modes +steps: + - checkout: self + clean: true + fetchDepth: 1 + lfs: false + submodules: false + + - script: | + sw_vers + uname + displayName: "Show OS version" + + - script: | + sysctl -a | grep machdep.cpu + displayName: "Show CPU info" + + - script: | + cd devertexwahn + bazel version + displayName: "Show Bazel version" + + - script: | + clang --version + displayName: "Show Clang version" + + + # fastbuild + - script: | + cd devertexwahn + bazel build --config=macos -- //... # + displayName: "Bazel build macos-fastbuild" + + - script: | + cd devertexwahn + bazel test --config=macos -- //... # + displayName: "Bazel test macos-fastbuild" + + # dbg + - script: | + cd devertexwahn + bazel build --config=macos --compilation_mode=dbg -- //... # + displayName: "Bazel build macos-dbg" + + - script: | + cd devertexwahn + bazel test --config=macos --compilation_mode=dbg -- //... # + displayName: "Bazel test macos-dbg" + + # opt + - script: | + cd devertexwahn + bazel build --config=macos --compilation_mode=opt -- //... # + displayName: "Bazel build macos-opt" + + - script: | + cd devertexwahn + bazel test --config=macos --compilation_mode=opt -- //... # + displayName: "Bazel test macos-opt" diff --git a/devertexwahn/ci/ubuntu-20.04-gcc9-dbg.yaml b/devertexwahn/ci/ubuntu-20.04-gcc9-dbg.yaml deleted file mode 100644 index c9e1fc3f..00000000 --- a/devertexwahn/ci/ubuntu-20.04-gcc9-dbg.yaml +++ /dev/null @@ -1,68 +0,0 @@ -# -# SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann -# SPDX-License-Identifier: Apache-2.0 -# - -# GCC9 on Ubuntu 20.04 -# Make sure we can build with GCC 9 in all different compilation modes - -steps: - - script: | - df - displayName: 'Show disk space' - - - checkout: self - clean: true - fetchDepth: 1 - lfs: false - submodules: false - - - - script: | - lsb_release -a - displayName: 'Show OS version' - - - script: | - df - displayName: 'Show disk space' - - - script: | - cd devertexwahn - bazel version - displayName: 'Show Bazel version' - - - script: | - gcc --version - displayName: 'Show GCC version' - - - - script: | - df - displayName: 'Show disk space' - - - script: | - cd devertexwahn - bazel build --config=gcc9 --compilation_mode=dbg -- //... -//okapi/... - displayName: 'Bazel build gcc9-dbg - Part 1' - - - script: | - df - displayName: 'Show disk space' - - - script: | - cd devertexwahn - bazel clean # free some space - displayName: 'Bazel clean' - - - script: | - df - displayName: 'Show disk space' - - - script: | - cd devertexwahn - bazel build --config=gcc9 --compilation_mode=dbg -- //okapi/... - displayName: 'Bazel build gcc9-dbg - Part 2' - - - script: | - df - displayName: 'Show disk space' diff --git a/devertexwahn/ci/ubuntu-20.04-gcc9-fast.yaml b/devertexwahn/ci/ubuntu-20.04-gcc9-fast.yaml index 21a7fbd7..57f7046c 100644 --- a/devertexwahn/ci/ubuntu-20.04-gcc9-fast.yaml +++ b/devertexwahn/ci/ubuntu-20.04-gcc9-fast.yaml @@ -36,6 +36,15 @@ steps: displayName: 'Show GCC version' + - script: | + df -H + displayName: 'Show disk space' + + - script: | + cd devertexwahn + bazel run --config=gcc9 -- //tools/compiler_information + displayName: "Show compiler information" + - script: | df -H displayName: 'Show disk space' diff --git a/devertexwahn/ci/ubuntu-20.04-gcc9-opt.yaml b/devertexwahn/ci/ubuntu-20.04-gcc9-opt.yaml index 0edb55ae..66ffe3aa 100644 --- a/devertexwahn/ci/ubuntu-20.04-gcc9-opt.yaml +++ b/devertexwahn/ci/ubuntu-20.04-gcc9-opt.yaml @@ -36,6 +36,15 @@ steps: displayName: 'Show GCC version' + - script: | + df -H + displayName: 'Show disk space' + + - script: | + cd devertexwahn + bazel run --config=gcc9 --compilation_mode=opt -- //tools/compiler_information + displayName: "Show compiler information" + - script: | df -H displayName: 'Show disk space' diff --git a/devertexwahn/ci/ubuntu-22.04-clang14.yaml b/devertexwahn/ci/ubuntu-22.04-clang16.yaml similarity index 71% rename from devertexwahn/ci/ubuntu-22.04-clang14.yaml rename to devertexwahn/ci/ubuntu-22.04-clang16.yaml index 155c4efc..0ca418cd 100644 --- a/devertexwahn/ci/ubuntu-22.04-clang14.yaml +++ b/devertexwahn/ci/ubuntu-22.04-clang16.yaml @@ -31,37 +31,42 @@ steps: bazel version displayName: 'Show Bazel version' + - script: | + sudo apt-get update + sudo apt-get -y install libncurses5 # needed by Clang + displayName: "Install libncurses5" + # fastbuild - script: | cd devertexwahn - bazel build --config=clang14 -- //... + bazel build --config=clang16 -- //... displayName: 'Bazel build clang14-fastbuild' - script: | cd devertexwahn - bazel test --config=clang14 -- //... + bazel test --config=clang16 -- //... displayName: 'Bazel test clang14-fastbuild' # dbg - script: | cd devertexwahn - bazel build --config=clang14 --compilation_mode=dbg -- //... + bazel build --config=clang16 --compilation_mode=dbg -- //... displayName: 'Bazel build clang14-dbg' - script: | cd devertexwahn - bazel test --config=clang14 --compilation_mode=dbg -- //... + bazel test --config=clang16 --compilation_mode=dbg -- //... displayName: 'Bazel test clang14-dbg' - script: | cd devertexwahn - bazel build --config=clang14 --compilation_mode=opt -- //... + bazel build --config=clang16 --compilation_mode=opt -- //... displayName: 'Bazel build clang14-opt' - script: | cd devertexwahn - bazel test --config=clang14 --compilation_mode=opt -- //... + bazel test --config=clang16 --compilation_mode=opt -- //... displayName: 'Bazel test clang14-opt' - script: | diff --git a/devertexwahn/ci/ubuntu-22.04-gcc11-dbg.yaml b/devertexwahn/ci/ubuntu-22.04-gcc11-dbg-part1.yaml similarity index 65% rename from devertexwahn/ci/ubuntu-22.04-gcc11-dbg.yaml rename to devertexwahn/ci/ubuntu-22.04-gcc11-dbg-part1.yaml index 5e33e90a..0e16003e 100644 --- a/devertexwahn/ci/ubuntu-22.04-gcc11-dbg.yaml +++ b/devertexwahn/ci/ubuntu-22.04-gcc11-dbg-part1.yaml @@ -38,20 +38,26 @@ steps: - script: | cd devertexwahn - bazel build --config=gcc11 --compilation_mode=dbg -- //... - displayName: "Bazel build gcc11-dbg" + bazel run --config=gcc11 --compilation_mode=dbg -- //tools/compiler_information + displayName: "Show compiler information" - script: | - cd devertexwahn - bazel test --config=gcc11 --compilation_mode=dbg -- //... - displayName: "Bazel test gcc11-dbg" + df + displayName: 'Show disk space' + + - script: | + cd devertexwahn + bazel build --config=gcc11 --compilation_mode=dbg -- //... -//okapi/... + displayName: "Bazel build gcc11-dbg (part 1)" - # Make sure that Bazel query works - not part of an own dedicated build job to save some resources (restart of VM, etc.) - script: | cd devertexwahn - bazel query //... - bazel cquery --config=gcc11 //... - displayName: "Bazel query" + bazel test --config=gcc11 --compilation_mode=dbg -- //... -//okapi/... + displayName: "Bazel test gcc11-dbg (part 1)" + + - script: | + df + displayName: 'Show disk space' - script: | df diff --git a/devertexwahn/ci/ubuntu-22.04-gcc11-fast-opt.yaml b/devertexwahn/ci/ubuntu-22.04-gcc11-fast-opt.yaml index ee93a714..30d9957d 100644 --- a/devertexwahn/ci/ubuntu-22.04-gcc11-fast-opt.yaml +++ b/devertexwahn/ci/ubuntu-22.04-gcc11-fast-opt.yaml @@ -36,6 +36,11 @@ steps: displayName: "Show GCC version" + - script: | + cd devertexwahn + bazel run --config=gcc11 -- //tools/compiler_information + displayName: "Show compiler information" + - script: | cd devertexwahn bazel build --config=gcc11 -- //... diff --git a/devertexwahn/ci/windows-2019-vs2019-dbg.yaml b/devertexwahn/ci/windows-2019-vs2019-dbg.yaml index f9fa37b0..faf9cc66 100644 --- a/devertexwahn/ci/windows-2019-vs2019-dbg.yaml +++ b/devertexwahn/ci/windows-2019-vs2019-dbg.yaml @@ -18,6 +18,11 @@ steps: displayName: "Show Bazel version" + - script: | + cd devertexwahn + bazel --output_base=C:/bazel_output_base run --config=vs2019 --compilation_mode=dbg -- //tools/compiler_information + displayName: "Show compiler information" + # dbg - script: | cd devertexwahn diff --git a/devertexwahn/ci/windows-2019-vs2019-fastbuild.yaml b/devertexwahn/ci/windows-2019-vs2019-fastbuild.yaml index bf787209..ec6a1261 100644 --- a/devertexwahn/ci/windows-2019-vs2019-fastbuild.yaml +++ b/devertexwahn/ci/windows-2019-vs2019-fastbuild.yaml @@ -18,6 +18,11 @@ steps: displayName: "Show Bazel version" + - script: | + cd devertexwahn + bazel --output_base=C:/bazel_output_base run --config=vs2019 -- //tools/compiler_information + displayName: "Show compiler information" + # fastbuild - script: | cd devertexwahn diff --git a/devertexwahn/ci/windows-2019-vs2019-opt.yaml b/devertexwahn/ci/windows-2019-vs2019-opt.yaml index 0693584e..9abd1c3b 100644 --- a/devertexwahn/ci/windows-2019-vs2019-opt.yaml +++ b/devertexwahn/ci/windows-2019-vs2019-opt.yaml @@ -18,6 +18,11 @@ steps: displayName: "Show Bazel version" + - script: | + cd devertexwahn + bazel --output_base=C:/bazel_output_base run --config=vs2019 --compilation_mode=opt -- //tools/compiler_information + displayName: "Show compiler information" + # opt - script: | cd devertexwahn diff --git a/devertexwahn/ci/windows-2022-vs2022-dbg.yaml b/devertexwahn/ci/windows-2022-vs2022-dbg.yaml index 859b9b39..df84081b 100644 --- a/devertexwahn/ci/windows-2022-vs2022-dbg.yaml +++ b/devertexwahn/ci/windows-2022-vs2022-dbg.yaml @@ -19,6 +19,11 @@ steps: + - script: | + cd devertexwahn + bazel --output_base=C:/bazel_output_base run --config=vs2022 --compilation_mode=dbg -- //tools/compiler_information + displayName: "Show compiler information" + # dbg - script: | cd devertexwahn diff --git a/devertexwahn/ci/windows-2022-vs2022-fastbuild.yaml b/devertexwahn/ci/windows-2022-vs2022-fastbuild.yaml index 0184d9c7..7b7bebe0 100644 --- a/devertexwahn/ci/windows-2022-vs2022-fastbuild.yaml +++ b/devertexwahn/ci/windows-2022-vs2022-fastbuild.yaml @@ -19,6 +19,11 @@ steps: + - script: | + cd devertexwahn + bazel --output_base=C:/bazel_output_base run --config=vs2022 -- //tools/compiler_information + displayName: "Show compiler information" + # fastbuild - script: | cd devertexwahn diff --git a/devertexwahn/ci/windows-2022-vs2022-opt.yaml b/devertexwahn/ci/windows-2022-vs2022-opt.yaml index 6c045980..8fdd1e22 100644 --- a/devertexwahn/ci/windows-2022-vs2022-opt.yaml +++ b/devertexwahn/ci/windows-2022-vs2022-opt.yaml @@ -18,6 +18,11 @@ steps: displayName: "Show Bazel version" + + - script: | + cd devertexwahn + bazel --output_base=C:/bazel_output_base run --config=vs2022 --compilation_mode=opt -- //tools/compiler_information + displayName: "Show compiler information" # opt - script: | diff --git a/devertexwahn/core/BUILD.bazel b/devertexwahn/core/BUILD.bazel index 9c591ca7..d55dbe9e 100644 --- a/devertexwahn/core/BUILD.bazel +++ b/devertexwahn/core/BUILD.bazel @@ -1,5 +1,5 @@ """ - SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann + SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann SPDX-License-Identifier: Apache-2.0 """ @@ -12,7 +12,6 @@ cc_library( deps = [ ":namespace", "@boost.predef", - #"@boost//:predef", ], ) diff --git a/devertexwahn/core/reference_counted_test.cpp b/devertexwahn/core/reference_counted_test.cpp index 94f850a0..b9c65d2e 100644 --- a/devertexwahn/core/reference_counted_test.cpp +++ b/devertexwahn/core/reference_counted_test.cpp @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann + * SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann * SPDX-License-Identifier: Apache-2.0 */ #include "core/reference_counted.h" + #include "gmock/gmock.h" using namespace de_vertexwahn; diff --git a/devertexwahn/core/tests/third_party/fmt_test.cpp b/devertexwahn/core/tests/third_party/fmt_test.cpp index 9695244f..35bbd1c4 100644 --- a/devertexwahn/core/tests/third_party/fmt_test.cpp +++ b/devertexwahn/core/tests/third_party/fmt_test.cpp @@ -16,6 +16,8 @@ #include "gmock/gmock.h" +#include + TEST(fmt, TextFormatting) { std::string message = fmt::format("The answer is {}.", 42); EXPECT_THAT(message, "The answer is 42."); @@ -32,7 +34,7 @@ struct fmt::formatter { constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } template - auto format(complex const &number, FormatContext &ctx) { + auto format(complex const &number, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "{0}+i{1}", number.a, number.b); } }; diff --git a/devertexwahn/flatland/cli/BUILD.bazel b/devertexwahn/flatland/cli/BUILD.bazel index ded74d8e..59496e3b 100644 --- a/devertexwahn/flatland/cli/BUILD.bazel +++ b/devertexwahn/flatland/cli/BUILD.bazel @@ -12,8 +12,8 @@ cc_binary( deps = [ "//flatland/rendering", "//flatland/rendering/scene:load_scene", - "@com_google_absl//absl/flags:flag", - "@com_google_absl//absl/flags:parse", + "@abseil-cpp//absl/flags:flag", + "@abseil-cpp//absl/flags:parse", "@fmt", ], ) diff --git a/devertexwahn/flatland/rendering/bsdf/BUILD.bazel b/devertexwahn/flatland/rendering/bsdf/BUILD.bazel index b169bae6..3f26f7e2 100644 --- a/devertexwahn/flatland/rendering/bsdf/BUILD.bazel +++ b/devertexwahn/flatland/rendering/bsdf/BUILD.bazel @@ -12,6 +12,7 @@ cc_library( "//core:object", "//core:reference_counted", "//flatland/rendering:property_set", + "//flatland/rendering/scene/shape:medium_event", "//imaging:color", ], ) diff --git a/devertexwahn/flatland/rendering/bsdf/bsdf.h b/devertexwahn/flatland/rendering/bsdf/bsdf.h index 80a9cd16..818711f3 100644 --- a/devertexwahn/flatland/rendering/bsdf/bsdf.h +++ b/devertexwahn/flatland/rendering/bsdf/bsdf.h @@ -8,6 +8,7 @@ #define De_Vertexwahn_Flatland_Rendering_BSDF_11d72dcc_a416_4530_b706_b1e69711c5c5_h #include "flatland/rendering/property_set.h" +#include "flatland/rendering/scene/shape/medium_event.h" #include "imaging/color.h" @@ -20,9 +21,11 @@ template struct BSDFSampleType { using Scalar = ScalarType; using Vector = VectorType; + using MediumEvent = MediumEventType; Vector wi; Vector wo; + const MediumEvent* me; }; using BSDFSample2f = BSDFSampleType; @@ -46,6 +49,7 @@ class BSDFType : public Object { using Vector = VectorType; using Color = ColorType; using BSDFSample = BSDFSampleType; + using MediumEvent = MediumEventType; BSDFType(const PropertySet &ps) {} diff --git a/devertexwahn/flatland/rendering/bsdf/bsdf_test.cpp b/devertexwahn/flatland/rendering/bsdf/bsdf_test.cpp index ec86d4be..c38bce87 100644 --- a/devertexwahn/flatland/rendering/bsdf/bsdf_test.cpp +++ b/devertexwahn/flatland/rendering/bsdf/bsdf_test.cpp @@ -31,9 +31,10 @@ TEST(BxDF, WhenADefaultInitalized_ThenDefaultMaterialValues) { BSDFSample2f bsdf_sample; bsdf_sample.wi = Vector2f{0.f, 1.f}; bsdf_sample.wo = Vector2f{0.f, 1.f}; + MediumEvent2f me{}; - EXPECT_THAT(bsdf.sample(bsdf_sample, Point2f(0.f, 0.f)), Color3f(0.f)); - EXPECT_THAT(bsdf.evaluate(bsdf_sample), Color3f(0.f)); + EXPECT_THAT(bsdf.sample(bsdf_sample, Point2f{0.f, 0.f}), Color3f(0.f)); + EXPECT_THAT(bsdf.evaluate(bsdf_sample), Color3f{0.f}); //EXPECT_THAT(bsdf.refraction_index(), 1.f); //EXPECT_THAT(bsdf.interface_interaction_type(), InterfaceInteraction::SpecularTransmission); } diff --git a/devertexwahn/flatland/rendering/bsdf/svg_material_test.cpp b/devertexwahn/flatland/rendering/bsdf/svg_material_test.cpp index 87a6001f..9049be32 100644 --- a/devertexwahn/flatland/rendering/bsdf/svg_material_test.cpp +++ b/devertexwahn/flatland/rendering/bsdf/svg_material_test.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann + * SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann * SPDX-License-Identifier: Apache-2.0 */ @@ -34,17 +34,19 @@ TEST(SvgMaterial, BSDF) { BSDFSample2f bsdf_sample; bsdf_sample.wo = Vector2f{0.f, 1.f}; bsdf_sample.wi = Vector2f{0.f, 1.f}; + MediumEvent2f me{}; + bsdf_sample.me = &me; - EXPECT_THAT(material.sample(bsdf_sample, Vector2f(.5f)), Color3f(0.f)); + EXPECT_THAT(material.sample(bsdf_sample, Vector2f{.5f}), Color3f{0.f}); EXPECT_THAT(material.pdf(bsdf_sample), 0.f); - EXPECT_THAT(material.evaluate(bsdf_sample), Color3f(0.f)); + EXPECT_THAT(material.evaluate(bsdf_sample), Color3f{0.f}); } TEST(SvgMaterial, WhenADefaultInitalized_ThenDefaultMaterialValues) { PropertySet ps; SvgMaterial material{ps}; - EXPECT_THAT(material.stroke_color(), Color3f(0.f, 0.f, 0.f)); - EXPECT_THAT(material.fill_color(), Color3f(1.f, 1.f, 1.f)); + EXPECT_THAT(material.stroke_color(), (Color3f{0.f, 0.f, 0.f})); + EXPECT_THAT(material.fill_color(), (Color3f{1.f, 1.f, 1.f})); // TODO: Check if brackets can be moved to macro - maybe impossible because of C++ syntax? EXPECT_THAT(material.stroke_width(), 1.f); } diff --git a/devertexwahn/flatland/rendering/fresnel.h b/devertexwahn/flatland/rendering/fresnel.h index fbf1b299..373c6716 100644 --- a/devertexwahn/flatland/rendering/fresnel.h +++ b/devertexwahn/flatland/rendering/fresnel.h @@ -30,6 +30,7 @@ bool refract(const Vector3f& v, const Vector3f& n, float iorI, float iorT, return true; } +/* // schlick approximation of fresnel reflectance float fresnel(float cosThetaI, float iorI, float iorT) { const float f0 = @@ -37,7 +38,7 @@ float fresnel(float cosThetaI, float iorI, float iorT) { const auto pow5 = [](float x) { return x * x * x * x * x; }; return f0 + (1.0f - f0) * pow5(std::max(1.0f - std::abs(cosThetaI), 0.0f)); } - +*/ DE_VERTEXWAHN_END_NAMESPACE #endif // end define De_Vertexwahn_Flatland_Rendering_fresnel_ba618a3b_8405_49fb_bd9c_36d9474e98de_h diff --git a/devertexwahn/flatland/rendering/property_set_formatter.h b/devertexwahn/flatland/rendering/property_set_formatter.h index 79742964..d35cf687 100644 --- a/devertexwahn/flatland/rendering/property_set_formatter.h +++ b/devertexwahn/flatland/rendering/property_set_formatter.h @@ -20,7 +20,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::Vector2f &v, FormatContext &ctx) { + auto format(const de_vertexwahn::Vector2f &v, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {})", v.x(), v.y()); } }; @@ -30,7 +30,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::Vector2d &v, FormatContext &ctx) { + auto format(const de_vertexwahn::Vector2d &v, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {})", v.x(), v.y()); } }; @@ -40,7 +40,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::Vector3f &v, FormatContext &ctx) { + auto format(const de_vertexwahn::Vector3f &v, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {}, {})", v.x(), v.y(), v.z()); } }; @@ -50,7 +50,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::Vector3f &v, FormatContext &ctx) { + auto format(const de_vertexwahn::Vector3f &v, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {}, {})", v.x(), v.y(), v.z()); } }; @@ -60,7 +60,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::Point2f &v, FormatContext &ctx) { + auto format(const de_vertexwahn::Point2f &v, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {})", v.x(), v.y()); } }; @@ -70,7 +70,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::Point3f &v, FormatContext &ctx) { + auto format(const de_vertexwahn::Point3f &v, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {}, {})", v.x(), v.y(), v.z()); } }; @@ -80,7 +80,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::Point2d &v, FormatContext &ctx) { + auto format(const de_vertexwahn::Point2d &v, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {})", v.x(), v.y()); } }; @@ -90,7 +90,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::Color3f &c, FormatContext &ctx) { + auto format(const de_vertexwahn::Color3f &c, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({}, {}, {})", c.red(), c.green(), c.blue()); } }; @@ -100,7 +100,7 @@ struct fmt::formatter { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::Transform44f &c, FormatContext &ctx) { + auto format(const de_vertexwahn::Transform44f &c, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "({})", c.matrix()(0, 0)); } }; @@ -110,7 +110,7 @@ struct fmt::formatter> { constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } template - auto format(const de_vertexwahn::ReferenceCounted &obj, FormatContext &ctx) { + auto format(const de_vertexwahn::ReferenceCounted &obj, FormatContext &ctx) const { return fmt::format_to(ctx.out(), "{}", obj->to_string()); } }; diff --git a/devertexwahn/flatland/rendering/sampler.h b/devertexwahn/flatland/rendering/sampler.h index 5f595187..296159f8 100644 --- a/devertexwahn/flatland/rendering/sampler.h +++ b/devertexwahn/flatland/rendering/sampler.h @@ -47,15 +47,15 @@ class SamplerType : public Object { }; template -class StaticDebugSamplerType : public SamplerType { +class ConstantSamplerType final : public SamplerType { public: using Scalar = ScalarType; using Point = Point2; using Base = SamplerType; - StaticDebugSamplerType(const PropertySet &ps) : SamplerType(ps) {} + ConstantSamplerType(const PropertySet &ps) : SamplerType(ps) {} - virtual ~StaticDebugSamplerType() {} + virtual ~ConstantSamplerType() {} [[nodiscard]] Scalar next_1d() override { @@ -71,7 +71,7 @@ class StaticDebugSamplerType : public SamplerType { std::unique_ptr> clone() override { PropertySet ps; ps.add_property("sample_count", Base::sample_count_); - return std::make_unique(ps); + return std::make_unique(ps); } [[nodiscard]] @@ -81,7 +81,7 @@ class StaticDebugSamplerType : public SamplerType { }; template -class IndependentSamplerType : public SamplerType { +class IndependentSamplerType final : public SamplerType { public: using Base = SamplerType; @@ -129,7 +129,7 @@ class IndependentSamplerType : public SamplerType { using Sampler2f = SamplerType; using Sampler2d = SamplerType; -using StaticDebugSampler = StaticDebugSamplerType; +using ConstantSampler = ConstantSamplerType; using IndependentSampler = IndependentSamplerType; DE_VERTEXWAHN_END_NAMESPACE diff --git a/devertexwahn/flatland/rendering/sampler_test.cpp b/devertexwahn/flatland/rendering/sampler_test.cpp index 88137dc7..aa2466ec 100644 --- a/devertexwahn/flatland/rendering/sampler_test.cpp +++ b/devertexwahn/flatland/rendering/sampler_test.cpp @@ -151,8 +151,8 @@ TEST(IndependentSampler, clone) { } TEST(PixelCenterSampler, GivenPixelCenterSample_WhenRequestingSample_ThenExpectAlwaysCenterPosition) { - StaticDebugSampler pcs{{}}; + ConstantSampler pcs{{}}; EXPECT_THAT(pcs.next_1d(), .5f); EXPECT_THAT(pcs.next_2d(), Point2f(.5f, .5f)); -} \ No newline at end of file +} diff --git a/devertexwahn/flatland/rendering/scene/load_scene.cpp b/devertexwahn/flatland/rendering/scene/load_scene.cpp index 4468cde5..bdb379d3 100644 --- a/devertexwahn/flatland/rendering/scene/load_scene.cpp +++ b/devertexwahn/flatland/rendering/scene/load_scene.cpp @@ -24,7 +24,7 @@ DE_VERTEXWAHN_BEGIN_NAMESPACE // Copied from https://github.com/mitsuba-renderer/mitsuba3/blob/16261c1bd1f4805b8799300f93c91ba3af8174f0/src/core/string.cpp#L75 // Mitsuba3 -// TODO: Move to core - string class +// TODO(Vertexwahn): Move to core - string class // or replace by boost::split(tokens, csv, boost::is_any_of(","));? std::vector tokenize(const std::string &string, const std::string &delim = ", ", diff --git a/devertexwahn/flatland/rendering/scene/shape/medium_event.h b/devertexwahn/flatland/rendering/scene/shape/medium_event.h index bdf083d5..5aca581d 100644 --- a/devertexwahn/flatland/rendering/scene/shape/medium_event.h +++ b/devertexwahn/flatland/rendering/scene/shape/medium_event.h @@ -27,6 +27,7 @@ struct MediumEventType { Scalar t; // distance to intersection point Frame geo_frame; // geo_frame regarding to world space Frame sh_frame; // shading frame + Point2f uv; // UV surface coordinates const ShapeType *shape = nullptr; }; diff --git a/devertexwahn/flatland/tests/acceptance_tests/test_render_scenes.sh b/devertexwahn/flatland/tests/acceptance_tests/test_render_scenes.sh index 4a5ea4ae..0c16a2c7 100755 --- a/devertexwahn/flatland/tests/acceptance_tests/test_render_scenes.sh +++ b/devertexwahn/flatland/tests/acceptance_tests/test_render_scenes.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash # -# SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann +# SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann # SPDX-License-Identifier: Apache-2.0 # -check_De_Vertexwahn_Flatland_scene_output() { +check_flatland_scene_output() { flatland/cli/flatland.cli --scene_filename="$1" FILE="$2" @@ -38,25 +38,27 @@ check_De_Vertexwahn_Flatland_scene_output() { # M1 generates slightly different results for some scenes - therefore we have special handling for M1 here. # Running a docker container on a M1 machine with Ubuntu 22.04 gives the x86_64 results -# I really fear to claim this - maybe a bug in {fmt}...? +# Update April 2024: Seems that we now get the same results... if [[ $(uname -m) == 'arm64' ]]; then - check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/ao.flatland.xml" "flatland/scenes/ao.svg" "flatland/scenes/reference_images/ao_ref.M1_apple_silicon.svg" - check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/bunny/bunny.ao.flatland.xml" "flatland/scenes/bunny/bunny.ao.svg" "flatland/scenes/reference_images/bunny.ao_ref.M1_apple_silicon.svg" + #check_flatland_scene_output "flatland/scenes/ao.flatland.xml" "flatland/scenes/ao.svg" "flatland/scenes/reference_images/ao_ref.M1_apple_silicon.svg" + check_flatland_scene_output "flatland/scenes/ao.flatland.xml" "flatland/scenes/ao.svg" "flatland/scenes/reference_images/ao_ref.svg" + #check_flatland_scene_output "flatland/scenes/bunny/bunny.ao.flatland.xml" "flatland/scenes/bunny/bunny.ao.svg" "flatland/scenes/reference_images/bunny.ao_ref.M1_apple_silicon.svg" + check_flatland_scene_output "flatland/scenes/bunny/bunny.ao.flatland.xml" "flatland/scenes/bunny/bunny.ao.svg" "flatland/scenes/reference_images/bunny.ao_ref.svg" else # if uname -m is x86_64 or aarch64 - check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/ao.flatland.xml" "flatland/scenes/ao.svg" "flatland/scenes/reference_images/ao_ref.svg" - check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/bunny/bunny.ao.flatland.xml" "flatland/scenes/bunny/bunny.ao.svg" "flatland/scenes/reference_images/bunny.ao_ref.svg" + check_flatland_scene_output "flatland/scenes/ao.flatland.xml" "flatland/scenes/ao.svg" "flatland/scenes/reference_images/ao_ref.svg" + check_flatland_scene_output "flatland/scenes/bunny/bunny.ao.flatland.xml" "flatland/scenes/bunny/bunny.ao.svg" "flatland/scenes/reference_images/bunny.ao_ref.svg" fi -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/bunny/bunny.flatland.xml" "flatland/scenes/bunny/bunny.svg" "flatland/scenes/reference_images/bunny_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/disk.ao.flatland.xml" "flatland/scenes/disk.ao.svg" "flatland/scenes/reference_images/disk.ao_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/disk.flatland.xml" "flatland/scenes/disk.svg" "flatland/scenes/reference_images/disk_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/disk_2.flatland.xml" "flatland/scenes/disk_2.svg" "flatland/scenes/reference_images/disk_2_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/disk_grid.flatland.xml" "flatland/scenes/disk_grid.svg" "flatland/scenes/reference_images/disk_grid_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/mirror.flatland.xml" "flatland/scenes/mirror.svg" "flatland/scenes/reference_images/mirror_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/mirrors.flatland.xml" "flatland/scenes/mirrors.svg" "flatland/scenes/reference_images/mirrors_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/rectangle.flatland.xml" "flatland/scenes/rectangle.svg" "flatland/scenes/reference_images/rectangle_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/rectangles.flatland.xml" "flatland/scenes/rectangles.svg" "flatland/scenes/reference_images/rectangles_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/gradient_refractive_index.flatland.xml" "flatland/scenes/gradient_refractive_index.svg" "flatland/scenes/reference_images/gradient_refractive_index_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/quadtree/quadtree_scene.flatland.xml" "flatland/scenes/quadtree/quadtree.svg" "flatland/scenes/reference_images/quadtree_ref.svg" -check_De_Vertexwahn_Flatland_scene_output "flatland/scenes/quadtree/quadtree_corner_case_scene.flatland.xml" "flatland/scenes/quadtree/quadtree_corner_case.svg" "flatland/scenes/reference_images/quadtree_corner_case_ref.svg" \ No newline at end of file +check_flatland_scene_output "flatland/scenes/bunny/bunny.flatland.xml" "flatland/scenes/bunny/bunny.svg" "flatland/scenes/reference_images/bunny_ref.svg" +check_flatland_scene_output "flatland/scenes/disk.ao.flatland.xml" "flatland/scenes/disk.ao.svg" "flatland/scenes/reference_images/disk.ao_ref.svg" +check_flatland_scene_output "flatland/scenes/disk.flatland.xml" "flatland/scenes/disk.svg" "flatland/scenes/reference_images/disk_ref.svg" +check_flatland_scene_output "flatland/scenes/disk_2.flatland.xml" "flatland/scenes/disk_2.svg" "flatland/scenes/reference_images/disk_2_ref.svg" +check_flatland_scene_output "flatland/scenes/disk_grid.flatland.xml" "flatland/scenes/disk_grid.svg" "flatland/scenes/reference_images/disk_grid_ref.svg" +check_flatland_scene_output "flatland/scenes/mirror.flatland.xml" "flatland/scenes/mirror.svg" "flatland/scenes/reference_images/mirror_ref.svg" +check_flatland_scene_output "flatland/scenes/mirrors.flatland.xml" "flatland/scenes/mirrors.svg" "flatland/scenes/reference_images/mirrors_ref.svg" +check_flatland_scene_output "flatland/scenes/rectangle.flatland.xml" "flatland/scenes/rectangle.svg" "flatland/scenes/reference_images/rectangle_ref.svg" +check_flatland_scene_output "flatland/scenes/rectangles.flatland.xml" "flatland/scenes/rectangles.svg" "flatland/scenes/reference_images/rectangles_ref.svg" +check_flatland_scene_output "flatland/scenes/gradient_refractive_index.flatland.xml" "flatland/scenes/gradient_refractive_index.svg" "flatland/scenes/reference_images/gradient_refractive_index_ref.svg" +check_flatland_scene_output "flatland/scenes/quadtree/quadtree_scene.flatland.xml" "flatland/scenes/quadtree/quadtree.svg" "flatland/scenes/reference_images/quadtree_ref.svg" +check_flatland_scene_output "flatland/scenes/quadtree/quadtree_corner_case_scene.flatland.xml" "flatland/scenes/quadtree/quadtree_corner_case.svg" "flatland/scenes/reference_images/quadtree_corner_case_ref.svg" \ No newline at end of file diff --git a/devertexwahn/flatland/tests/third_party/BUILD.bazel b/devertexwahn/flatland/tests/third_party/BUILD.bazel index 8214d56a..4ddd7e65 100644 --- a/devertexwahn/flatland/tests/third_party/BUILD.bazel +++ b/devertexwahn/flatland/tests/third_party/BUILD.bazel @@ -1,5 +1,5 @@ """ - SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann + SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann SPDX-License-Identifier: Apache-2.0 """ @@ -10,7 +10,7 @@ cc_test( "boost_algorithm_test.cpp", ], deps = [ - "@boost//:algorithm", + "@boost.algorithm//:algorithm", "@googletest//:gtest_main", ], ) @@ -22,7 +22,7 @@ cc_test( "boost_predef_test.cpp", ], deps = [ - "@boost//:predef", + "@boost.predef//:predef", "@googletest//:gtest_main", ], ) @@ -45,15 +45,24 @@ cc_test( srcs = [ "eigen_test.cpp", ], - copts = [ - "-Iexternal/eigen", - ], deps = [ "@eigen", "@googletest//:gtest_main", ], ) +cc_test( + name = "fmt_test", + size = "small", + srcs = [ + "fmt_test.cpp", + ], + deps = [ + "@fmt", + "@googletest//:gtest_main", + ], +) + cc_test( name = "pcg_test", size = "small", diff --git a/devertexwahn/flatland/tests/third_party/fmt_test.cpp b/devertexwahn/flatland/tests/third_party/fmt_test.cpp new file mode 100644 index 00000000..c0704c52 --- /dev/null +++ b/devertexwahn/flatland/tests/third_party/fmt_test.cpp @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: Copyright 2024 Julian Amann + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "fmt/core.h" + +#include "gmock/gmock.h" + +TEST(fmt, format) { + std::string filename{"some_file.xyz"}; + std::stringstream ss; + ss << "Loading file (" << filename << ") failed."; + + std::string s = fmt::format("Loading file ({}) failed.", filename); + + EXPECT_THAT(s, ss.str()); +} diff --git a/devertexwahn/imaging/image.h b/devertexwahn/imaging/image.h index b2e7a6a7..5a46bbaa 100644 --- a/devertexwahn/imaging/image.h +++ b/devertexwahn/imaging/image.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann + * SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann * SPDX-License-Identifier: Apache-2.0 */ @@ -7,9 +7,10 @@ #ifndef De_Vertexwahn_Imaging_Image_3a91bcbd_ae4d_4c36_83dd_c06ac570322b_h #define De_Vertexwahn_Imaging_Image_3a91bcbd_ae4d_4c36_83dd_c06ac570322b_h +#include "imaging/color.h" + #include "math/point.h" #include "math/vector.h" -#include "imaging/color.h" DE_VERTEXWAHN_BEGIN_NAMESPACE @@ -70,7 +71,7 @@ class Image { } } - Image& operator=(Image const& src) { + Image& operator=(const Image& src) { if(&src == this) { return *this; } @@ -96,7 +97,7 @@ class Image { delete[] data_; } - void resize(int width, int height) { + void resize(const int width, const int height) { if (data_) { delete[] data_; } @@ -160,14 +161,17 @@ class Image { } /* - The following layout is used: - +-----+-----+-----+ - |(0|2)|(1|2)|(2|2)| - +-----+-----+-----+ - |(0|1)|(1|1)|(2|1)| - +-----+-----+-----+ - |(0|0)|(1|0)|(2|0)| - +-----+-----+-----+ + The following layout/coordinate system is used: + y+ + /|\ + | +-----+-----+-----+ + | |(0|2)|(1|2)|(2|2)| + | +-----+-----+-----+ + | |(0|1)|(1|1)|(2|1)| + | +-----+-----+-----+ + | |(0|0)|(1|0)|(2|0)| + | +-----+-----+-----+ + +-------------------> x+ */ void set_pixel_standard_cartesian(const int x, const int y, const ColorType& color) { assert(check_bounds(x, y)); @@ -183,14 +187,17 @@ class Image { } /* - The following layout is used: - +-----+-----+-----+ - |(0|0)|(1|0)|(2|0)| - +-----+-----+-----+ - |(0|1)|(1|1)|(2|1)| - +-----+-----+-----+ - |(0|2)|(1|2)|(2|2)| - +-----+-----+-----+ + The following layout/coordinate system is used: + +-------------------> x+ + | +-----+-----+-----+ + | |(0|0)|(1|0)|(2|0)| + | +-----+-----+-----+ + | |(0|1)|(1|1)|(2|1)| + | +-----+-----+-----+ + | |(0|2)|(1|2)|(2|2)| + | +-----+-----+-----+ + v + y+ */ ColorType get_pixel(const int x, const int y) const { assert(check_bounds(x, y)); @@ -231,20 +238,25 @@ class Image { int height_ = 0; /* - The following layout is used: - +-----+-----+-----+ - |(0|0)|(1|0)|(2|0)| - +-----+-----+-----+ - |(0|1)|(1|1)|(2|1)| - +-----+-----+-----+ - |(0|2)|(1|2)|(2|2)| - +-----+-----+-----+ + The following layout/coordinate system is used: + +-------------------> x+ + | +-----+-----+-----+ + | |(0|0)|(1|0)|(2|0)| + | +-----+-----+-----+ + | |(0|1)|(1|1)|(2|1)| + | +-----+-----+-----+ + | |(0|2)|(1|2)|(2|2)| + | +-----+-----+-----+ + v + y+ */ ColorChannelType* data_ = nullptr; }; +using Image1b = Image; using Image3b = Image; using Image4b = Image; +using Image1f = Image; using Image3f = Image; using Image4f = Image; diff --git a/devertexwahn/imaging/io/io.cpp b/devertexwahn/imaging/io/io.cpp index 5644b178..41233196 100644 --- a/devertexwahn/imaging/io/io.cpp +++ b/devertexwahn/imaging/io/io.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann + * SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann * SPDX-License-Identifier: Apache-2.0 */ @@ -15,6 +15,12 @@ #include "boost/algorithm/string.hpp" +#include "fmt/core.h" +#include "fmt/format.h" + +#include +#include + DE_VERTEXWAHN_BEGIN_NAMESPACE void store_image(std::string_view filename, ReferenceCounted image) { @@ -69,7 +75,28 @@ void store_image(std::string_view filename, ReferenceCounted image) { store_image(filename, *image.get()); } +std::string extract_file_extension(std::string_view filename) { + size_t dot_pos = filename.rfind('.'); + + if (dot_pos == std::string::npos) + return ""; + + std::string extension = std::string(filename.substr(dot_pos)); + + return extension; +} + Image3f load_image(std::string_view filename) { + auto extension = extract_file_extension(filename); + + if(extension.empty()) { + throw std::runtime_error(fmt::format("A filename (\"{}\") has been provided without an extension.", filename)); + } + + if(!std::filesystem::exists(filename)) { + throw std::runtime_error(fmt::format("File \"{}\" does not exist.", filename)); + } + if (boost::ends_with(filename, ".exr")) { Image3f image = load_image_openexr(filename); return image; @@ -83,7 +110,7 @@ Image3f load_image(std::string_view filename) { return image; } - throw std::runtime_error("Invalid file extension"); + throw std::runtime_error(fmt::format("Unsupported file extension (\"{}\").", extract_file_extension(filename))); } // TODO: refactor this - make this available as "central service" diff --git a/devertexwahn/imaging/io/io_test.cpp b/devertexwahn/imaging/io/io_test.cpp index 54d82ac7..b5406eeb 100644 --- a/devertexwahn/imaging/io/io_test.cpp +++ b/devertexwahn/imaging/io/io_test.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann + * SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann * SPDX-License-Identifier: Apache-2.0 */ @@ -12,8 +12,54 @@ using namespace de_vertexwahn; +namespace de_vertexwahn { + std::string extract_file_extension(std::string_view filename); +} + +TEST(extract_file_extension, test) { + EXPECT_THAT(extract_file_extension("image.exr"), std::string(".exr")); + EXPECT_THAT(extract_file_extension("image.jepg"), std::string(".jepg")); + EXPECT_THAT(extract_file_extension("image.jpg"), std::string(".jpg")); + EXPECT_THAT(extract_file_extension("image.png"), std::string(".png")); + EXPECT_THAT(extract_file_extension("image"), std::string("")); + EXPECT_THAT(extract_file_extension("image.unsupported_extension"), std::string(".unsupported_extension")); +} + TEST(io, WhenTryToLoadANonExistingImage_ThenThrowException) { - EXPECT_THROW(load_image("muh.unknown_extension"), std::runtime_error); + EXPECT_THAT([]() { load_image("not_exsiting_image.exr"); }, + ::testing::ThrowsMessage("File \"not_exsiting_image.exr\" does not exist.")); +} + +TEST(io, WhenTryToLoadFileWithNotSupportedExtension_ThenThrowException) { + // Arrange + + // write a dummy file + std::ofstream file("image.unsupported_extension"); + EXPECT_TRUE(file.is_open()); + if(file.is_open()) { + file << "Dummy file for testing load_image.\n"; + file.close(); + } + + // Act & Assert + EXPECT_THAT([]() { load_image("image.unsupported_extension"); }, + ::testing::ThrowsMessage("Unsupported file extension (\".unsupported_extension\").")); +} + +TEST(io, WhenTryToLoadImageWithoutExtension_ThenThrowException) { + // Arrange + + // write a dummy file without extension + std::ofstream file("image"); + EXPECT_TRUE(file.is_open()); + if(file.is_open()) { + file << "Dummy file for testing load_image.\n"; + file.close(); + } + + // Act & Assert + EXPECT_THAT([]() { load_image("image"); }, + ::testing::ThrowsMessage("A filename (\"image\") has been provided without an extension.")); } TEST(io, WhenTryToStoreImageWithUnkownExtension_ThenThrowException) { diff --git a/devertexwahn/imaging/io/io_webp.cpp b/devertexwahn/imaging/io/io_webp.cpp index 9c91ef8c..5070918a 100644 --- a/devertexwahn/imaging/io/io_webp.cpp +++ b/devertexwahn/imaging/io/io_webp.cpp @@ -10,6 +10,7 @@ #include #include +#include DE_VERTEXWAHN_BEGIN_NAMESPACE diff --git a/devertexwahn/imaging/iqa/flip.cpp b/devertexwahn/imaging/iqa/flip.cpp deleted file mode 100644 index ea993fba..00000000 --- a/devertexwahn/imaging/iqa/flip.cpp +++ /dev/null @@ -1,1110 +0,0 @@ -// Derived from FLIP reference implementation: https://research.nvidia.com/sites/default/files/pubs/2020-07_FLIP/flip-cpp.zip - -/*************************************************************************** -# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of NVIDIA CORPORATION nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -***************************************************************************/ - -// FLIP: A Difference Evaluator for Alternating Images -// High Performance Graphics, 2020. -// by Pontus Andersson, Jim Nilsson, Tomas Akenine-Moller, Magnus Oskarsson, Kalle Astrom, and Mark D. Fairchild -// -// Pointer to our paper: https://research.nvidia.com/publication/2020-07_FLIP -// code by Pontus Andersson, Jim Nilsson, and Tomas Akenine-Moller - -// pooling.h - -#ifdef WIN32 -#define _USE_MATH_DEFINES -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -namespace flip_detail { - - class histogram - { - private: - double mMinValue, mMaxValue; - size_t mValueCount, mErrorValueCount; - double mBucketSize; - std::vector mvBuckets; - size_t mBucketIdRange[2]; - size_t mBucketIdMax; - - public: - histogram(size_t buckets, double minValue = 0.0, double maxValue = 1.0) - { - this->init(buckets, minValue, maxValue); - } - - void init(size_t buckets, double minValue, double maxValue, size_t value = 0) - { - this->mMinValue = minValue; - this->mMaxValue = maxValue; - this->mValueCount = 0; - this->mErrorValueCount = 0; - this->mBucketIdRange[0] = std::string::npos; - this->mBucketIdRange[1] = 0; - this->resize(buckets); - this->mvBuckets.resize(buckets, value); - } - - double getBucketSize() const { return mBucketSize; } - size_t getBucketIdMin() const { return mBucketIdRange[0]; } - size_t getBucketIdMax() const { return mBucketIdRange[1]; } - size_t getBucketValue(size_t bucketId) const { return mvBuckets[bucketId]; } - size_t size() const { return mvBuckets.size(); } - double getMinValue() const { return this->mMinValue; } - double getMaxValue() const { return this->mMaxValue; } - double getBucketStep() const { return (this->mMaxValue - this->mMinValue) / this->mvBuckets.size(); } - - void clear(size_t value = 0) - { - this->mvBuckets.resize(mvBuckets.size(), value); - } - - void resize(size_t buckets) - { - this->mBucketSize = (this->mMaxValue - this->mMinValue) / buckets; - this->mvBuckets.resize(buckets); - } - - size_t valueBucketId(double value) const - { - if (value < this->mMinValue || value > this->mMaxValue) - return std::string::npos; - - size_t bucketId = size_t(value / this->mBucketSize); - - if (bucketId == this->mvBuckets.size()) - { - bucketId--; - } - return bucketId; - } - - void inc(double value, size_t amount = 1) - { - size_t bucketId = valueBucketId(value); - if (bucketId != std::string::npos) - { - this->mvBuckets[bucketId] += amount; - this->mValueCount += amount; - this->mBucketIdRange[0] = std::min(this->mBucketIdRange[0], bucketId); - this->mBucketIdRange[1] = std::max(this->mBucketIdRange[1], bucketId); - } - else - { - mErrorValueCount += amount; - } - } - - std::string toPython(size_t numPixels, float ppd, double meanValue, double stddevValue, double maxValue, double minValue, double weightedMedian, double firstWeightedQuartile, double thirdWeightedQuartile, const bool optionLog) const - { - std::stringstream ss; - - double bucketStep = getBucketStep(); - - // imports - ss << "import matplotlib.pyplot as plt\n"; - ss << "import sys\n"; - ss << "import numpy as np\n"; - ss << "from matplotlib.ticker import (MultipleLocator)\n\n"; - - ss << "dimensions = (25, 15) # centimeters\n\n"; - - ss << "lineColor = 'blue'\n"; - ss << "fill_color = 'lightblue'\n"; - ss << "meanLineColor = 'gray'\n"; - ss << "stddevLineColor = 'orange'\n"; - ss << "weightedMedianLineColor = 'red'\n"; - ss << "quartileLineColor = 'purple'\n"; - ss << "cogLineColor = 'green'\n"; - ss << "fontSize = 14\n"; - ss << "numPixels = " << numPixels << "\n\n"; - - ss << "ppd = " << ppd << "\n"; - ss << "meanValue = " << meanValue << "\n"; - ss << "stddevValue = " << stddevValue << "\n"; - ss << "maxValue = " << maxValue << "\n"; - ss << "minValue = " << minValue << "\n\n"; - ss << "weightedMedianValue = " << weightedMedian << "\n\n"; - ss << "firstWeightedQuartileValue = " << firstWeightedQuartile << "\n\n"; - ss << "thirdWeightedQuartileValue = " << thirdWeightedQuartile << "\n\n"; - - // X-axis - ss << "dataX = ["; - for (size_t bucketId = 0; bucketId < this->mvBuckets.size(); bucketId++) - { - ss << (bucketId > 0 ? ", " : ""); - ss << bucketStep * bucketId + 0.5 * bucketStep; - } - ss << "]\n\n"; - - // FLIP histogram - ss << "dataFLIP = ["; - for (size_t bucketId = 0; bucketId < this->mvBuckets.size(); bucketId++) - { - ss << (bucketId > 0 ? ", " : ""); - ss << this->mvBuckets[bucketId]; - } - ss << "]\n\n"; - - // Weighted FLIP histogram - ss << "bucketStep = " << bucketStep << "\n"; - ss << "weightedDataFLIP = np.empty(" << this->mvBuckets.size() << ")\n"; - ss << "moments = np.empty(" << this->mvBuckets.size() << ")\n"; - ss << "for i in range(" << this->mvBuckets.size() << ") :\n"; - ss << "\tweight = (i + 0.5) * bucketStep\n"; - ss << "\tweightedDataFLIP[i] = dataFLIP[i] * weight\n"; - ss << "\tmoments[i] = dataFLIP[i] * weight * weight\n"; - ss << "cog = sum(moments) / sum(weightedDataFLIP)\n"; - ss << "weightedDataFLIP /= (numPixels /(1024 * 1024)) # normalized with the number of megapixels in the image\n\n"; - if (optionLog) - { - ss << "for i in range(" << this->mvBuckets.size() << ") :\n"; - ss << "\tif weightedDataFLIP[i] > 0 :\n"; - ss << "\t\tweightedDataFLIP[i] = np.log10(weightedDataFLIP[i]) # avoid log of zero\n\n"; - } - - ss << "maxY = max(weightedDataFLIP)\n\n"; - - ss << "sumWeightedDataFLIP = sum(weightedDataFLIP)\n\n"; - - ss << "font = { 'family' : 'serif', 'style' : 'normal', 'weight' : 'normal', 'size' : fontSize }\n"; - ss << "lineHeight = fontSize / (dimensions[1] * 15)\n"; - ss << "plt.rc('font', **font)\n"; - ss << "fig = plt.figure()\n"; - ss << "axes = plt.axes()\n"; - ss << "axes.xaxis.set_minor_locator(MultipleLocator(0.1))\n"; - ss << "axes.xaxis.set_major_locator(MultipleLocator(0.2))\n\n"; - - ss << "fig.set_size_inches(dimensions[0] / 2.54, dimensions[1] / 2.54)\n"; - - if(optionLog) - ss << "axes.set(title = 'Weighted \\uA7FBLIP Histogram', xlabel = '\\uA7FBLIP error', ylabel = 'log(weighted \\uA7FBLIP sum per megapixel)')\n\n"; - else - ss << "axes.set(title = 'Weighted \\uA7FBLIP Histogram', xlabel = '\\uA7FBLIP error', ylabel = 'Weighted \\uA7FBLIP sum per megapixel')\n\n"; - - ss << "plt.bar(dataX, weightedDataFLIP, width = " << bucketStep << ", color = fill_color, edgeColor = lineColor, lineWidth = 0.3)\n\n"; - - ss << "plt.text(0.99, 1.0 - 1 * lineHeight, 'PPD: ' + str(f'{ppd:.1f}'), ha = 'right', fontsize = fontSize, transform = axes.transAxes, color='black')\n\n"; - ss << "plt.text(0.99, 1.0 - 2 * lineHeight, 'Weighted median: ' + str(f'{weightedMedianValue:.4f}'), ha = 'right', fontsize = fontSize, transform = axes.transAxes, color=weightedMedianLineColor)\n\n"; - ss << "plt.text(0.99, 1.0 - 3 * lineHeight, 'Mean: ' + str(f'{meanValue:.4f}'), ha = 'right', fontsize = fontSize, transform = axes.transAxes, color=meanLineColor)\n\n"; - ss << "plt.text(0.99, 1.0 - 4 * lineHeight, '1st weighted quartile: ' + str(f'{firstWeightedQuartileValue:.4f}'), ha = 'right', fontsize = fontSize, transform = axes.transAxes, color=quartileLineColor)\n\n"; - ss << "plt.text(0.99, 1.0 - 5 * lineHeight, '3rd weighted quartile: ' + str(f'{thirdWeightedQuartileValue:.4f}'), ha = 'right', fontsize = fontSize, transform = axes.transAxes, color=quartileLineColor)\n\n"; - ss << "plt.text(0.99, 1.0 - 6 * lineHeight, 'Min: ' + str(f'{minValue:.4f}'), ha = 'right', fontsize = fontSize, transform = axes.transAxes)\n"; - ss << "plt.text(0.99, 1.0 - 7 * lineHeight, 'Max: ' + str(f'{maxValue:.4f}'), ha = 'right', fontsize = fontSize, transform = axes.transAxes)\n"; - - ss << "axes.set_xlim(0.0, 1.0)\n"; - ss << "axes.set_ylim(0.0, maxY * 1.05)\n"; - ss << "axes.axvline(x = meanValue, color = meanLineColor, linewidth = 1.5)\n\n"; - ss << "axes.axvline(x = weightedMedianValue, color = weightedMedianLineColor, linewidth = 1.5)\n\n"; - ss << "axes.axvline(x = firstWeightedQuartileValue, color = quartileLineColor, linewidth = 1.5)\n\n"; - ss << "axes.axvline(x = thirdWeightedQuartileValue, color = quartileLineColor, linewidth = 1.5)\n\n"; - ss << "axes.axvline(x = minValue, color='black', linestyle = ':', linewidth = 1.5)\n\n"; - ss << "axes.axvline(x = maxValue, color='black', linestyle = ':', linewidth = 1.5)\n\n"; - - ss << "if len(sys.argv) > 1:\n"; - ss << "\tif sys.argv[1] == '-save':\n"; - ss << "\t\tplt.savefig(sys.argv[2])\n"; - ss << "else:\n"; - ss << "\tplt.show()\n"; - - ss << std::endl; - - return ss.str(); - } - }; - - class pooling - { - private: - size_t mValueCount; - double mValueSum; - double mSquareValueSum; - double mMinValue; - double mMaxValue; - double mVarianceBias = 0.0; - uint32_t mMinCoord[2]; - uint32_t mMaxCoord[2]; - histogram mHistogram = histogram(100); - public: - pooling() { clear(); } - pooling(size_t buckets, double varianceBias = 0.0) : mVarianceBias(varianceBias) { mHistogram.resize(buckets); clear(); } - - histogram& getHistogram() { return mHistogram; } - double getMinValue() const { return mMinValue; } - double getMaxValue() const { return mMaxValue; } - double getMean() const { return mValueSum / mValueCount; } - double getVariance() const - { - bool isSampled = false; - double variance = (mSquareValueSum - ((mValueSum * mValueSum) / mValueCount)) / (mValueCount - (isSampled ? 1 : 0)); - variance = std::max(0.0, variance); // negative not allowed, but can happen due to precision issues - return variance; - } - - double getStdDev(void) const { return std::sqrt(this->getVariance()); } - - double getCenterOfGravity(void) const - { - double bucketStep = mHistogram.getBucketStep(); - double sumMoments = 0.0; - double sumWeightedDataValue = 0.0; - for (size_t bucketId = 0; bucketId < mHistogram.size(); bucketId++) - { - double weight = (bucketId + 0.5) * bucketStep; - double weightedValue = mHistogram.getBucketValue(bucketId) * weight; - sumWeightedDataValue += weightedValue; - sumMoments += weightedValue * weight; - } - double cog = sumMoments / sumWeightedDataValue; - return cog; - } - - double getWeightedPercentile(const double percent) const // percent = 0.5 gives you the weighted median. This function is approximative, since we do not have all the values. We find the bucket where the weighted median is located, and interpolate in there. - { - double weight; - double weightedValue; - double bucketStep = mHistogram.getBucketStep(); - double sumWeightedDataValue = 0.0; - for (size_t bucketId = 0; bucketId < mHistogram.size(); bucketId++) - { - weight = (bucketId + 0.5) * bucketStep; - weightedValue = mHistogram.getBucketValue(bucketId) * weight; - sumWeightedDataValue += weightedValue; - } - - double sum = 0; - size_t weightedMedianIndex = 0; - for (size_t bucketId = 0; bucketId < mHistogram.size(); bucketId++) - { - weight = (bucketId + 0.5) * bucketStep; - weightedValue = mHistogram.getBucketValue(bucketId) * weight; - weightedMedianIndex = bucketId; - if (sum + weightedValue > percent * sumWeightedDataValue) - break; - sum += weightedValue; - } - - weight = (weightedMedianIndex + 0.5) * bucketStep; - weightedValue = mHistogram.getBucketValue(weightedMedianIndex) * weight; - double discrepancy = percent * sumWeightedDataValue - sum; - double linearWeight = discrepancy / weightedValue; // in [0,1] - double percentile = (weightedMedianIndex + linearWeight) * bucketStep; - return percentile; - } - - double getPercentile(const double percent, size_t numCounts) const // percent = 0.5 gives you the median. This function is approximative, since we do not have all the values. We find the bucket where the median is located and returns its weight. - { - size_t sum = 0; - size_t medianIndex = 0; - for (size_t bucketId = 0; bucketId < mHistogram.size(); bucketId++) - { - size_t count = mHistogram.getBucketValue(bucketId); - medianIndex = bucketId; - if (sum + count > size_t(percent * numCounts)) - break; - sum += count; - } - double bucketStep = mHistogram.getBucketStep(); - double percentile = (medianIndex + 0.5) * bucketStep; - return percentile; - } - - void clear() - { - mValueCount = 0; - mValueSum = 0.0; - mSquareValueSum = 0.0; - mMinValue = std::numeric_limits::max(); - mMaxValue = std::numeric_limits::min(); - mHistogram.clear(); - } - - void update(uint32_t xcoord, uint32_t ycoord, double value) - { - mValueCount++; - mValueSum += value; - mSquareValueSum += (value * value); - mHistogram.inc(value); - - if (value < mMinValue) - { - mMinValue = value; - mMinCoord[0] = xcoord; - mMinCoord[1] = ycoord; - } - - if (value > mMaxValue) - { - mMaxValue = value; - mMaxCoord[0] = xcoord; - mMaxCoord[1] = ycoord; - } - } - - std::string toString(bool verbose = false) - { - std::stringstream s; - if (verbose) - { - s << std::fixed << std::setprecision(5) << "Mean = " << this->getMean() << ", Weighted median = " << this->getWeightedPercentile(0.5) << ", 1st weighted quartile = " << this->getWeightedPercentile(0.25) << ", 3rd weighted quartile = " << this->getWeightedPercentile(0.75) << ", Min value = " << mMinValue << " @ (" << mMinCoord[0] << "," << mMinCoord[1] << "), Max value = " << mMaxValue << " @ (" << mMaxCoord[0] << ", " << mMaxCoord[1] << ")\n"; - } - else - { - s << "Mean ; Weighted median ; 1st weighted quartile; 3rd weighted quartile ; Min value ; MinPosX; MinPosY; Max value; MaxPosX; MaxPosY\n"; - s << std::fixed << std::setprecision(5) << this->getMean() << ";" << this->getWeightedPercentile(0.5) << ";" << this->getWeightedPercentile(0.25) << ";" << this->getWeightedPercentile(0.75) << ";" << mMinValue << ";" << mMinCoord[0] << ";" << mMinCoord[1] << ";" << mMaxValue << ";" << mMaxCoord[0] << ";" << mMaxCoord[1] << "\n"; - } - return s.str(); - } - - void save(const std::string fileName, float ppd, int imgWidth, int imgHeight, const bool verbose, const bool optionLog, const std::string referenceFileName, const std::string testFileName) - { - std::ofstream file; - if (verbose) - { - std::cout << "Writing metric histogram to file <" << fileName << ".csv> and <" << fileName << ".py> with image resolution: " << imgWidth << "x" << imgHeight << "\n"; - } - - file.open(fileName + ".csv"); - file << "# FLIP pooling statistics for <" << referenceFileName << "> vs. <" << testFileName << ">\n"; - - file << this->toString(false); - - file << "# histogram\n"; - file << "Min bucket" << ";" << "Max bucket" << "\n"; - file << mHistogram.getBucketIdMin() << ";" << mHistogram.getBucketIdMax() << "\n"; - file << "Bucket no; "; - for (size_t bucketId = 0; bucketId < mHistogram.size(); bucketId++) - { - file << bucketId << ";"; - } - file << "\n"; - - if (verbose) - { - std::cout << this->toString(true); - std::cout << "# Histogram bucket size = " << mHistogram.getBucketSize() << ", range = [" << mHistogram.getBucketIdMin() << ", " << mHistogram.getBucketIdMax() << "]\n"; - std::cout << "Non-weighted bucket counts:\n"; - } - - size_t area = size_t(imgWidth) * size_t(imgHeight); - - file << "Count; "; - for (size_t bucketId = 0; bucketId < mHistogram.size(); bucketId++) - { - size_t histogramValue = mHistogram.getBucketValue(bucketId); - if (verbose) - { - std::cout << bucketId << ": " << histogramValue << "\n"; - } - file << float(histogramValue) << ";"; - } - file << "\n"; - - file << "Weight; "; - double bucketStep = mHistogram.getBucketStep(); - for (size_t bucketId = 0; bucketId < mHistogram.size(); bucketId++) - { - file << (0.5 + bucketId) * bucketStep << ";"; - } - file << "\n"; - - file << "Weighted bucket count per megapixel; "; - double megaPixelWeight = 1024.0 * 1024.0 / double(area); - for (size_t bucketId = 0; bucketId < mHistogram.size(); bucketId++) - { - file << ((0.5 + bucketId) * bucketStep * mHistogram.getBucketValue(bucketId) * megaPixelWeight) << ";"; - } - file << "\n"; - - // python output - std::ofstream pythonHistogramFile; - pythonHistogramFile.open(fileName + ".py"); - pythonHistogramFile << mHistogram.toPython(area, ppd, getMean(), getStdDev(), getMaxValue(), getMinValue(), getWeightedPercentile(0.5), getWeightedPercentile(0.25), getWeightedPercentile(0.75), optionLog); - pythonHistogramFile.close(); - } - }; - -} // namespace flip_detail - -// flip.cpp - -#include - -namespace flip_detail { - - float gPPD; - float gMonitorDistance = 0.7f; - float gMonitorWidth = 0.7f; - float gMonitorResolutionX = 3840.0f; - const float gqc = 0.7f; - const float gpc = 0.4f; - const float gpt = 0.95f; - const float gw = 0.082f; - const float gqf = 0.5f; - -// Pixels per degree (PPD) - static float calculatePPD(const float dist, const float resolutionX, const float monitorWidth) - { - return dist * (resolutionX / monitorWidth) * ( float(M_PI) / 180.0f ); - } - - class color3 - { - public: - color3() { x = 0.0f; y = 0.0f; z = 0.0f; } - color3(const float _x, const float _y, const float _z) { x = _x; y = _y; z = _z; } - color3& abs() { x = fabsf(x); y = fabsf(y); z = fabsf(z); return *this; } - color3& max(const float value) { x = std::max(x, value); y = std::max(y, value); z = std::max(z, value); return *this; } - color3& min(const float value) { x = std::min(x, value); y = std::min(y, value); z = std::min(z, value); return *this; } - color3& min(const color3& value) { x = std::min(x, value.x); y = std::min(y, value.y); z = std::min(z, value.z); return *this; } - color3& sRGB2LinearRGB(); - color3& LinearRGB2sRGB(); - color3& LinearRGB2XYZ(); - color3& XYZ2LinearRGB(); - color3& XYZ2YCxCz(const color3 reference_illuminant = color3(0.950428545377181f, 1.0f, 1.088900370798128f)); // the default illuminant is D65 - color3& YCxCz2XYZ(const color3 reference_illuminant = color3(0.950428545377181f, 1.0f, 1.088900370798128f)); // the default illuminant is D65 - color3& XYZ2CIELab(const color3 reference_illuminant = color3(0.950428545377181f, 1.0f, 1.088900370798128f)); // the default illuminant is D65 - color3& CIELab2XYZ(const color3 reference_illuminant = color3(0.950428545377181f, 1.0f, 1.088900370798128f)); // the default illuminant is D65 - public: - float x, y, z; - }; - - static float sRGB2Linear(float sRGBColor) - { - if (sRGBColor <= 0.04045f) - return sRGBColor / 12.92f; - else - return powf((sRGBColor + 0.055f) / 1.055f, 2.4f); - } - - static float Linear2sRGB(float linearColor) - { - if (linearColor <= 0.0031308f) - return linearColor * 12.92f; - else - return 1.055f * powf(linearColor, 1.0f / 2.4f) - 0.055f; - } - - color3& color3::sRGB2LinearRGB() - { - x = sRGB2Linear(x); - y = sRGB2Linear(y); - z = sRGB2Linear(z); - return *this; - } - - color3& color3::LinearRGB2sRGB() - { - x = Linear2sRGB(x); - y = Linear2sRGB(y); - z = Linear2sRGB(z); - return *this; - } - - color3& color3::LinearRGB2XYZ() // Source: https://www.image-engineering.de/library/technotes/958-how-to-convert-between-srgb-and-ciexyz - { // Assumes D65 standard illuminant - const float a11 = 10135552.0f / 24577794.0f; - const float a12 = 8788810.0f / 24577794.0f; - const float a13 = 4435075.0f / 24577794.0f; - const float a21 = 2613072.0f / 12288897.0f; - const float a22 = 8788810.0f / 12288897.0f; - const float a23 = 887015.0f / 12288897.0f; - const float a31 = 1425312.0f / 73733382.0f; - const float a32 = 8788810.0f / 73733382.0f; - const float a33 = 70074185.0f / 73733382.0f; - color3 v = *this; - x = a11 * v.x + a12 * v.y + a13 * v.z; - y = a21 * v.x + a22 * v.y + a23 * v.z; - z = a31 * v.x + a32 * v.y + a33 * v.z; - return *this; - } - - color3& color3::XYZ2LinearRGB() // Return values in linear RGB, assuming D65 standard illuminant - { - const float a11 = 3.241003232976358f; - const float a12 = -1.537398969488785f; - const float a13 = -0.498615881996363f; - const float a21 = -0.969224252202516f; - const float a22 = 1.875929983695176f; - const float a23 = 0.041554226340085f; - const float a31 = 0.055639419851975f; - const float a32 = -0.204011206123910f; - const float a33 = 1.057148977187533f; - color3 v = *this; - x = a11 * v.x + a12 * v.y + a13 * v.z; - y = a21 * v.x + a22 * v.y + a23 * v.z; - z = a31 * v.x + a32 * v.y + a33 * v.z; - return *this; - } - - color3& color3::XYZ2YCxCz(const color3 reference_illuminant) // the default illuminant is D65 - { - color3 xyz = *this; - xyz.x /= reference_illuminant.x; - xyz.y /= reference_illuminant.y; - xyz.z /= reference_illuminant.z; - const float Y = 116.0f * xyz.y - 16.0f; - const float Cx = 500.0f * (xyz.x - xyz.y); - const float Cz = 200.0f * (xyz.y - xyz.z); - x = Y; - y = Cx; - z = Cz; - return *this; - } - - color3& color3::YCxCz2XYZ(const color3 reference_illuminant) // the default illuminant is D65 - { - color3 YCxCz = *this; - const float Yy = (YCxCz.x + 16.0f) / 116.0f; - const float Cx = YCxCz.y / 500.0f; - const float Cz = YCxCz.z / 200.0f; - x = Yy + Cx; - y = Yy; - z = Yy - Cz; - x *= reference_illuminant.x; - y *= reference_illuminant.y; - z *= reference_illuminant.z; - return *this; - } - - color3& color3::XYZ2CIELab(const color3 reference_illuminant) // the default illuminant is D65 - { - color3 xyz = *this; - xyz.abs(); - xyz.x /= reference_illuminant.x; - xyz.y /= reference_illuminant.y; - xyz.z /= reference_illuminant.z; - xyz.x = xyz.x > 0.008856 ? powf(xyz.x, 1.0f / 3.0f) : 7.787f * xyz.x + 16.0f / 116.0f; - xyz.y = xyz.y > 0.008856 ? powf(xyz.y, 1.0f / 3.0f) : 7.787f * xyz.y + 16.0f / 116.0f; - xyz.z = xyz.z > 0.008856 ? powf(xyz.z, 1.0f / 3.0f) : 7.787f * xyz.z + 16.0f / 116.0f; - x = 116.0f * xyz.y - 16.0f; - y = 500.0f * (xyz.x - xyz.y); - z = 200.0f * (xyz.y - xyz.z); - return *this; - } - - color3& color3::CIELab2XYZ(const color3 reference_illuminant) // the default illuminant is D65 - { - color3 LAB = *this; - float Y = (LAB.x + 16.0f) / 116.0f; - float X = LAB.y / 500.0f + Y; - float Z = Y - LAB.z / 200.0f; - X = ((X > 0.206897) ? X * X * X : (X - 16.0f / 116.0f) / 7.787f); - Y = ((Y > 0.206897) ? Y * Y * Y : (Y - 16.0f / 116.0f) / 7.787f); - Z = ((Z > 0.206897) ? Z * Z * Z : (Z - 16.0f / 116.0f) / 7.787f); - x = X * reference_illuminant.x; - y = Y * reference_illuminant.y; - z = Z * reference_illuminant.z; - return *this; - } - - static float HyAB(color3& refPixel, color3& testPixel) - { - float cityBlockDistanceL = fabsf(refPixel.x - testPixel.x); - float euclideanDistanceAB = sqrtf((refPixel.y - testPixel.y) * (refPixel.y - testPixel.y) + (refPixel.z - testPixel.z) * (refPixel.z - testPixel.z)); - return cityBlockDistanceL + euclideanDistanceAB; - } - - static float Gaussian(const float x, const float y, const float sigma) - { - return expf(-(x * x + y * y) / (2.0f * sigma * sigma)); - } - - class image - { - public: - image() { mWidth = 0; mHeight = 0; } - image(const int width, const int height) { allocate(width, height); } - void allocate(const int width, const int height) { mWidth = width; mHeight = height; mPixels.resize(mWidth * mHeight, color3(0.0f, 0.0f, 0.0f)); } - void preprocess(image& filter); - void convolve(image& unfilteredImage, image& filter); - void huntAdjustment(); - void generateSpatialFilter(const float ppd); - void generateDetectionFilters(const float ppd, const bool pointDetector); - color3& get(const int x, const int y) { return mPixels[y * mWidth + x]; } - void set(const int x, const int y, const color3& color) { mPixels[y * mWidth + x] = color; } - void computeColorDifference(image& preprocessedReference, image& preprocessedTest); - void computeFeatureDifference(image& refImage, image& testImage, const float ppd); - void computeFLIPError(image& testImage, image& refImage, bool verbose); - void remapToMagma(); - public: - int mWidth = 0; - int mHeight = 0; - std::vector mPixels; - }; - - static float GaussSum(const float x2, const float a1, const float b1, const float a2, const float b2) - { - const float pi = float(M_PI); - const float pi_sq = float(M_PI * M_PI); - return a1 * sqrtf(pi / b1) * expf(-pi_sq * x2 / b1) + a2 * sqrtf(pi / b2) * expf(-pi_sq * x2 / b2); - } - - void image::generateSpatialFilter(const float ppd) - { - const float deltaX = 1.0f / ppd; - const float pi_sq = float(M_PI * M_PI); - // constants for Gaussians -- see paper for details. - color3 a1 = {1.0f, 1.0f, 34.1f}; - color3 b1 = {0.0047f, 0.0053f, 0.04f }; - color3 a2 = { 0.0f, 0.0f, 13.5f }; - color3 b2 = { 1.0e-5f, 1.0e-5f, 0.025f }; - - float maxScaleParameter = std::max(std::max(std::max(b1.x, b1.y), std::max(b1.z, b2.x)), std::max(b2.y, b2.z)); - int radius = int(std::ceil(3.0f * sqrtf(maxScaleParameter / (2.0f * pi_sq)) * ppd)); // Set radius based on largest scale parameter - - int width = 2 * radius + 1; - allocate(width, width); - - color3 filterSum = { 0.0f, 0.0f, 0.0f }; - for (int y = 0; y < width; y++) - { - float iy = (y - radius) * deltaX; - for (int x = 0; x < width; x++) - { - float ix = (x - radius) * deltaX; - - float dist2 = ix * ix + iy * iy; - color3 value = color3(GaussSum(dist2, a1.x, b1.x, a2.x, b2.x), GaussSum(dist2, a1.y, b1.y, a2.y, b2.y), GaussSum(dist2, a1.z, b1.z, a2.z, b2.z)); - this->set(x, y, value); - filterSum = color3(filterSum.x + value.x, filterSum.y + value.y, filterSum.z + value.z); - } - } - - // normalize weights - for (int y = 0; y < width; y++) - { - for (int x = 0; x < width; x++) - { - color3 value = this->get(x, y); - this->set(x, y, color3(value.x / filterSum.x, value.y / filterSum.y, value.z / filterSum.z)); - } - } - } - - void image::convolve(image& unfilteredImage, image& filter) // assumes a filter whose weights sum to one, and we use "replicate" for borders, i.e., clamp to borders - { - assert(filter.mWidth % 2 == 1 && filter.mHeight % 2 == 1); // need to have odd-sized filter - const int halfFilterWidth = filter.mWidth / 2; - const int halfFilterHeight = filter.mHeight / 2; - - // apply filter - for (int y = 0; y < mHeight; y++) - { - for (int x = 0; x < mWidth; x++) - { - color3 colorSum = color3(0.0f, 0.0f, 0.0f); - - // filter with the kernel - for (int iy = -halfFilterHeight; iy <= halfFilterHeight; iy++) - { - int yy = std::min(std::max(0, y + iy), mHeight - 1); - for (int ix = -halfFilterWidth; ix <= halfFilterWidth; ix++) - { - int xx = std::min(std::max(0, x + ix), mWidth - 1); - // read from unfilteredImage and sum into colorSum and weightSum - const color3 weights = filter.get(ix + halfFilterWidth, iy + halfFilterHeight); - color3 srcColor = unfilteredImage.get(xx, yy); - colorSum = color3(colorSum.x + weights.x * srcColor.x, colorSum.y + weights.y * srcColor.y, colorSum.z + weights.z * srcColor.z); - } - } - this->set(x, y, color3(colorSum.x, colorSum.y, colorSum.z)); // compute final filtered value (and store in mPixels) - } - } - } - - static float Hunt(const float luminance, const float chrominance) - { - return 0.01f * luminance * chrominance; - } - - void image::huntAdjustment() - { - for (auto& pixel : mPixels) - { - pixel.y = Hunt(pixel.x, pixel.y); - pixel.z = Hunt(pixel.x, pixel.z); - } - } - - void image::preprocess(image& filter) // implements spatial filter and Hunt adjustment - { - // convolve with CSF filters - image inputImage = *this; // copy the input image - this->convolve(inputImage, filter); - - // the result after the spatial filter is in YCxCz. Clamp and transform this->mPixels to L*a*b - for (auto& pixel : this->mPixels) - pixel.YCxCz2XYZ().XYZ2LinearRGB().min(1.0f).max(0.0f).LinearRGB2XYZ().XYZ2CIELab(); - - huntAdjustment(); - } - - static float computemax_distance() - { - color3 greenLab = color3(0.0f, 1.0f, 0.0f); // in RGB to start with - color3 blueLab = color3(0.0f, 0.0f, 1.0f); - greenLab.LinearRGB2XYZ().XYZ2CIELab(); // now in Lab - blueLab.LinearRGB2XYZ().XYZ2CIELab(); - color3 greenLabHunt = color3(greenLab.x, Hunt(greenLab.x, greenLab.y), Hunt(greenLab.x, greenLab.z)); - color3 blueLabHunt = color3(blueLab.x, Hunt(blueLab.x, blueLab.y), Hunt(blueLab.x, blueLab.z)); - - return powf(HyAB(greenLabHunt, blueLabHunt), gqc); - } - - void image::computeColorDifference(image& preprocessedReference, image& preprocessedTest) - { - this->allocate(preprocessedReference.mWidth, preprocessedReference.mHeight); - - const float cmax = computemax_distance(); - const float pccmax = gpc * cmax; - - // compute difference in HyAB and redistribute errors - for (int y = 0; y < this->mHeight; y++) - { - for (int x = 0; x < this->mWidth; x++) - { - // compute difference in HyAB - color3 refPixel = preprocessedReference.get(x, y); - color3 testPixel = preprocessedTest.get(x, y); - float error = HyAB(refPixel, testPixel); - - error = powf(error, gqc); - - // Re-map error to the [0, 1] range. Values between 0 and pccmax are mapped to the range [0, gpt], - // while the rest are mapped to the range (gpt, 1] - if (error < pccmax) - { - error *= gpt / pccmax; - } - else - { - error = gpt + ((error - pccmax) / (cmax - pccmax)) * (1.0f - gpt); - } - - this->set(x, y, color3(error, 0.0f, 0.0f)); - } - } - } - - void image::generateDetectionFilters(const float ppd, const bool pointDetector) - { - const float stdDev = 0.5f * gw * ppd; - const int radius = int(std::ceil(3.0f * stdDev)); - const int width = 2 * radius + 1; - - this->allocate(width, width); - - float weightX, weightY; - float negativeWeightsSumX = 0.0f; - float positiveWeightsSumX = 0.0f; - float negativeWeightsSumY = 0.0f; - float positiveWeightsSumY = 0.0f; - - for (int y = 0; y < width; y++) - { - int yy = y - radius; - for (int x = 0; x < width; x++) - { - int xx = x - radius; - float G = Gaussian(float(xx), float(yy), stdDev); - if (pointDetector) - { - weightX = (float(xx) * float(xx) / (stdDev * stdDev) - 1.0f) * G; - weightY = (float(yy) * float(yy) / (stdDev * stdDev) - 1.0f) * G; - } - else - { - weightX = -float(xx) * G; - weightY = -float(yy) * G; - } - this->set(x, y, color3(weightX, weightY, 0.0f)); - - if (weightX > 0.0f) - positiveWeightsSumX += weightX; - else - negativeWeightsSumX += -weightX; - - if (weightY > 0.0f) - positiveWeightsSumY += weightY; - else - negativeWeightsSumY += -weightY; - } - } - - // Normalize positive weights to sum to 1 and negative weights to sum to -1 - for (int y = 0; y < width; y++) - { - for (int x = 0; x < width; x++) - { - color3 p = this->get(x, y); - - this->set(x, y, color3(p.x / (p.x > 0.0f ? positiveWeightsSumX : negativeWeightsSumX), p.y / (p.y > 0.0f ? positiveWeightsSumY : negativeWeightsSumY), 0.0f)); - } - } - } - - void image::computeFeatureDifference(image& refImage, image& testImage, const float ppd) - { - this->allocate(refImage.mWidth, testImage.mHeight); - - // make copy of ref and test images and extract and normalize achromatic component - image refGray = refImage; - image testGray = testImage; - for (auto& pixel : refGray.mPixels) - { - float c = (pixel.x + 16.0f) / 116.0f; // make it [0,1] - pixel = color3(c, c, 0.0f); // luminance [0,1] stored in both x and y since we apply both horizontal and verticals filters at the same time - } - - for (auto& pixel : testGray.mPixels) - { - float c = (pixel.x + 16.0f) / 116.0f; // make it [0,1] - pixel = color3(c, c, 0.0f); // luminance [0,1] stored in both x and y since we apply both horizontal and verticals filters at the same time - } - - image edgesReference(this->mWidth, this->mHeight); - image pointsReference(this->mWidth, this->mHeight); - image edgesTest(this->mWidth, this->mHeight); - image pointsTest(this->mWidth, this->mHeight); - - image edgeFilters; - image pointFilters; - edgeFilters.generateDetectionFilters(ppd, false); // contains both horiontal and vertical filter - pointFilters.generateDetectionFilters(ppd, true); // contains both horiontal and vertical filter - - edgesReference.convolve(refGray, edgeFilters); - edgesTest.convolve(testGray, edgeFilters); - pointsReference.convolve(refGray, pointFilters); - pointsTest.convolve(testGray, pointFilters); - - const float normalizationFactor = 1.0f / sqrtf(2.0f); - color3 p; - for (int y = 0; y < this->mHeight; y++) - { - for (int x = 0; x < this->mWidth; x++) - { - p = edgesReference.get(x, y); - const float edgeValueRef = sqrtf(p.x * p.x + p.y * p.y); - p = edgesTest.get(x, y); - const float edgeValueTest = sqrtf(p.x * p.x + p.y * p.y); - p = pointsReference.get(x, y); - const float pointValueRef = sqrtf(p.x * p.x + p.y * p.y); - p = pointsTest.get(x, y); - const float pointValueTest = sqrtf(p.x * p.x + p.y * p.y); - - const float edgeDifference = std::abs(edgeValueRef - edgeValueTest); - const float pointDifference = std::abs(pointValueRef - pointValueTest); - - const float featureDifference = std::pow(normalizationFactor * std::max(edgeDifference, pointDifference), gqf); - - this->set(x, y, color3(featureDifference, 0.0f, 0.0f)); - } - } - } - - void image::computeFLIPError(image& refImage, image& testImage, bool verbose) - { - // Transform refImage and testImage to YCxCz opponent space - for (auto& pixel : refImage.mPixels) - { - pixel.sRGB2LinearRGB().LinearRGB2XYZ().XYZ2YCxCz(); - } - for (auto& pixel : testImage.mPixels) - { - pixel.sRGB2LinearRGB().LinearRGB2XYZ().XYZ2YCxCz(); - } - - // Color pipeline - // Preprocess images - image preprocessedReference = refImage; - image preprocessedTest = testImage; - image filter; - filter.generateSpatialFilter(gPPD); - if (verbose) std::cout << "Preprocessing reference image..." << std::flush; - preprocessedReference.preprocess(filter); - if (verbose) std::cout << "ok.\nPreprocessing test image..." << std::flush; - preprocessedTest.preprocess(filter); - if (verbose) std::cout << "ok.\nComputing error map..." << std::flush; - // Compute color difference - image colorDifference; - colorDifference.computeColorDifference(preprocessedReference, preprocessedTest); - - // Feature pipeline - image featureDifference; - featureDifference.computeFeatureDifference(refImage, testImage, gPPD); - - // Final error - this->allocate(colorDifference.mWidth, colorDifference.mHeight); - for (int y = 0; y < this->mHeight; y++) - { - for (int x = 0; x < this->mWidth; x++) - { - const float cdiff = colorDifference.get(x, y).x; - const float fdiff = featureDifference.get(x, y).x; - const float errorFLIP = std::pow(cdiff, 1.0f - fdiff); - this->set(x, y, color3(errorFLIP, errorFLIP, errorFLIP)); - } - } - } - -//pooling& handlePooling(image& img, float ppd, const std::string fileName, const bool verbose, const bool optionLog, const std::string referenceFileName, const std::string testFileName) - void handlePooling(image& image, pooling& pooling) - { - // add all FLIP values in the error map to pooling - for (int y = 0; y < image.mHeight; y++) - { - for (int x = 0; x < image.mWidth; x++) - { - float value = image.get(x, y).x; - pooling.update(x, y, value); - } - } - } - - static const color3 magmaMap[256] = { - {0.001462f, 0.000466f, 0.013866f}, {0.002258f, 0.001295f, 0.018331f}, {0.003279f, 0.002305f, 0.023708f}, {0.004512f, 0.003490f, 0.029965f}, - {0.005950f, 0.004843f, 0.037130f}, {0.007588f, 0.006356f, 0.044973f}, {0.009426f, 0.008022f, 0.052844f}, {0.011465f, 0.009828f, 0.060750f}, - {0.013708f, 0.011771f, 0.068667f}, {0.016156f, 0.013840f, 0.076603f}, {0.018815f, 0.016026f, 0.084584f}, {0.021692f, 0.018320f, 0.092610f}, - {0.024792f, 0.020715f, 0.100676f}, {0.028123f, 0.023201f, 0.108787f}, {0.031696f, 0.025765f, 0.116965f}, {0.035520f, 0.028397f, 0.125209f}, - {0.039608f, 0.031090f, 0.133515f}, {0.043830f, 0.033830f, 0.141886f}, {0.048062f, 0.036607f, 0.150327f}, {0.052320f, 0.039407f, 0.158841f}, - {0.056615f, 0.042160f, 0.167446f}, {0.060949f, 0.044794f, 0.176129f}, {0.065330f, 0.047318f, 0.184892f}, {0.069764f, 0.049726f, 0.193735f}, - {0.074257f, 0.052017f, 0.202660f}, {0.078815f, 0.054184f, 0.211667f}, {0.083446f, 0.056225f, 0.220755f}, {0.088155f, 0.058133f, 0.229922f}, - {0.092949f, 0.059904f, 0.239164f}, {0.097833f, 0.061531f, 0.248477f}, {0.102815f, 0.063010f, 0.257854f}, {0.107899f, 0.064335f, 0.267289f}, - {0.113094f, 0.065492f, 0.276784f}, {0.118405f, 0.066479f, 0.286321f}, {0.123833f, 0.067295f, 0.295879f}, {0.129380f, 0.067935f, 0.305443f}, - {0.135053f, 0.068391f, 0.315000f}, {0.140858f, 0.068654f, 0.324538f}, {0.146785f, 0.068738f, 0.334011f}, {0.152839f, 0.068637f, 0.343404f}, - {0.159018f, 0.068354f, 0.352688f}, {0.165308f, 0.067911f, 0.361816f}, {0.171713f, 0.067305f, 0.370771f}, {0.178212f, 0.066576f, 0.379497f}, - {0.184801f, 0.065732f, 0.387973f}, {0.191460f, 0.064818f, 0.396152f}, {0.198177f, 0.063862f, 0.404009f}, {0.204935f, 0.062907f, 0.411514f}, - {0.211718f, 0.061992f, 0.418647f}, {0.218512f, 0.061158f, 0.425392f}, {0.225302f, 0.060445f, 0.431742f}, {0.232077f, 0.059889f, 0.437695f}, - {0.238826f, 0.059517f, 0.443256f}, {0.245543f, 0.059352f, 0.448436f}, {0.252220f, 0.059415f, 0.453248f}, {0.258857f, 0.059706f, 0.457710f}, - {0.265447f, 0.060237f, 0.461840f}, {0.271994f, 0.060994f, 0.465660f}, {0.278493f, 0.061978f, 0.469190f}, {0.284951f, 0.063168f, 0.472451f}, - {0.291366f, 0.064553f, 0.475462f}, {0.297740f, 0.066117f, 0.478243f}, {0.304081f, 0.067835f, 0.480812f}, {0.310382f, 0.069702f, 0.483186f}, - {0.316654f, 0.071690f, 0.485380f}, {0.322899f, 0.073782f, 0.487408f}, {0.329114f, 0.075972f, 0.489287f}, {0.335308f, 0.078236f, 0.491024f}, - {0.341482f, 0.080564f, 0.492631f}, {0.347636f, 0.082946f, 0.494121f}, {0.353773f, 0.085373f, 0.495501f}, {0.359898f, 0.087831f, 0.496778f}, - {0.366012f, 0.090314f, 0.497960f}, {0.372116f, 0.092816f, 0.499053f}, {0.378211f, 0.095332f, 0.500067f}, {0.384299f, 0.097855f, 0.501002f}, - {0.390384f, 0.100379f, 0.501864f}, {0.396467f, 0.102902f, 0.502658f}, {0.402548f, 0.105420f, 0.503386f}, {0.408629f, 0.107930f, 0.504052f}, - {0.414709f, 0.110431f, 0.504662f}, {0.420791f, 0.112920f, 0.505215f}, {0.426877f, 0.115395f, 0.505714f}, {0.432967f, 0.117855f, 0.506160f}, - {0.439062f, 0.120298f, 0.506555f}, {0.445163f, 0.122724f, 0.506901f}, {0.451271f, 0.125132f, 0.507198f}, {0.457386f, 0.127522f, 0.507448f}, - {0.463508f, 0.129893f, 0.507652f}, {0.469640f, 0.132245f, 0.507809f}, {0.475780f, 0.134577f, 0.507921f}, {0.481929f, 0.136891f, 0.507989f}, - {0.488088f, 0.139186f, 0.508011f}, {0.494258f, 0.141462f, 0.507988f}, {0.500438f, 0.143719f, 0.507920f}, {0.506629f, 0.145958f, 0.507806f}, - {0.512831f, 0.148179f, 0.507648f}, {0.519045f, 0.150383f, 0.507443f}, {0.525270f, 0.152569f, 0.507192f}, {0.531507f, 0.154739f, 0.506895f}, - {0.537755f, 0.156894f, 0.506551f}, {0.544015f, 0.159033f, 0.506159f}, {0.550287f, 0.161158f, 0.505719f}, {0.556571f, 0.163269f, 0.505230f}, - {0.562866f, 0.165368f, 0.504692f}, {0.569172f, 0.167454f, 0.504105f}, {0.575490f, 0.169530f, 0.503466f}, {0.581819f, 0.171596f, 0.502777f}, - {0.588158f, 0.173652f, 0.502035f}, {0.594508f, 0.175701f, 0.501241f}, {0.600868f, 0.177743f, 0.500394f}, {0.607238f, 0.179779f, 0.499492f}, - {0.613617f, 0.181811f, 0.498536f}, {0.620005f, 0.183840f, 0.497524f}, {0.626401f, 0.185867f, 0.496456f}, {0.632805f, 0.187893f, 0.495332f}, - {0.639216f, 0.189921f, 0.494150f}, {0.645633f, 0.191952f, 0.492910f}, {0.652056f, 0.193986f, 0.491611f}, {0.658483f, 0.196027f, 0.490253f}, - {0.664915f, 0.198075f, 0.488836f}, {0.671349f, 0.200133f, 0.487358f}, {0.677786f, 0.202203f, 0.485819f}, {0.684224f, 0.204286f, 0.484219f}, - {0.690661f, 0.206384f, 0.482558f}, {0.697098f, 0.208501f, 0.480835f}, {0.703532f, 0.210638f, 0.479049f}, {0.709962f, 0.212797f, 0.477201f}, - {0.716387f, 0.214982f, 0.475290f}, {0.722805f, 0.217194f, 0.473316f}, {0.729216f, 0.219437f, 0.471279f}, {0.735616f, 0.221713f, 0.469180f}, - {0.742004f, 0.224025f, 0.467018f}, {0.748378f, 0.226377f, 0.464794f}, {0.754737f, 0.228772f, 0.462509f}, {0.761077f, 0.231214f, 0.460162f}, - {0.767398f, 0.233705f, 0.457755f}, {0.773695f, 0.236249f, 0.455289f}, {0.779968f, 0.238851f, 0.452765f}, {0.786212f, 0.241514f, 0.450184f}, - {0.792427f, 0.244242f, 0.447543f}, {0.798608f, 0.247040f, 0.444848f}, {0.804752f, 0.249911f, 0.442102f}, {0.810855f, 0.252861f, 0.439305f}, - {0.816914f, 0.255895f, 0.436461f}, {0.822926f, 0.259016f, 0.433573f}, {0.828886f, 0.262229f, 0.430644f}, {0.834791f, 0.265540f, 0.427671f}, - {0.840636f, 0.268953f, 0.424666f}, {0.846416f, 0.272473f, 0.421631f}, {0.852126f, 0.276106f, 0.418573f}, {0.857763f, 0.279857f, 0.415496f}, - {0.863320f, 0.283729f, 0.412403f}, {0.868793f, 0.287728f, 0.409303f}, {0.874176f, 0.291859f, 0.406205f}, {0.879464f, 0.296125f, 0.403118f}, - {0.884651f, 0.300530f, 0.400047f}, {0.889731f, 0.305079f, 0.397002f}, {0.894700f, 0.309773f, 0.393995f}, {0.899552f, 0.314616f, 0.391037f}, - {0.904281f, 0.319610f, 0.388137f}, {0.908884f, 0.324755f, 0.385308f}, {0.913354f, 0.330052f, 0.382563f}, {0.917689f, 0.335500f, 0.379915f}, - {0.921884f, 0.341098f, 0.377376f}, {0.925937f, 0.346844f, 0.374959f}, {0.929845f, 0.352734f, 0.372677f}, {0.933606f, 0.358764f, 0.370541f}, - {0.937221f, 0.364929f, 0.368567f}, {0.940687f, 0.371224f, 0.366762f}, {0.944006f, 0.377643f, 0.365136f}, {0.947180f, 0.384178f, 0.363701f}, - {0.950210f, 0.390820f, 0.362468f}, {0.953099f, 0.397563f, 0.361438f}, {0.955849f, 0.404400f, 0.360619f}, {0.958464f, 0.411324f, 0.360014f}, - {0.960949f, 0.418323f, 0.359630f}, {0.963310f, 0.425390f, 0.359469f}, {0.965549f, 0.432519f, 0.359529f}, {0.967671f, 0.439703f, 0.359810f}, - {0.969680f, 0.446936f, 0.360311f}, {0.971582f, 0.454210f, 0.361030f}, {0.973381f, 0.461520f, 0.361965f}, {0.975082f, 0.468861f, 0.363111f}, - {0.976690f, 0.476226f, 0.364466f}, {0.978210f, 0.483612f, 0.366025f}, {0.979645f, 0.491014f, 0.367783f}, {0.981000f, 0.498428f, 0.369734f}, - {0.982279f, 0.505851f, 0.371874f}, {0.983485f, 0.513280f, 0.374198f}, {0.984622f, 0.520713f, 0.376698f}, {0.985693f, 0.528148f, 0.379371f}, - {0.986700f, 0.535582f, 0.382210f}, {0.987646f, 0.543015f, 0.385210f}, {0.988533f, 0.550446f, 0.388365f}, {0.989363f, 0.557873f, 0.391671f}, - {0.990138f, 0.565296f, 0.395122f}, {0.990871f, 0.572706f, 0.398714f}, {0.991558f, 0.580107f, 0.402441f}, {0.992196f, 0.587502f, 0.406299f}, - {0.992785f, 0.594891f, 0.410283f}, {0.993326f, 0.602275f, 0.414390f}, {0.993834f, 0.609644f, 0.418613f}, {0.994309f, 0.616999f, 0.422950f}, - {0.994738f, 0.624350f, 0.427397f}, {0.995122f, 0.631696f, 0.431951f}, {0.995480f, 0.639027f, 0.436607f}, {0.995810f, 0.646344f, 0.441361f}, - {0.996096f, 0.653659f, 0.446213f}, {0.996341f, 0.660969f, 0.451160f}, {0.996580f, 0.668256f, 0.456192f}, {0.996775f, 0.675541f, 0.461314f}, - {0.996925f, 0.682828f, 0.466526f}, {0.997077f, 0.690088f, 0.471811f}, {0.997186f, 0.697349f, 0.477182f}, {0.997254f, 0.704611f, 0.482635f}, - {0.997325f, 0.711848f, 0.488154f}, {0.997351f, 0.719089f, 0.493755f}, {0.997351f, 0.726324f, 0.499428f}, {0.997341f, 0.733545f, 0.505167f}, - {0.997285f, 0.740772f, 0.510983f}, {0.997228f, 0.747981f, 0.516859f}, {0.997138f, 0.755190f, 0.522806f}, {0.997019f, 0.762398f, 0.528821f}, - {0.996898f, 0.769591f, 0.534892f}, {0.996727f, 0.776795f, 0.541039f}, {0.996571f, 0.783977f, 0.547233f}, {0.996369f, 0.791167f, 0.553499f}, - {0.996162f, 0.798348f, 0.559820f}, {0.995932f, 0.805527f, 0.566202f}, {0.995680f, 0.812706f, 0.572645f}, {0.995424f, 0.819875f, 0.579140f}, - {0.995131f, 0.827052f, 0.585701f}, {0.994851f, 0.834213f, 0.592307f}, {0.994524f, 0.841387f, 0.598983f}, {0.994222f, 0.848540f, 0.605696f}, - {0.993866f, 0.855711f, 0.612482f}, {0.993545f, 0.862859f, 0.619299f}, {0.993170f, 0.870024f, 0.626189f}, {0.992831f, 0.877168f, 0.633109f}, - {0.992440f, 0.884330f, 0.640099f}, {0.992089f, 0.891470f, 0.647116f}, {0.991688f, 0.898627f, 0.654202f}, {0.991332f, 0.905763f, 0.661309f}, - {0.990930f, 0.912915f, 0.668481f}, {0.990570f, 0.920049f, 0.675675f}, {0.990175f, 0.927196f, 0.682926f}, {0.989815f, 0.934329f, 0.690198f}, - {0.989434f, 0.941470f, 0.697519f}, {0.989077f, 0.948604f, 0.704863f}, {0.988717f, 0.955742f, 0.712242f}, {0.988367f, 0.962878f, 0.719649f}, - {0.988033f, 0.970012f, 0.727077f}, {0.987691f, 0.977154f, 0.734536f}, {0.987387f, 0.984288f, 0.742002f}, {0.987053f, 0.991438f, 0.749504f} - }; - - void image::remapToMagma() - { - for (auto& pixel : mPixels) - { - int index = int(std::min(std::max(pixel.x, 0.0f), 1.0f) * 255.0f); - pixel = magmaMap[index]; - } - } - -} // namespace flip_detail - -struct FLIPOptions { - float ppd = 0; - float monitorDistance = 0.7f; - float monitorWidth = 0.7f; - float monitorResolutionX = 3840.0f; -}; - -void ComputeFLIPError(const float *testRGB, const float *referenceRGB, - float *flipError, int xRes, int yRes, const FLIPOptions &options) { - using namespace flip_detail; - - if (options.ppd > 0) - gPPD = options.ppd; - else { - gMonitorDistance = options.monitorDistance; - gMonitorWidth = options.monitorWidth; - gMonitorResolutionX = options.monitorResolutionX; - gPPD = calculatePPD(gMonitorDistance, gMonitorResolutionX, gMonitorWidth); - } - - image testImage(xRes, yRes), referenceImage(xRes, yRes), flipImage(xRes, yRes); - for (int y = 0; y < yRes; ++y) - for (int x = 0; x < xRes; ++x) { - int offset = 3 * (x + y * xRes); - testImage.set(x, y, color3(testRGB[offset], testRGB[offset+1], testRGB[offset+2])); - referenceImage.set(x, y, color3(referenceRGB[offset], referenceRGB[offset+1], referenceRGB[offset+2])); - } - - flipImage.computeFLIPError(testImage, referenceImage, false /* verbose */); - - for (int y = 0; y < yRes; ++y) - for (int x = 0; x < xRes; ++x) - flipError[x + y * xRes] = flipImage.get(x, y).x; -} diff --git a/devertexwahn/imaging/iqa/flip.h b/devertexwahn/imaging/iqa/flip.h deleted file mode 100644 index 99ef5fdc..00000000 --- a/devertexwahn/imaging/iqa/flip.h +++ /dev/null @@ -1,51 +0,0 @@ -// Derived from FLIP reference implementation: https://research.nvidia.com/sites/default/files/pubs/2020-07_FLIP/flip-cpp.zip - -/*************************************************************************** -# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of NVIDIA CORPORATION nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -***************************************************************************/ - -// FLIP: A Difference Evaluator for Alternating Images -// High Performance Graphics, 2020. -// by Pontus Andersson, Jim Nilsson, Tomas Akenine-Moller, Magnus Oskarsson, Kalle Astrom, and Mark D. Fairchild -// -// Pointer to our paper: https://research.nvidia.com/publication/2020-07_FLIP -// code by Pontus Andersson, Jim Nilsson, and Tomas Akenine-Moller - -#ifndef FLIP_FLIP_H -#define FLIP_FLIP_H - -struct FLIPOptions { - float ppd = 0; - float monitorDistance = 0.7f; - float monitorWidth = 0.7f; - float monitorResolutionX = 3840.0f; -}; - -void ComputeFLIPError(const float *testRGB, const float *referenceRGB, - float *flipError, int xRes, int yRes, const FLIPOptions &options); - -#endif // FLIP_FLIP_H \ No newline at end of file diff --git a/devertexwahn/imaging/tests/third_party/zlib_test.cpp b/devertexwahn/imaging/tests/third_party/zlib_test.cpp index 5dda2b49..ff26abd7 100644 --- a/devertexwahn/imaging/tests/third_party/zlib_test.cpp +++ b/devertexwahn/imaging/tests/third_party/zlib_test.cpp @@ -8,5 +8,5 @@ #include "gmock/gmock.h" TEST(zlib, version_check) { - EXPECT_THAT(ZLIB_VERSION, testing::StrCaseEq("1.3")); + EXPECT_THAT(ZLIB_VERSION, testing::StrCaseEq("1.3.1")); } diff --git a/devertexwahn/okapi/third_party/eigen.BUILD b/devertexwahn/okapi/third_party/eigen.BUILD deleted file mode 100644 index a1169b53..00000000 --- a/devertexwahn/okapi/third_party/eigen.BUILD +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2017 Google Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS-IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -package( - default_visibility = ["//visibility:public"], -) - -cc_library( - name = "eigen", - hdrs = glob( - ["Eigen/**"], - exclude = [ - "Eigen/src/OrderingMethods/Amd.h", - "Eigen/src/SparseCholesky/**", - "Eigen/Eigen", - "Eigen/IterativeLinearSolvers", - "Eigen/MetisSupport", - "Eigen/Sparse", - "Eigen/SparseCholesky", - "Eigen/SparseLU", - ], - ), - defines = [ - "EIGEN_MPL_ONLY", - "EIGEN_NO_DEBUG", - ], - includes = ["."], -) diff --git a/devertexwahn/okapi/third_party/okapi_deps.bzl b/devertexwahn/okapi/third_party/okapi_deps.bzl index a7619513..93f6efaa 100644 --- a/devertexwahn/okapi/third_party/okapi_deps.bzl +++ b/devertexwahn/okapi/third_party/okapi_deps.bzl @@ -1,5 +1,5 @@ """ - SPDX-FileCopyrightText: Copyright 2022-2023 Julian Amann + SPDX-FileCopyrightText: Copyright 2022-2024 Julian Amann SPDX-License-Identifier: Apache-2.0 """ @@ -10,439 +10,14 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def okapi_deps(): """Fetch external dependencies for Okapi.""" - #------------------------------------------------------------------------------------- - # GoogleTest - #------------------------------------------------------------------------------------- - - # Use local repository - maybe( - native.local_repository, - name = "googletest", - path = "../third_party/googletest", - ) - - # Use github.com - #maybe( - # http_archive, - # name = "googletest", - # sha256 = "cf8e496a802e6cb2fd02b09b84984f133eb2e79046265c2c6382c3c6df603d97", - # strip_prefix = "googletest-3e0e32ba300ce8afe695ad3ba7e81b21b7cf237a", - # urls = ["https://github.com/google/googletest/archive/8306020a3e9eceafec65508868d7ab5c63bb41f7.zip"], - #) - - #------------------------------------------------------------------------------------- - # glog - #------------------------------------------------------------------------------------- - - #maybe( - # git_repository, - # name = "com_github_gflags_gflags", - # commit = "827c769e5fc98e0f2a34c47cef953cc6328abced", - # remote = "https://github.com/gflags/gflags", - # shallow_since = "1604052972 +0000", - #) - - maybe( - native.local_repository, - name = "com_github_gflags_gflags", - path = "../third_party/gflags", - ) - - # Use local repository - maybe( - native.local_repository, - name = "glog", - path = "../third_party/glog", - ) - - # Use github.com - #maybe( - # git_repository, - # name = "glog", - # #branch = "master", - # commit = "9733727be4aed835e21a8f73c403f546b71663fe", - # remote = "https://github.com/google/glog", - # shallow_since = "1630690048 +0200", - #) - - #maybe( - # http_archive, - # name = "glog", - # sha256 = "21bc744fb7f2fa701ee8db339ded7dce4f975d0d55837a97be7d46e8382dea5a", - # strip_prefix = "glog-0.5.0", - # urls = ["https://github.com/google/glog/archive/refs/tags/v0.5.0.zip"], - #) - - #------------------------------------------------------------------------------------- - # Catch2 - #------------------------------------------------------------------------------------- - - # Use local repository - maybe( - native.local_repository, - name = "catch2", - path = "../third_party/Catch2", - ) - - # Use github.com - #maybe( - # http_archive, - # name = "catch2", - # sha256 = "48dfbb77b9193653e4e72df9633d2e0383b9b625a47060759668480fdf24fbd4", - # strip_prefix = "Catch2-2.13.6", - # urls = ["https://github.com/catchorg/Catch2/archive/refs/tags/v2.13.6.tar.gz"], - #) - - #------------------------------------------------------------------------------------- - # {fmt} - #------------------------------------------------------------------------------------- - - # Use local repository - maybe( - native.local_repository, - name = "fmt", - path = "../third_party/fmt", - ) - - # Live at Head - #maybe( - # git_repository, - # name = "fmt", - # branch = "master", - # remote = "https://github.com/fmtlib/fmt", - # patch_cmds = [ - # "mv support/bazel/.bazelversion .bazelversion", - # "mv support/bazel/BUILD.bazel BUILD.bazel", - # "mv support/bazel/WORKSPACE.bazel WORKSPACE.bazel", - # ], - # # Windows-related patch commands are only needed in the case MSYS2 is not installed. - # # More details about the installation process of MSYS2 on Windows systems can be found here: - # # https://docs.bazel.build/versions/main/install-windows.html#installing-compilers-and-language-runtimes - # # Even if MSYS2 is installed the Windows related patch commands can still be used. - # patch_cmds_win = [ - # "Move-Item -Path support/bazel/.bazelversion -Destination .bazelversion", - # "Move-Item -Path support/bazel/BUILD.bazel -Destination BUILD.bazel", - # "Move-Item -Path support/bazel/WORKSPACE.bazel -Destination WORKSPACE.bazel", - # ], - #) - - # Use github.com - #maybe( - # http_archive, - # name = "fmt", - # build_file = "//okapi/third_party:fmt.BUILD", - # sha256 = "b06ca3130158c625848f3fb7418f235155a4d389b2abc3a6245fb01cb0eb1e01", - # strip_prefix = "fmt-8.0.1", - # urls = ["https://github.com/fmtlib/fmt/archive/refs/tags/8.0.1.tar.gz"], - #) - - #------------------------------------------------------------------------------------- - # hypothesis - #------------------------------------------------------------------------------------- - - # Use local repository - maybe( - native.new_local_repository, - name = "hypothesis", - build_file = "//okapi/third_party:hypothesis.BUILD", - path = "../third_party/hypothesis", - ) - - # Use github.com - #maybe( - # http_archive, - # name = "hypothesis", - # build_file = "//okapi/third_party:hypothesis.BUILD", - # sha256 = "257a8448bfc28e04497169caeaea986d8cfeb6c3c116abaedc003c30b23fd645", - # strip_prefix = "hypothesis-e165503f7d796d844d5d6ab69b5c7f839cf0ede8", - # urls = ["https://github.com/wjakob/hypothesis/archive/e165503f7d796d844d5d6ab69b5c7f839cf0ede8.zip"], - #) - - #------------------------------------------------------------------------------------- - # pugixml - #------------------------------------------------------------------------------------- - - #maybe( - # http_archive, - # name = "pugixml", - # build_file = "//okapi/third_party:pugixml.BUILD", - # sha256 = "82226fc0cbdea450a06a4486c6514bd31984a75fbfcf359aea99080f4b878d2a", - # strip_prefix = "pugixml-1.12.1", - # urls = ["https://github.com/zeux/pugixml/releases/download/v1.11.4/pugixml-1.12.1.zip"], - #) - - # Use local repository - #maybe( - # native.new_local_repository, - # name = "pugixml", - # build_file = "//okapi/third_party:pugixml.BUILD", - # #path = "../third_party/pugixml-1.13", - # path = "../third_party/pugixml", - #) - - #------------------------------------------------------------------------------------- - # pcg - #------------------------------------------------------------------------------------- - - # PCG, A Family of Better Random Number Generators - # Does not work with Visual Studio 2019 - #http_archive( - # name = "pcg", - # build_file = "//okapi/third_party:pcg.BUILD", - # sha256 = "25bb22f076e8c346fa28c2267ae3564b12122f1f4ab2d2a08ad8909dcd6319fd", - # strip_prefix = "pcg-cpp-0.98.1", - # urls = ["https://github.com/imneme/pcg-cpp/archive/v0.98.1.tar.gz"], - #) - - # Use local repository - maybe( - native.new_local_repository, - name = "pcg", - build_file = "//okapi/third_party:pcg.BUILD", - path = "../third_party/pcg-cpp", - ) - - #maybe( - # http_archive, - # name = "pcg", - # build_file = "//okapi/third_party:pcg.BUILD", - # sha256 = "64e7c049624706215e814fa99a73aadd4015d6da1b044b97bca1a66d8d713fcb", - # strip_prefix = "pcg-cpp-ffd522e7188bef30a00c74dc7eb9de5faff90092", - # urls = ["https://github.com/imneme/pcg-cpp/archive/ffd522e7188bef30a00c74dc7eb9de5faff90092.zip"], - #) - - #------------------------------------------------------------------------------------- - # libjpeg-turbo - #------------------------------------------------------------------------------------- - - #maybe( - # http_archive, - # name = "nasm", - # urls = [ - # "https://storage.googleapis.com/mirror.tensorflow.org/www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2", - # "http://pkgs.fedoraproject.org/repo/pkgs/nasm/nasm-2.14.02.tar.bz2/sha512/d7a6b4cee8dfd603d8d4c976e5287b5cc542fa0b466ff989b743276a6e28114e64289bf02a7819eca63142a5278aa6eed57773007e5f589e15768e6456a8919d/nasm-2.14.02.tar.bz2", - # "http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2", - # ], - # sha256 = "34fd26c70a277a9fdd54cb5ecf389badedaf48047b269d1008fbc819b24e80bc", - # strip_prefix = "nasm-2.14.02", - # build_file = "//okapi/third_party:nasm.BUILD", - #) - - #maybe( - # native.new_local_repository, - # name = "nasm", - # build_file = "//okapi/third_party:nasm.BUILD", - # path = "../third_party/nasm-2.14.02", - #) - - #maybe( - # native.new_local_repository, - # name = "libjpeg_turbo", - # build_file = "//okapi/third_party:libjpeg_turbo.BUILD", - # path = "../third_party/libjpeg-turbo-2.1.4", - #) - - #------------------------------------------------------------------------------------- - # oneTBB - #------------------------------------------------------------------------------------- - - maybe( - native.local_repository, - name = "oneTBB", - path = "../third_party/oneTBB", - ) - - #maybe( - # native.local_repository, - # name = "oneTBB", - # path = "../third_party/oneTBB-85792ca411c3faaf6494c761b0fc575dd0168304", - #) - - # Use git repository from com_github_oneapi_src_onetbb - #maybe( - # git_repository, - # name = "oneTBB", - # commit = "6164044548e802b3685ad84ffb04e40747d2ff3b", - # remote = "https://github.com/oneapi-src/oneTBB", - # shallow_since = "1625731441 +0300", - #) - - # Use git repository from com_github_vertexwahn_onetbb - #maybe( - # git_repository, - # name = "oneTBB", - # #branch = "add-bazel-macos-support", - # commit = "6e737b879a9406681e48c0fc88d8771221a00d8d", - # remote = "https://github.com/Vertexwahn/oneTBB", - # shallow_since = "1642798690 +0100", - #) - - #------------------------------------------------------------------------------------- - # rules_boost - #------------------------------------------------------------------------------------- - - # Use git repository from github.com - #git_repository( - # name = "com_github_nelhage_rules_boost", - # commit = "5a2bde336dc9089025003826ba39af2a27d8b90e", - # remote = "https://github.com/nelhage/rules_boost", - # shallow_since = "1625099911 -0700", - #) - - # Use http archive from github.com - #maybe( - # http_archive, - # name = "com_github_nelhage_rules_boost", - # sha256 = "ab6d5fff6577c9f92cbef05b0b884f84ba91e5f4b70660f8acee8af690467f8d", - # strip_prefix = "rules_boost-5a2bde336dc9089025003826ba39af2a27d8b90e", - # urls = ["https://github.com/nelhage/rules_boost/archive/5a2bde336dc9089025003826ba39af2a27d8b90e.zip"], - #) - - # Use local downloaded boost - #maybe( - # native.new_local_repository, - # name = "boost", - # build_file = "@com_github_nelhage_rules_boost//:BUILD.boost", - # path = "../third_party/boost_1_76_0", - #) - - #maybe( - # git_repository, - # name = "com_github_nelhage_rules_boost", - # remote = "https://github.com/Vertexwahn/rules_boost", - # branch = "introduce-maybe", - #) - - maybe( - native.local_repository, - name = "openssl", - path = "../third_party/boringssl", - ) - - # Switch back to this once above thing is tested: - maybe( - native.new_local_repository, - name = "org_lzma_lzma", - build_file = "@com_github_nelhage_rules_boost//:lzma.BUILD", - path = "../third_party/xz-5.4.2", - ) - - maybe( - native.new_local_repository, - name = "org_bzip_bzip2", - build_file = "@com_github_nelhage_rules_boost//:bzip2.BUILD", - path = "../third_party/bzip2-1.0.8", - ) - - maybe( - native.local_repository, - name = "com_github_nelhage_rules_boost", - path = "../third_party/rules_boost", - ) - #------------------------------------------------------------------------------------- # bazel_clang_tidy #------------------------------------------------------------------------------------- - #maybe( - # git_repository, - # name = "bazel_clang_tidy", - # branch = "master", - # remote = "https://github.com/erenon/bazel_clang_tidy.git", - #) - maybe( native.local_repository, name = "bazel_clang_tidy", - path = "../third_party/bazel_clang_tidy-c2fe98cfec0430e78bff4169e9ca0a43123e4c99", - ) - - #------------------------------------------------------------------------------------- - # LLVM - #------------------------------------------------------------------------------------- - - #maybe( - # git_repository, - # name = "com_grail_bazel_toolchain", - # remote = "https://github.com/Vertexwahn/bazel-toolchain", - # branch = "clang-15-support", - #) - - #maybe( - # native.local_repository, - # name = "com_grail_bazel_toolchain", - # path = "../third_party/bazel-toolchain", - #) - - maybe( - native.local_repository, - name = "com_grail_bazel_toolchain", - path = "../third_party/bazel-toolchain-0.8", + path = "../third_party/bazel_clang_tidy-4884c32e09c1ea9ac96b3f08c3004f3ac4c3fe39", ) - #------------------------------------------------------------------------------------- - # abseil-cpp - #------------------------------------------------------------------------------------- - - maybe( - native.local_repository, - name = "com_google_absl", - path = "../third_party/abseil-cpp", - ) - - #------------------------------------------------------------------------------------- - # xtensor - #------------------------------------------------------------------------------------- - - maybe( - native.new_local_repository, - name = "xtl", - path = "../third_party/xtl", - build_file = "//okapi/third_party:xtl.BUILD", - ) - - #maybe( - # http_archive, - # name = "xtl", - # urls = ["https://github.com/xtensor-stack/xtl/archive/e697c91e2a3ac571d120d2b093fb3b250d060a7d.zip"], - # strip_prefix = "xtl-e697c91e2a3ac571d120d2b093fb3b250d060a7d", - # build_file = "//okapi/third_party:xtl.BUILD", - #) - - maybe( - native.new_local_repository, - name = "xtensor", - path = "../third_party/xtensor", - build_file = "//okapi/third_party:xtensor.BUILD", - ) - - #maybe( - # http_archive, - # name = "xtensor", - # urls = ["https://github.com/xtensor-stack/xtensor/archive/275a4efb0faaa78b3b2132ea001d9167d4382109.zip"], - # strip_prefix = "xtensor-275a4efb0faaa78b3b2132ea001d9167d4382109", - # build_file = "//okapi/third_party:xtensor.BUILD", - #) - - - #------------------------------------------------------------------------------------- - # tinyobjloader - #------------------------------------------------------------------------------------- - - maybe( - native.new_local_repository, - name = "tinyobjloader", - build_file = "//okapi/third_party:tinyobjloader.BUILD", - path = "../third_party/tinyobjloader", - ) - - # From GitHub - #http_archive( - # name = "tinyobjloader", - # build_file = "//third_party:tinyobjloader.BUILD", - # sha256 = "4040bcd3029bfb37042a2bfe20248c369ab5a9c803e18a31476fee1e303ad579", - # strip_prefix = "tinyobjloader-ee45fb41db95bf9563f2a41bc63adfa18475c2ee", - # urls = ["https://github.com/tinyobjloader/tinyobjloader/archive/ee45fb41db95bf9563f2a41bc63adfa18475c2ee.zip"], - #) - diff --git a/third_party/Catch2/.clang-tidy b/third_party/Catch2/.clang-tidy new file mode 100644 index 00000000..539010d9 --- /dev/null +++ b/third_party/Catch2/.clang-tidy @@ -0,0 +1,81 @@ +--- +# Note: Alas, `Checks` is a string, not an array. +# Comments in the block string are not parsed and are passed in the value. +# They must thus be delimited by ',' from either side - then they are +# harmless. It's terrible, but it works. +Checks: >- + clang-diagnostic-*, + clang-analyzer-*, + -clang-analyzer-optin.core.EnumCastOutOfRange, + + bugprone-*, + -bugprone-unchecked-optional-access, + ,# This is ridiculous, as it triggers on constants, + -bugprone-implicit-widening-of-multiplication-result, + -bugprone-easily-swappable-parameters, + ,# Is not really useful, has false positives, triggers for no-noexcept move constructors ..., + -bugprone-exception-escape, + -bugprone-narrowing-conversions, + -bugprone-chained-comparison,# RIP decomposers, + + modernize-*, + -modernize-avoid-c-arrays, + -modernize-use-auto, + -modernize-use-emplace, + -modernize-use-nullptr,# it went crazy with three-way comparison operators, + -modernize-use-trailing-return-type, + -modernize-return-braced-init-list, + -modernize-concat-nested-namespaces, + -modernize-use-nodiscard, + -modernize-use-default-member-init, + -modernize-type-traits,# we need to support C++14, + -modernize-deprecated-headers, + ,# There's a lot of these and most of them are probably not useful, + -modernize-pass-by-value, + + performance-*, + -performance-enum-size, + + portability-*, + + readability-*, + -readability-braces-around-statements, + -readability-container-size-empty, + -readability-convert-member-functions-to-static, + -readability-else-after-return, + -readability-function-cognitive-complexity, + -readability-function-size, + -readability-identifier-length, + -readability-implicit-bool-conversion, + -readability-isolate-declaration, + -readability-magic-numbers, + -readability-named-parameter, + -readability-qualified-auto, + -readability-redundant-access-specifiers, + -readability-simplify-boolean-expr, + -readability-static-definition-in-anonymous-namespace, + -readability-uppercase-literal-suffix, + -readability-use-anyofallof, + -readability-avoid-return-with-void-value, + + ,# time hogs, + -bugprone-throw-keyword-missing, + -modernize-replace-auto-ptr, + -readability-identifier-naming, + + ,# We cannot use this until clang-tidy supports custom unique_ptr, + -bugprone-use-after-move, + ,# Doesn't recognize unevaluated context in CATCH_MOVE and CATCH_FORWARD, + -bugprone-macro-repeated-side-effects, +WarningsAsErrors: >- + clang-analyzer-core.*, + clang-analyzer-cplusplus.*, + clang-analyzer-security.*, + clang-analyzer-unix.*, + performance-move-const-arg, + performance-unnecessary-value-param, + readability-duplicate-include, +HeaderFilterRegex: '.*\.(c|cxx|cpp)$' +FormatStyle: none +CheckOptions: {} +... diff --git a/third_party/Catch2/.conan/test_package/CMakeLists.txt b/third_party/Catch2/.conan/test_package/CMakeLists.txt index 6ee069c0..00a6af23 100644 --- a/third_party/Catch2/.conan/test_package/CMakeLists.txt +++ b/third_party/Catch2/.conan/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -cmake_minimum_required(VERSION 3.2.0) -project(test_package CXX) +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() +find_package(Catch2 CONFIG REQUIRED) -find_package(Catch2 REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) - -target_link_libraries(${PROJECT_NAME} Catch2::Catch2WithMain) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14) +add_executable(test_package test_package.cpp) +target_link_libraries(test_package Catch2::Catch2WithMain) +target_compile_features(test_package PRIVATE cxx_std_14) diff --git a/third_party/Catch2/.conan/test_package/conanfile.py b/third_party/Catch2/.conan/test_package/conanfile.py index 069ace61..dc038764 100644 --- a/third_party/Catch2/.conan/test_package/conanfile.py +++ b/third_party/Catch2/.conan/test_package/conanfile.py @@ -1,12 +1,28 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from conans import ConanFile, CMake +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run +from conan.tools.files import save, load import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package_multi", "cmake" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + save(self, os.path.join(self.build_folder, "package_folder"), + self.dependencies[self.tested_reference_str].package_folder) + save(self, os.path.join(self.build_folder, "license"), + self.dependencies[self.tested_reference_str].license) def build(self): cmake = CMake(self) @@ -14,7 +30,11 @@ def build(self): cmake.build() def test(self): - assert os.path.isfile(os.path.join( - self.deps_cpp_info["catch2"].rootpath, "licenses", "LICENSE.txt")) - bin_path = os.path.join("bin", "test_package") - self.run("%s -s" % bin_path, run_environment=True) + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") + + package_folder = load(self, os.path.join(self.build_folder, "package_folder")) + license = load(self, os.path.join(self.build_folder, "license")) + assert os.path.isfile(os.path.join(package_folder, "licenses", "LICENSE.txt")) + assert license == 'BSL-1.0' diff --git a/third_party/Catch2/.github/workflows/linux-meson-builds.yml b/third_party/Catch2/.github/workflows/linux-meson-builds.yml index 4ffa0243..4a6cfd5b 100644 --- a/third_party/Catch2/.github/workflows/linux-meson-builds.yml +++ b/third_party/Catch2/.github/workflows/linux-meson-builds.yml @@ -40,6 +40,5 @@ jobs: - name: Run tests working-directory: ${{runner.workspace}}/meson-build - # Hardcode 2 cores we know are there run: | meson test --verbose diff --git a/third_party/Catch2/.github/workflows/linux-other-builds.yml b/third_party/Catch2/.github/workflows/linux-other-builds.yml index 4a7f5ecc..6993c815 100644 --- a/third_party/Catch2/.github/workflows/linux-other-builds.yml +++ b/third_party/Catch2/.github/workflows/linux-other-builds.yml @@ -102,5 +102,53 @@ jobs: env: CTEST_OUTPUT_ON_FAILURE: 1 working-directory: ${{runner.workspace}}/build - # Hardcode 2 cores we know are there - run: ctest -C ${{matrix.build_type}} -j 2 ${{matrix.other_ctest_args}} + run: ctest -C ${{matrix.build_type}} -j `nproc` ${{matrix.other_ctest_args}} + clang-tidy: + name: clang-tidy ${{matrix.version}}, ${{matrix.build_description}}, C++${{matrix.std}} ${{matrix.build_type}} + runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - version: "15" + build_description: all + build_type: Debug + std: 17 + other_pkgs: '' + cmake_configurations: -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON + steps: + - uses: actions/checkout@v4 + + - name: Prepare environment + run: | + sudo apt-get update + sudo apt-get install -y ninja-build clang-${{matrix.version}} clang-tidy-${{matrix.version}} ${{matrix.other_pkgs}} + + - name: Configure build + working-directory: ${{runner.workspace}} + env: + CXX: clang++-${{matrix.version}} + CXXFLAGS: ${{matrix.cxxflags}} + # Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}. + # This is important + run: | + clangtidy="clang-tidy-${{matrix.version}};-use-color" + # Use a dummy compiler/linker/ar/ranlib to effectively disable the + # compilation and only run clang-tidy. + cmake -Bbuild -H$GITHUB_WORKSPACE \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_CXX_EXTENSIONS=OFF \ + -DCATCH_DEVELOPMENT_BUILD=ON \ + -DCMAKE_CXX_CLANG_TIDY="$clangtidy" \ + -DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/true \ + -DCMAKE_AR=/usr/bin/true \ + -DCMAKE_CXX_COMPILER_AR=/usr/bin/true \ + -DCMAKE_RANLIB=/usr/bin/true \ + -DCMAKE_CXX_LINK_EXECUTABLE=/usr/bin/true \ + ${{matrix.cmake_configurations}} \ + -G Ninja + + - name: Run clang-tidy + working-directory: ${{runner.workspace}}/build + run: ninja diff --git a/third_party/Catch2/.github/workflows/linux-simple-builds.yml b/third_party/Catch2/.github/workflows/linux-simple-builds.yml index a32eb597..4cca3161 100644 --- a/third_party/Catch2/.github/workflows/linux-simple-builds.yml +++ b/third_party/Catch2/.github/workflows/linux-simple-builds.yml @@ -120,5 +120,4 @@ jobs: env: CTEST_OUTPUT_ON_FAILURE: 1 working-directory: ${{runner.workspace}}/build - # Hardcode 2 cores we know are there - run: ctest -C ${{matrix.build_type}} -j 2 + run: ctest -C ${{matrix.build_type}} -j `nproc` diff --git a/third_party/Catch2/.github/workflows/mac-builds-m1.yml b/third_party/Catch2/.github/workflows/mac-builds-m1.yml new file mode 100644 index 00000000..4820466d --- /dev/null +++ b/third_party/Catch2/.github/workflows/mac-builds-m1.yml @@ -0,0 +1,44 @@ +name: M1 Mac builds + +on: [push, pull_request] + +jobs: + build: + runs-on: macos-14 + strategy: + matrix: + cxx: + - clang++ + build_type: [Debug, Release] + std: [14, 17] + include: + - build_type: Debug + examples: ON + extra_tests: ON + + steps: + - uses: actions/checkout@v4 + + - name: Configure build + working-directory: ${{runner.workspace}} + env: + CXX: ${{matrix.cxx}} + CXXFLAGS: ${{matrix.cxxflags}} + run: | + cmake -Bbuild -H$GITHUB_WORKSPACE \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCATCH_DEVELOPMENT_BUILD=ON \ + -DCATCH_BUILD_EXAMPLES=${{matrix.examples}} \ + -DCATCH_BUILD_EXTRA_TESTS=${{matrix.examples}} + + - name: Build tests + lib + working-directory: ${{runner.workspace}}/build + run: make -j `sysctl -n hw.ncpu` + + - name: Run tests + env: + CTEST_OUTPUT_ON_FAILURE: 1 + working-directory: ${{runner.workspace}}/build + run: ctest -C ${{matrix.build_type}} -j `sysctl -n hw.ncpu` diff --git a/third_party/Catch2/.github/workflows/package-manager-builds.yaml b/third_party/Catch2/.github/workflows/package-manager-builds.yaml new file mode 100644 index 00000000..6d90d140 --- /dev/null +++ b/third_party/Catch2/.github/workflows/package-manager-builds.yaml @@ -0,0 +1,31 @@ +name: Package Manager Builds + +on: [push, pull_request] + +jobs: + conan_builds: + name: Conan ${{matrix.conan_version}} + runs-on: ubuntu-20.04 + strategy: + matrix: + conan_version: + - '1.63' + - '2.1' + + include: + # Conan 1 has default profiles installed + - conan_version: '1.63' + profile_generate: 'false' + + steps: + - uses: actions/checkout@v4 + + - name: Install conan + run: pip install conan==${{matrix.conan_version}} + + - name: Setup conan profiles + if: matrix.profile_generate != 'false' + run: conan profile detect + + - name: Run conan package create + run: conan create . -tf .conan/test_package diff --git a/third_party/Catch2/.gitignore b/third_party/Catch2/.gitignore index 27f6bc0b..4ed76b0b 100644 --- a/third_party/Catch2/.gitignore +++ b/third_party/Catch2/.gitignore @@ -25,6 +25,7 @@ Build cmake-build-* benchmark-dir .conan/test_package/build +.conan/test_package/CMakeUserPresets.json bazel-* build-fuzzers debug-build diff --git a/third_party/Catch2/CMake/CatchMiscFunctions.cmake b/third_party/Catch2/CMake/CatchMiscFunctions.cmake index de6b7ae3..84bd7cc7 100644 --- a/third_party/Catch2/CMake/CatchMiscFunctions.cmake +++ b/third_party/Catch2/CMake/CatchMiscFunctions.cmake @@ -78,6 +78,7 @@ function(add_warnings_to_targets targets) "-Wreturn-std-move" "-Wshadow" "-Wstrict-aliasing" + "-Wsubobject-linkage" "-Wsuggest-destructor-override" "-Wsuggest-override" "-Wundef" diff --git a/third_party/Catch2/CMakeLists.txt b/third_party/Catch2/CMakeLists.txt index b4dd2b52..958d3823 100644 --- a/third_party/Catch2/CMakeLists.txt +++ b/third_party/Catch2/CMakeLists.txt @@ -33,7 +33,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) endif() project(Catch2 - VERSION 3.5.1 # CML version placeholder, don't delete + VERSION 3.5.4 # CML version placeholder, don't delete LANGUAGES CXX # HOMEPAGE_URL is not supported until CMake version 3.12, which # we do not target yet. @@ -76,8 +76,6 @@ endif() set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(SOURCES_DIR ${CATCH_DIR}/src/catch2) set(SELF_TEST_DIR ${CATCH_DIR}/tests/SelfTest) -set(BENCHMARK_DIR ${CATCH_DIR}/tests/Benchmark) -set(EXAMPLES_DIR ${CATCH_DIR}/examples) # We need to bring-in the variables defined there to this scope add_subdirectory(src) @@ -200,4 +198,4 @@ if (NOT_SUBPROJECT) include( CPack ) -endif(NOT_SUBPROJECT) +endif() diff --git a/third_party/Catch2/appveyor.yml b/third_party/Catch2/appveyor.yml index 7a0ad83f..ba4556ea 100644 --- a/third_party/Catch2/appveyor.yml +++ b/third_party/Catch2/appveyor.yml @@ -5,10 +5,10 @@ version: "{build}-{branch}" clone_depth: 20 # We want to build everything, except for branches that are explicitly -# for messing around with travis. +# for messing around with Github Actions. branches: except: - - /dev-travis.+/ + - /devel-gha.+/ # We need a more up to date pip because Python 2.7 is EOL soon @@ -70,3 +70,14 @@ environment: additional_flags: "/permissive- /std:c++latest" platform: x64 configuration: Debug + + - FLAVOR: VS 2017 x64 Debug + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + platform: x64 + configuration: Debug + + - FLAVOR: VS 2017 x64 Release Coverage + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + coverage: 1 + platform: x64 + configuration: Debug diff --git a/third_party/Catch2/conanfile.py b/third_party/Catch2/conanfile.py old mode 100644 new mode 100755 index 7aa27ef5..bcdd426f --- a/third_party/Catch2/conanfile.py +++ b/third_party/Catch2/conanfile.py @@ -1,5 +1,14 @@ #!/usr/bin/env python -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os +import re + +required_conan_version = ">=1.53.0" class CatchConan(ConanFile): name = "catch2" @@ -8,53 +17,112 @@ class CatchConan(ConanFile): url = "https://github.com/catchorg/Catch2" homepage = url license = "BSL-1.0" + version = "latest" + settings = "os", "compiler", "build_type", "arch" + extension_properties = {"compatibility_cppstd": False} - exports = "LICENSE.txt" - exports_sources = ("src/*", "CMakeLists.txt", "CMake/*", "extras/*") + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - settings = "os", "compiler", "build_type", "arch" + @property + def _min_cppstd(self): + return "14" - generators = "cmake" + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "Visual Studio": "15", + "msvc": "191", + "clang": "5", + "apple-clang": "10", + } - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["BUILD_TESTING"] = "OFF" - cmake.definitions["CATCH_INSTALL_DOCS"] = "OFF" - cmake.definitions["CATCH_INSTALL_EXTRAS"] = "ON" - cmake.configure(build_folder="build") - return cmake + + def set_version(self): + pattern = re.compile(r"\w*VERSION (\d+\.\d+\.\d+) # CML version placeholder, don't delete") + with open("CMakeLists.txt") as file: + for line in file: + result = pattern.search(line) + if result: + self.version = result.group(1) + + self.output.info(f'Using version: {self.version}') + + def export(self): + copy(self, "LICENSE.txt", src=self.recipe_folder, dst=self.export_folder) + + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "src/*", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "extras/*", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "CMake/*", src=self.recipe_folder, dst=self.export_sources_folder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + # INFO: Conan 1.x does not specify cppstd by default, so we need to check the compiler version instead. + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler doesn't support") + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["CATCH_INSTALL_DOCS"] = False + tc.cache_variables["CATCH_INSTALL_EXTRAS"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - # We need this workaround until the toolchains feature - # to inject stuff like MD/MT - line_to_replace = 'list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")' - tools.replace_in_file("CMakeLists.txt", line_to_replace, - '''{} -include("{}/conanbuildinfo.cmake") -conan_basic_setup()'''.format(line_to_replace, self.install_folder.replace("\\", "/"))) - - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE.txt", dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE.txt", src=str(self.recipe_folder), dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "*.cmake", src=os.path.join(self.export_sources_folder, "extras"), + dst=os.path.join(self.package_folder, "lib", "cmake", "Catch2")) def package_info(self): lib_suffix = "d" if self.settings.build_type == "Debug" else "" - self.cpp_info.names["cmake_find_package"] = "Catch2" - self.cpp_info.names["cmake_find_package_multi"] = "Catch2" + self.cpp_info.set_property("cmake_file_name", "Catch2") + self.cpp_info.set_property("cmake_target_name", "Catch2::Catch2WithMain") + self.cpp_info.set_property("pkg_config_name", "catch2-with-main") + # Catch2 - self.cpp_info.components["catch2base"].names["cmake_find_package"] = "Catch2" - self.cpp_info.components["catch2base"].names["cmake_find_package_multi"] = "Catch2" - self.cpp_info.components["catch2base"].names["pkg_config"] = "Catch2" + self.cpp_info.components["catch2base"].set_property("cmake_file_name", "Catch2::Catch2") + self.cpp_info.components["catch2base"].set_property("pkg_config_name", "catch2") self.cpp_info.components["catch2base"].libs = ["Catch2" + lib_suffix] self.cpp_info.components["catch2base"].builddirs.append("lib/cmake/Catch2") + # Catch2WithMain - self.cpp_info.components["catch2main"].names["cmake_find_package"] = "Catch2WithMain" - self.cpp_info.components["catch2main"].names["cmake_find_package_multi"] = "Catch2WithMain" - self.cpp_info.components["catch2main"].names["pkg_config"] = "Catch2WithMain" + self.cpp_info.components["catch2main"].set_property("cmake_file_name", "Catch2::Catch2WithMain") + self.cpp_info.components["catch2main"].set_property("cmake_target_name", "Catch2::Catch2WithMain") + self.cpp_info.components["catch2main"].set_property("pkg_config_name", "catch2-with-main") self.cpp_info.components["catch2main"].libs = ["Catch2Main" + lib_suffix] self.cpp_info.components["catch2main"].requires = ["catch2base"] diff --git a/third_party/Catch2/docs/cmake-integration.md b/third_party/Catch2/docs/cmake-integration.md index 86666efe..a1bb4358 100644 --- a/third_party/Catch2/docs/cmake-integration.md +++ b/third_party/Catch2/docs/cmake-integration.md @@ -384,7 +384,7 @@ install it to the default location, like so: ``` $ git clone https://github.com/catchorg/Catch2.git $ cd Catch2 -$ cmake -Bbuild -H. -DBUILD_TESTING=OFF +$ cmake -B build -S . -DBUILD_TESTING=OFF $ sudo cmake --build build/ --target install ``` @@ -408,6 +408,24 @@ cd vcpkg The catch2 port in vcpkg is kept up to date by microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. +## Installing Catch2 from Bazel + +Catch2 is now a supported module in the Bazel Central Registry. You only need to add one line to your MODULE.bazel file; +please see https://registry.bazel.build/modules/catch2 for the latest supported version. + +You can then add `catch2_main` to each of your C++ test build rules as follows: + +``` +cc_test( + name = "example_test", + srcs = ["example_test.cpp"], + deps = [ + ":example", + "@catch2//:catch2_main", + ], +) +``` + --- [Home](Readme.md#top) diff --git a/third_party/Catch2/docs/command-line.md b/third_party/Catch2/docs/command-line.md index bb483959..7e69bf12 100644 --- a/third_party/Catch2/docs/command-line.md +++ b/third_party/Catch2/docs/command-line.md @@ -145,7 +145,7 @@ only tests that match the positive filters are included. You can also match test names with special characters by escaping them with a backslash (`"\"`), e.g. a test named `"Do A, then B"` is matched -by "Do A\, then B" test spec. Backslash also escapes itself. +by `"Do A\, then B"` test spec. Backslash also escapes itself. ### Examples @@ -194,7 +194,8 @@ verbose and human-friendly output. Reporters are also individually configurable. To pass configuration options to the reporter, you append `::key=value` to the reporter specification -as many times as you want, e.g. `--reporter xml::out=someFile.xml`. +as many times as you want, e.g. `--reporter xml::out=someFile.xml` or +`--reporter custom::colour-mode=ansi::Xoption=2`. The keys must either be prefixed by "X", in which case they are not parsed by Catch2 and are only passed down to the reporter, or one of options @@ -365,14 +366,14 @@ There are currently two warnings implemented: ## Reporting timings
-d, --durations <yes/no>
-When set to ```yes``` Catch will report the duration of each test case, in milliseconds. Note that it does this regardless of whether a test case passes or fails. Note, also, the certain reporters (e.g. Junit) always report test case durations regardless of this option being set or not. +When set to ```yes``` Catch will report the duration of each test case, in seconds with millisecond precision. Note that it does this regardless of whether a test case passes or fails. Note, also, the certain reporters (e.g. Junit) always report test case durations regardless of this option being set or not.
-D, --min-duration <value>
> `--min-duration` was [introduced](https://github.com/catchorg/Catch2/pull/1910) in Catch2 2.13.0 When set, Catch will report the duration of each test case that took more -than <value> seconds, in milliseconds. This option is overridden by both +than <value> seconds, in seconds with millisecond precision. This option is overridden by both `-d yes` and `-d no`, so that either all durations are reported, or none are. diff --git a/third_party/Catch2/docs/generators.md b/third_party/Catch2/docs/generators.md index 8bca54c7..eb1a255a 100644 --- a/third_party/Catch2/docs/generators.md +++ b/third_party/Catch2/docs/generators.md @@ -206,12 +206,26 @@ or OO ranges. Unlike `std::uniform_int_distribution`, Catch2's generators also support various single-byte integral types, such as `char` or `bool`. -Given the same seed, the output from the integral generators is -reproducible across different platforms. For floating point generators, -we only promise reproducibility on platforms that obey the IEEE 754 -standard, and where `float` is 4 bytes and `double` is 8 bytes. We provide -no guarantees for `long double`, as the internals of `long double` can -vary wildly across different platforms. + +#### Reproducibility + +Given the same seed, the output from the integral generators is fully +reproducible across different platforms. + +For floating point generators, the situation is much more complex. +Generally Catch2 only promises reproducibility (or even just correctness!) +on platforms that obey the IEEE-754 standard. Furthermore, reproducibility +only applies between binaries that perform floating point math in the +same way, e.g. if you compile a binary targetting the x87 FPU and another +one targetting SSE2 for floating point math, their results will vary. +Similarly, binaries compiled with compiler flags that relax the IEEE-754 +adherence, e.g. `-ffast-math`, might provide different results than those +compiled for strict IEEE-754 adherence. + +Finally, we provide zero guarantees on the reproducibility of generating +`long double`s, as the internals of `long double` varies across different +platforms. + ## Generator interface diff --git a/third_party/Catch2/docs/limitations.md b/third_party/Catch2/docs/limitations.md index 099dd82a..f5f60ba8 100644 --- a/third_party/Catch2/docs/limitations.md +++ b/third_party/Catch2/docs/limitations.md @@ -173,3 +173,19 @@ TEST_CASE("b") { If you are seeing a problem like this, i.e. weird test paths that trigger only under Clang with `libc++`, or only under very specific version of `libstdc++`, it is very likely you are seeing this. The only known workaround is to use a fixed version of your standard library. + +### Visual Studio 2022 -- can't compile assertion with the spaceship operator + +[The C++ standard requires that `std::foo_ordering` is only comparable with +a literal 0](https://eel.is/c++draft/cmp#categories.pre-3). There are +multiple strategies a stdlib implementation can take to achieve this, and +MSVC's STL has changed the strategy they use between two releases of VS 2022. + +With the new strategy, `REQUIRE((a <=> b) == 0)` no longer compiles under +MSVC. Note that Catch2 can compile code using MSVC STL's new strategy, +but only when compiled with a C++20 conforming compiler. MSVC is currently +not conformant enough, but `clang-cl` will compile the assertion above +using MSVC STL without problem. + +This change got in with MSVC v19.37](https://godbolt.org/z/KG9obzdvE). + diff --git a/third_party/Catch2/docs/logging.md b/third_party/Catch2/docs/logging.md index dbd4f912..79709386 100644 --- a/third_party/Catch2/docs/logging.md +++ b/third_party/Catch2/docs/logging.md @@ -114,6 +114,10 @@ Similar to `INFO`, but messages are not limited to their own scope: They are rem The message is always reported but does not fail the test. +**SUCCEED(** _message expression_ **)** + +The message is reported and the test case succeeds. + **FAIL(** _message expression_ **)** The message is reported and the test case fails. diff --git a/third_party/Catch2/docs/release-notes.md b/third_party/Catch2/docs/release-notes.md index 0449ed0e..87cec24b 100644 --- a/third_party/Catch2/docs/release-notes.md +++ b/third_party/Catch2/docs/release-notes.md @@ -2,6 +2,9 @@ # Release notes **Contents**
+[3.5.4](#354)
+[3.5.3](#353)
+[3.5.2](#352)
[3.5.1](#351)
[3.5.0](#350)
[3.4.0](#340)
@@ -59,6 +62,61 @@ [Even Older versions](#even-older-versions)
+## 3.5.4 + +### Fixes +* Fixed potential compilation error when asked to generate random integers whose type did not match `std::(u)int*_t`. + * This manifested itself when generating random `size_t`s on MacOS +* Added missing outlined destructor causing `Wdelete-incomplete` when compiling against libstdc++ in C++23 mode (#2852) +* Fixed regression where decomposing assertion with const instance of `std::foo_ordering` would not compile + +### Improvements +* Reintroduced support for GCC 5 and 6 (#2836) + * As with VS2017, if they start causing trouble again, they will be dropped again. +* Added workaround for targetting newest MacOS (Sonoma) using GCC (#2837, #2839) +* `CATCH_CONFIG_DEFAULT_REPORTER` can now be an arbitrary reporter spec + * Previously it could only be a plain reporter name, so it was impossible to compile in custom arguments to the reporter. +* Improved performance of generating 64bit random integers by 20+% + +### Miscellaneous +* Significantly improved Conan in-tree recipe (#2831) +* `DL_PATHS` in `catch_discover_tests` now supports multiple arguments (#2852, #2736) +* Fixed preprocessor logic for checking whether we expect reproducible floating point results in tests. +* Improved the floating point tests structure to avoid `Wunused` when the reproducibility tests are disabled (#2845) + + +## 3.5.3 + +### Fixes +* Fixed OOB access when computing filename tag (from the `-#` flag) for file without extension (#2798) +* Fixed the linking against `log` on Android to be `PRIVATE` (#2815) +* Fixed `Wuseless-cast` in benchmarking internals (#2823) + +### Improvements +* Restored compatibility with VS2017 (#2792, #2822) + * The baseline for Catch2 is still C++14 with some reasonable workarounds for specific compilers, so if VS2017 starts acting up again, the support will be dropped again. +* Suppressed clang-tidy's `bugprone-chained-comparison` in assertions (#2801) +* Improved the static analysis mode to evaluate arguments to `TEST_CASE` and `SECTION` (#2817) + * Clang-tidy should no longer warn about runtime arguments to these macros being unused in static analysis mode. + * Clang-tidy can warn on issues involved arguments to these macros. +* Added support for literal-zero detectors based on `consteval` constructors + * This is required for compiling `REQUIRE((a <=> b) == 0)` against MSVC's stdlib. + * Sadly, MSVC still cannot compile this assertion as it does not implement C++20 correctly. + * You can use `clang-cl` with MSVC's stdlib instead. + * If for some godforsaken reasons you want to understand this better, read the two relevant commits: [`dc51386b9fd61f99ea9c660d01867e6ad489b403`](https://github.com/catchorg/Catch2/commit/dc51386b9fd61f99ea9c660d01867e6ad489b403), and [`0787132fc82a75e3fb255aa9484ca1dc1eff2a30`](https://github.com/catchorg/Catch2/commit/0787132fc82a75e3fb255aa9484ca1dc1eff2a30). + +### Miscellaneous +* Disabled tests for FP random generator reproducibility on non-SSE2 x86 targets (#2796) +* Modified the in-tree Conan recipe to support Conan 2 (#2805) + + +## 3.5.2 + +### Fixes +* Fixed `-Wsubobject-linkage` in the Console reporter (#2794) +* Fixed adding new CLI Options to lvalue parser using `|` (#2787) + + ## 3.5.1 ### Improvements diff --git a/third_party/Catch2/docs/reporters.md b/third_party/Catch2/docs/reporters.md index e2abfe34..20ef5e55 100644 --- a/third_party/Catch2/docs/reporters.md +++ b/third_party/Catch2/docs/reporters.md @@ -5,7 +5,7 @@ Reporters are a customization point for most of Catch2's output, e.g. formatting and writing out [assertions (whether passing or failing), sections, test cases, benchmarks, and so on](reporter-events.md#top). -Catch2 comes with a bunch of reporters by default (currently 8), and +Catch2 comes with a bunch of reporters by default (currently 9), and you can also write your own reporter. Because multiple reporters can be active at the same time, your own reporters do not even have to handle all reporter event, just the ones you are interested in, e.g. benchmarks. diff --git a/third_party/Catch2/docs/tutorial.md b/third_party/Catch2/docs/tutorial.md index dfccac88..fb5a5b37 100644 --- a/third_party/Catch2/docs/tutorial.md +++ b/third_party/Catch2/docs/tutorial.md @@ -16,7 +16,7 @@ Ideally you should be using Catch2 through its [CMake integration](cmake-integra Catch2 also provides pkg-config files and two file (header + cpp) distribution, but this documentation will assume you are using CMake. If you are using the two file distribution instead, remember to replace -the included header with `catch_amalgamated.hpp`. +the included header with `catch_amalgamated.hpp` ([step by step instructions](migrate-v2-to-v3.md#how-to-migrate-projects-from-v2-to-v3)). ## Writing tests diff --git a/third_party/Catch2/examples/210-Evt-EventListeners.cpp b/third_party/Catch2/examples/210-Evt-EventListeners.cpp index 56b050d4..d05dfaaa 100644 --- a/third_party/Catch2/examples/210-Evt-EventListeners.cpp +++ b/third_party/Catch2/examples/210-Evt-EventListeners.cpp @@ -385,8 +385,7 @@ struct MyListener : Catch::EventListenerBase { CATCH_REGISTER_LISTENER( MyListener ) // Get rid of Wweak-tables -MyListener::~MyListener() {} - +MyListener::~MyListener() = default; // ----------------------------------------------------------------------- // 3. Test cases: diff --git a/third_party/Catch2/examples/231-Cfg-OutputStreams.cpp b/third_party/Catch2/examples/231-Cfg-OutputStreams.cpp index da1713cf..5aee38bc 100644 --- a/third_party/Catch2/examples/231-Cfg-OutputStreams.cpp +++ b/third_party/Catch2/examples/231-Cfg-OutputStreams.cpp @@ -22,7 +22,7 @@ class out_buff : public std::stringbuf { std::FILE* m_stream; public: out_buff(std::FILE* stream):m_stream(stream) {} - ~out_buff(); + ~out_buff() override; int sync() override { int ret = 0; for (unsigned char c : str()) { diff --git a/third_party/Catch2/examples/232-Cfg-CustomMain.cpp b/third_party/Catch2/examples/232-Cfg-CustomMain.cpp new file mode 100644 index 00000000..27040993 --- /dev/null +++ b/third_party/Catch2/examples/232-Cfg-CustomMain.cpp @@ -0,0 +1,41 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +// 232-Cfg-CustomMain.cpp +// Show how to use custom main and add a custom option to the CLI parser + +#include + +#include + +int main(int argc, char** argv) { + Catch::Session session; // There must be exactly one instance + + int height = 0; // Some user variable you want to be able to set + + // Build a new parser on top of Catch2's + using namespace Catch::Clara; + auto cli + = session.cli() // Get Catch2's command line parser + | Opt( height, "height" ) // bind variable to a new option, with a hint string + ["--height"] // the option names it will respond to + ("how high?"); // description string for the help output + + // Now pass the new composite back to Catch2 so it uses that + session.cli( cli ); + + // Let Catch2 (using Clara) parse the command line + int returnCode = session.applyCommandLine( argc, argv ); + if( returnCode != 0 ) // Indicates a command line error + return returnCode; + + // if set on the command line then 'height' is now set at this point + std::cout << "height: " << height << '\n'; + + return session.run(); +} diff --git a/third_party/Catch2/examples/300-Gen-OwnGenerator.cpp b/third_party/Catch2/examples/300-Gen-OwnGenerator.cpp index b5d951ac..9cb02e39 100644 --- a/third_party/Catch2/examples/300-Gen-OwnGenerator.cpp +++ b/third_party/Catch2/examples/300-Gen-OwnGenerator.cpp @@ -21,7 +21,7 @@ namespace { // This class shows how to implement a simple generator for Catch tests -class RandomIntGenerator : public Catch::Generators::IGenerator { +class RandomIntGenerator final : public Catch::Generators::IGenerator { std::minstd_rand m_rand; std::uniform_int_distribution<> m_dist; int current_number; diff --git a/third_party/Catch2/examples/301-Gen-MapTypeConversion.cpp b/third_party/Catch2/examples/301-Gen-MapTypeConversion.cpp index a065d87a..0a284483 100644 --- a/third_party/Catch2/examples/301-Gen-MapTypeConversion.cpp +++ b/third_party/Catch2/examples/301-Gen-MapTypeConversion.cpp @@ -24,12 +24,12 @@ namespace { // Returns a line from a stream. You could have it e.g. read lines from // a file, but to avoid problems with paths in examples, we will use // a fixed stringstream. -class LineGenerator : public Catch::Generators::IGenerator { +class LineGenerator final : public Catch::Generators::IGenerator { std::string m_line; std::stringstream m_stream; public: - LineGenerator() { - m_stream.str("1\n2\n3\n4\n"); + explicit LineGenerator( std::string const& lines ) { + m_stream.str( lines ); if (!next()) { Catch::Generators::Detail::throw_generator_exception("Couldn't read a single line"); } @@ -49,18 +49,19 @@ std::string const& LineGenerator::get() const { // This helper function provides a nicer UX when instantiating the generator // Notice that it returns an instance of GeneratorWrapper, which // is a value-wrapper around std::unique_ptr>. -Catch::Generators::GeneratorWrapper lines(std::string /* ignored for example */) { +Catch::Generators::GeneratorWrapper +lines( std::string const& lines ) { return Catch::Generators::GeneratorWrapper( - new LineGenerator() - ); + new LineGenerator( lines ) ); } } // end anonymous namespace TEST_CASE("filter can convert types inside the generator expression", "[example][generator]") { - auto num = GENERATE(map([](std::string const& line) { return std::stoi(line); }, - lines("fake-file"))); + auto num = GENERATE( + map( []( std::string const& line ) { return std::stoi( line ); }, + lines( "1\n2\n3\n4\n" ) ) ); REQUIRE(num > 0); } diff --git a/third_party/Catch2/examples/CMakeLists.txt b/third_party/Catch2/examples/CMakeLists.txt index 52010400..7e629e09 100644 --- a/third_party/Catch2/examples/CMakeLists.txt +++ b/third_party/Catch2/examples/CMakeLists.txt @@ -30,6 +30,7 @@ set( SOURCES_IDIOMATIC_EXAMPLES 110-Fix-ClassFixture.cpp 120-Bdd-ScenarioGivenWhenThen.cpp 210-Evt-EventListeners.cpp + 232-Cfg-CustomMain.cpp 300-Gen-OwnGenerator.cpp 301-Gen-MapTypeConversion.cpp 302-Gen-Table.cpp @@ -42,8 +43,7 @@ set( TARGETS_IDIOMATIC_EXAMPLES ${BASENAMES_IDIOMATIC_EXAMPLES} ) foreach( name ${TARGETS_IDIOMATIC_EXAMPLES} ) - add_executable( ${name} - ${EXAMPLES_DIR}/${name}.cpp ) + add_executable( ${name} ${name}.cpp ) endforeach() set(ALL_EXAMPLE_TARGETS diff --git a/third_party/Catch2/extras/CatchAddTests.cmake b/third_party/Catch2/extras/CatchAddTests.cmake index 692e3405..a0731941 100644 --- a/third_party/Catch2/extras/CatchAddTests.cmake +++ b/third_party/Catch2/extras/CatchAddTests.cmake @@ -21,8 +21,8 @@ function(catch_discover_tests_impl) cmake_parse_arguments( "" "" - "TEST_EXECUTABLE;TEST_WORKING_DIR;TEST_DL_PATHS;TEST_OUTPUT_DIR;TEST_OUTPUT_PREFIX;TEST_OUTPUT_SUFFIX;TEST_PREFIX;TEST_REPORTER;TEST_SPEC;TEST_SUFFIX;TEST_LIST;CTEST_FILE" - "TEST_EXTRA_ARGS;TEST_PROPERTIES;TEST_EXECUTOR" + "TEST_EXECUTABLE;TEST_WORKING_DIR;TEST_OUTPUT_DIR;TEST_OUTPUT_PREFIX;TEST_OUTPUT_SUFFIX;TEST_PREFIX;TEST_REPORTER;TEST_SPEC;TEST_SUFFIX;TEST_LIST;CTEST_FILE" + "TEST_EXTRA_ARGS;TEST_PROPERTIES;TEST_EXECUTOR;TEST_DL_PATHS" ${ARGN} ) diff --git a/third_party/Catch2/extras/ParseAndAddCatchTests.cmake b/third_party/Catch2/extras/ParseAndAddCatchTests.cmake index 4771e029..31fc193a 100644 --- a/third_party/Catch2/extras/ParseAndAddCatchTests.cmake +++ b/third_party/Catch2/extras/ParseAndAddCatchTests.cmake @@ -187,7 +187,7 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget) if(result) set(HiddenTagFound ON) break() - endif(result) + endif() endforeach(label) if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9") ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label") diff --git a/third_party/Catch2/extras/catch_amalgamated.cpp b/third_party/Catch2/extras/catch_amalgamated.cpp index 30e2d9f2..6aa67884 100644 --- a/third_party/Catch2/extras/catch_amalgamated.cpp +++ b/third_party/Catch2/extras/catch_amalgamated.cpp @@ -6,8 +6,8 @@ // SPDX-License-Identifier: BSL-1.0 -// Catch v3.5.1 -// Generated: 2023-12-31 15:10:55.864983 +// Catch v3.5.4 +// Generated: 2024-04-10 12:03:46.281848 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -101,8 +101,8 @@ namespace Catch { FDuration mean = FDuration(0); int i = 0; for (auto it = first; it < last; ++it, ++i) { - samples.push_back(FDuration(*it)); - mean += FDuration(*it); + samples.push_back(*it); + mean += *it; } mean /= i; @@ -187,21 +187,16 @@ namespace Catch { double const* last, Estimator& estimator ) { auto n = static_cast( last - first ); - std::uniform_int_distribution dist( 0, - n - 1 ); + Catch::uniform_integer_distribution dist( 0, n - 1 ); sample out; out.reserve( resamples ); - // We allocate the vector outside the loop to avoid realloc - // per resample std::vector resampled; resampled.reserve( n ); for ( size_t i = 0; i < resamples; ++i ) { resampled.clear(); for ( size_t s = 0; s < n; ++s ) { - resampled.push_back( - first[static_cast( - dist( rng ) )] ); + resampled.push_back( first[dist( rng )] ); } const auto estimate = estimator( resampled.data(), resampled.data() + resampled.size() ); @@ -563,7 +558,7 @@ bool marginComparison(double lhs, double rhs, double margin) { namespace Catch { Approx::Approx ( double value ) - : m_epsilon( std::numeric_limits::epsilon()*100. ), + : m_epsilon( static_cast(std::numeric_limits::epsilon())*100. ), m_margin( 0.0 ), m_scale( 0.0 ), m_value( value ) @@ -812,14 +807,16 @@ namespace Catch { // Insert the default reporter if user hasn't asked for a specific one if ( m_data.reporterSpecifications.empty() ) { - m_data.reporterSpecifications.push_back( { #if defined( CATCH_CONFIG_DEFAULT_REPORTER ) - CATCH_CONFIG_DEFAULT_REPORTER, + const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER; #else - "console", + const auto default_spec = "console"; #endif - {}, {}, {} - } ); + auto parsed = parseReporterSpec(default_spec); + CATCH_ENFORCE( parsed, + "Cannot parse the provided default reporter spec: '" + << default_spec << '\'' ); + m_data.reporterSpecifications.push_back( std::move( *parsed ) ); } if ( enableBazelEnvSupport() ) { @@ -1043,6 +1040,7 @@ namespace Catch { m_messages.back().message += " := "; start = pos; } + default:; // noop } } assert(openings.empty() && "Mismatched openings"); @@ -1586,8 +1584,10 @@ namespace Catch { while (lastDot > 0 && filename[lastDot - 1] != '.') { --lastDot; } - --lastDot; + // In theory we could have filename without any extension in it + if ( lastDot == 0 ) { return StringRef(); } + --lastDot; size_t nameStart = lastDot; while (nameStart > 0 && filename[nameStart - 1] != '/' && filename[nameStart - 1] != '\\') { --nameStart; @@ -1971,13 +1971,13 @@ namespace Detail { } } // end unnamed namespace - std::string convertIntoString(StringRef string, bool escape_invisibles) { + std::string convertIntoString(StringRef string, bool escapeInvisibles) { std::string ret; // This is enough for the "don't escape invisibles" case, and a good // lower bound on the "escape invisibles" case. ret.reserve(string.size() + 2); - if (!escape_invisibles) { + if (!escapeInvisibles) { ret += '"'; ret += string; ret += '"'; @@ -2055,7 +2055,7 @@ std::string StringMaker::convert(char const* str) { return{ "{null string}" }; } } -std::string StringMaker::convert(char* str) { +std::string StringMaker::convert(char* str) { // NOLINT(readability-non-const-parameter) if (str) { return Detail::convertIntoString( str ); } else { @@ -2152,8 +2152,8 @@ std::string StringMaker::convert(signed char value) { std::string StringMaker::convert(char c) { return ::Catch::Detail::stringify(static_cast(c)); } -std::string StringMaker::convert(unsigned char c) { - return ::Catch::Detail::stringify(static_cast(c)); +std::string StringMaker::convert(unsigned char value) { + return ::Catch::Detail::stringify(static_cast(value)); } int StringMaker::precision = 5; @@ -2273,7 +2273,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 3, 5, 1, "", 0 ); + static Version version( 3, 5, 4, "", 0 ); return version; } @@ -3097,7 +3097,7 @@ namespace Catch { line = trim(line); if( !line.empty() && !startsWith( line, '#' ) ) { if( !startsWith( line, '"' ) ) - line = '"' + line + '"'; + line = '"' + CATCH_MOVE(line) + '"'; config.testsOrTags.push_back( line ); config.testsOrTags.emplace_back( "," ); } @@ -3578,21 +3578,21 @@ namespace { namespace Catch { - Detail::unique_ptr makeColourImpl( ColourMode implSelection, + Detail::unique_ptr makeColourImpl( ColourMode colourSelection, IStream* stream ) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) - if ( implSelection == ColourMode::Win32 ) { + if ( colourSelection == ColourMode::Win32 ) { return Detail::make_unique( stream ); } #endif - if ( implSelection == ColourMode::ANSI ) { + if ( colourSelection == ColourMode::ANSI ) { return Detail::make_unique( stream ); } - if ( implSelection == ColourMode::None ) { + if ( colourSelection == ColourMode::None ) { return Detail::make_unique( stream ); } - if ( implSelection == ColourMode::PlatformDefault) { + if ( colourSelection == ColourMode::PlatformDefault) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) if ( Win32ColourImpl::useImplementationForStream( *stream ) ) { return Detail::make_unique( stream ); @@ -3604,7 +3604,7 @@ namespace Catch { return Detail::make_unique( stream ); } - CATCH_ERROR( "Could not create colour impl for selection " << static_cast(implSelection) ); + CATCH_ERROR( "Could not create colour impl for selection " << static_cast(colourSelection) ); } bool isColourImplAvailable( ColourMode colourSelection ) { @@ -3812,7 +3812,12 @@ namespace Catch { namespace Catch { - ITransientExpression::~ITransientExpression() = default; + void ITransientExpression::streamReconstructedExpression( + std::ostream& os ) const { + // We can't make this function pure virtual to keep ITransientExpression + // constexpr, so we write error message instead + os << "Some class derived from ITransientExpression without overriding streamReconstructedExpression"; + } void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) { if( lhs.size() + rhs.size() < 40 && @@ -4380,7 +4385,6 @@ namespace Detail { CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << '\'' ); m_ofs << std::unitbuf; } - ~FileStream() override = default; public: // IStream std::ostream& stream() override { return m_ofs; @@ -4395,7 +4399,6 @@ namespace Detail { // Store the streambuf from cout up-front because // cout may get redirected when running tests CoutStream() : m_os( Catch::cout().rdbuf() ) {} - ~CoutStream() override = default; public: // IStream std::ostream& stream() override { return m_os; } @@ -4409,7 +4412,6 @@ namespace Detail { // Store the streambuf from cerr up-front because // cout may get redirected when running tests CerrStream(): m_os( Catch::cerr().rdbuf() ) {} - ~CerrStream() override = default; public: // IStream std::ostream& stream() override { return m_os; } @@ -4427,8 +4429,6 @@ namespace Detail { m_os( m_streamBuf.get() ) {} - ~DebugOutStream() override = default; - public: // IStream std::ostream& stream() override { return m_os; } }; @@ -4483,7 +4483,7 @@ namespace Catch { m_os{ os }, m_indent_level{ indent_level } { m_os << '{'; } - JsonObjectWriter::JsonObjectWriter( JsonObjectWriter&& source ): + JsonObjectWriter::JsonObjectWriter( JsonObjectWriter&& source ) noexcept: m_os{ source.m_os }, m_indent_level{ source.m_indent_level }, m_should_comma{ source.m_should_comma }, @@ -4514,7 +4514,7 @@ namespace Catch { m_os{ os }, m_indent_level{ indent_level } { m_os << '['; } - JsonArrayWriter::JsonArrayWriter( JsonArrayWriter&& source ): + JsonArrayWriter::JsonArrayWriter( JsonArrayWriter&& source ) noexcept: m_os{ source.m_os }, m_indent_level{ source.m_indent_level }, m_should_comma{ source.m_should_comma }, @@ -5293,7 +5293,7 @@ namespace Catch { auto kv = splitKVPair( parts[i] ); auto key = kv.key, value = kv.value; - if ( key.empty() || value.empty() ) { + if ( key.empty() || value.empty() ) { // NOLINT(bugprone-branch-clone) return {}; } else if ( key[0] == 'X' ) { // This is a reporter-specific option, we don't check these @@ -5441,7 +5441,6 @@ namespace Catch { TrackerContext& ctx, ITracker* parent ): TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ) {} - ~GeneratorTracker() override = default; static GeneratorTracker* acquire( TrackerContext& ctx, @@ -6308,17 +6307,29 @@ namespace Catch { } bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { - bool replaced = false; std::size_t i = str.find( replaceThis ); - while( i != std::string::npos ) { - replaced = true; - str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); - if( i < str.size()-withThis.size() ) - i = str.find( replaceThis, i+withThis.size() ); + if (i == std::string::npos) { + return false; + } + std::size_t copyBegin = 0; + std::string origStr = CATCH_MOVE(str); + str.clear(); + // There is at least one replacement, so reserve with the best guess + // we can make without actually counting the number of occurences. + str.reserve(origStr.size() - replaceThis.size() + withThis.size()); + do { + str.append(origStr, copyBegin, i-copyBegin ); + str += withThis; + copyBegin = i + replaceThis.size(); + if( copyBegin < origStr.size() ) + i = origStr.find( replaceThis, copyBegin ); else i = std::string::npos; + } while( i != std::string::npos ); + if ( copyBegin < origStr.size() ) { + str.append(origStr, copyBegin, origStr.size() ); } - return replaced; + return true; } std::vector splitStringRef( StringRef str, char delimiter ) { @@ -6592,6 +6603,8 @@ namespace Catch { return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); } + TestRegistry::~TestRegistry() = default; + void TestRegistry::registerTest(Detail::unique_ptr testInfo, Detail::unique_ptr testInvoker) { m_handles.emplace_back(testInfo.get(), testInvoker.get()); m_viewed_test_infos.push_back(testInfo.get()); @@ -8799,13 +8812,6 @@ findMax( std::size_t& i, std::size_t& j, std::size_t& k, std::size_t& l ) { return l; } -enum class Justification { Left, Right }; - -struct ColumnInfo { - std::string name; - std::size_t width; - Justification justification; -}; struct ColumnBreak {}; struct RowBreak {}; struct OutputFlush {}; @@ -8883,6 +8889,14 @@ class Duration { }; } // end anon namespace +enum class Justification { Left, Right }; + +struct ColumnInfo { + std::string name; + std::size_t width; + Justification justification; +}; + class TablePrinter { std::ostream& m_os; std::vector m_columnInfos; @@ -9109,8 +9123,8 @@ void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { m_stream << '\n' << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } -void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { - StreamingReporterBase::testRunStarting(_testInfo); +void ConsoleReporter::testRunStarting(TestRunInfo const& _testRunInfo) { + StreamingReporterBase::testRunStarting(_testRunInfo); if ( m_config->testSpec().hasFilters() ) { m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: " << m_config->testSpec() << '\n'; @@ -9263,8 +9277,7 @@ namespace Catch { namespace { struct BySectionInfo { BySectionInfo( SectionInfo const& other ): m_other( other ) {} - BySectionInfo( BySectionInfo const& other ): - m_other( other.m_other ) {} + BySectionInfo( BySectionInfo const& other ) = default; bool operator()( Detail::unique_ptr const& node ) const { @@ -9889,8 +9902,8 @@ namespace Catch { return "Outputs listings as JSON. Test listing is Work-in-Progress!"; } - void JsonReporter::testRunStarting( TestRunInfo const& testInfo ) { - StreamingReporterBase::testRunStarting( testInfo ); + void JsonReporter::testRunStarting( TestRunInfo const& runInfo ) { + StreamingReporterBase::testRunStarting( runInfo ); endListing(); assert( isInside( Writer::Object ) ); @@ -10188,7 +10201,7 @@ namespace Catch { static void normalizeNamespaceMarkers(std::string& str) { std::size_t pos = str.find( "::" ); - while ( pos != str.npos ) { + while ( pos != std::string::npos ) { str.replace( pos, 2, "." ); pos += 1; pos = str.find( "::", pos ); diff --git a/third_party/Catch2/extras/catch_amalgamated.hpp b/third_party/Catch2/extras/catch_amalgamated.hpp index 4f075857..7e75a5d1 100644 --- a/third_party/Catch2/extras/catch_amalgamated.hpp +++ b/third_party/Catch2/extras/catch_amalgamated.hpp @@ -6,8 +6,8 @@ // SPDX-License-Identifier: BSL-1.0 -// Catch v3.5.1 -// Generated: 2023-12-31 15:10:53.044176 +// Catch v3.5.4 +// Generated: 2024-04-10 12:03:45.785902 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -87,6 +87,9 @@ // See e.g.: // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html #ifdef __APPLE__ +# ifndef __has_extension +# define __has_extension(x) 0 +# endif # include # if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) @@ -114,14 +117,14 @@ #ifdef __cplusplus -# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) -# define CATCH_CPP14_OR_GREATER -# endif - # if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) # define CATCH_CPP17_OR_GREATER # endif +# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) +# define CATCH_CPP20_OR_GREATER +# endif + #endif // Only GCC compiler should be used in this block, so other compilers trying to @@ -762,8 +765,8 @@ namespace Catch { constexpr const_iterator end() const { return m_start + m_size; } - friend std::string& operator += (std::string& lhs, StringRef sr); - friend std::ostream& operator << (std::ostream& os, StringRef sr); + friend std::string& operator += (std::string& lhs, StringRef rhs); + friend std::ostream& operator << (std::ostream& os, StringRef str); friend std::string operator+(StringRef lhs, StringRef rhs); /** @@ -2696,11 +2699,11 @@ namespace Catch { }; template<> struct StringMaker { - static std::string convert(signed char c); + static std::string convert(signed char value); }; template<> struct StringMaker { - static std::string convert(unsigned char c); + static std::string convert(unsigned char value); }; template<> @@ -3766,7 +3769,7 @@ namespace Catch { bool benchmarkNoAnalysis = false; unsigned int benchmarkSamples = 100; double benchmarkConfidenceInterval = 0.95; - unsigned int benchmarkResamples = 100000; + unsigned int benchmarkResamples = 100'000; std::chrono::milliseconds::rep benchmarkWarmupTime = 100; Verbosity verbosity = Verbosity::Normal; @@ -4825,7 +4828,9 @@ namespace Catch { template friend Parser operator|( Parser const& p, T&& rhs ) { - return Parser( p ) |= CATCH_FORWARD(rhs); + Parser temp( p ); + temp |= rhs; + return temp; } template @@ -5145,6 +5150,86 @@ namespace Detail { #include #include +/** \file + * Why does decomposing look the way it does: + * + * Conceptually, decomposing is simple. We change `REQUIRE( a == b )` into + * `Decomposer{} <= a == b`, so that `Decomposer{} <= a` is evaluated first, + * and our custom operator is used for `a == b`, because `a` is transformed + * into `ExprLhs` and then into `BinaryExpr`. + * + * In practice, decomposing ends up a mess, because we have to support + * various fun things. + * + * 1) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with pointer constructor and deleted + * other constructors. Example: `REQUIRE((a <=> b) == 0)` in libstdc++ + * + * 2) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with consteval integer constructor. + * Example: `REQUIRE((a <=> b) == 0)` in current MSVC STL. + * + * 3) Types that have no linkage, and so we cannot form a reference to + * them. Example: some implementations of traits. + * + * 4) Starting with C++20, when the compiler sees `a == b`, it also uses + * `b == a` when constructing the overload set. For us this means that + * when the compiler handles `ExprLhs == b`, it also tries to resolve + * the overload set for `b == ExprLhs`. + * + * To accomodate these use cases, decomposer ended up rather complex. + * + * 1) These types are handled by adding SFINAE overloads to our comparison + * operators, checking whether `T == U` are comparable with the given + * operator, and if not, whether T (or U) are comparable with literal 0. + * If yes, the overload compares T (or U) with 0 literal inline in the + * definition. + * + * Note that for extra correctness, we check that the other type is + * either an `int` (literal 0 is captured as `int` by templates), or + * a `long` (some platforms use 0L for `NULL` and we want to support + * that for pointer comparisons). + * + * 2) For these types, `is_foo_comparable` is true, but letting + * them fall into the overload that actually does `T == int` causes + * compilation error. Handling them requires that the decomposition + * is `constexpr`, so that P2564R3 applies and the `consteval` from + * their accompanying magic type is propagated through the `constexpr` + * call stack. + * + * However this is not enough to handle these types automatically, + * because our default is to capture types by reference, to avoid + * runtime copies. While these references cannot become dangling, + * they outlive the constexpr context and thus the default capture + * path cannot be actually constexpr. + * + * The solution is to capture these types by value, by explicitly + * specializing `Catch::capture_by_value` for them. Catch2 provides + * specialization for `std::foo_ordering`s, but users can specialize + * the trait for their own types as well. + * + * 3) If a type has no linkage, we also cannot capture it by reference. + * The solution is once again to capture them by value. We handle + * the common cases by using `std::is_arithmetic` as the default + * for `Catch::capture_by_value`, but that is only a some-effort + * heuristic. But as with 2), users can specialize `capture_by_value` + * for their own types as needed. + * + * 4) To support C++20 and make the SFINAE on our decomposing operators + * work, the SFINAE has to happen in return type, rather than in + * a template type. This is due to our use of logical type traits + * (`conjunction`/`disjunction`/`negation`), that we use to workaround + * an issue in older (9-) versions of GCC. I still blame C++20 for + * this, because without the comparison order switching, the logical + * traits could still be used in template type. + * + * There are also other side concerns, e.g. supporting both `REQUIRE(a)` + * and `REQUIRE(a == b)`, or making `REQUIRE_THAT(a, IsEqual(b))` slot + * nicely into the same expression handling logic, but these are rather + * straightforward and add only a bit of complexity (e.g. common base + * class for decomposed expressions). + */ + #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4389) // '==' : signed/unsigned mismatch @@ -5162,8 +5247,39 @@ namespace Detail { # pragma GCC diagnostic ignored "-Wsign-compare" #endif +#if defined(CATCH_CPP20_OR_GREATER) && __has_include() +# include +# if defined( __cpp_lib_three_way_comparison ) && \ + __cpp_lib_three_way_comparison >= 201907L +# define CATCH_CONFIG_CPP20_COMPARE_OVERLOADS +# endif +#endif + namespace Catch { + namespace Detail { + // This was added in C++20, but we require only C++14 for now. + template + using RemoveCVRef_t = std::remove_cv_t>; + } + + // Note: There is nothing that stops us from extending this, + // e.g. to `std::is_scalar`, but the more encompassing + // traits are usually also more expensive. For now we + // keep this as it used to be and it can be changed later. + template + struct capture_by_value + : std::integral_constant{}> {}; + +#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS ) + template <> + struct capture_by_value : std::true_type {}; + template <> + struct capture_by_value : std::true_type {}; + template <> + struct capture_by_value : std::true_type {}; +#endif + template struct always_false : std::false_type {}; @@ -5172,11 +5288,12 @@ namespace Catch { bool m_result; public: - auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } - auto getResult() const -> bool { return m_result; } - virtual void streamReconstructedExpression( std::ostream &os ) const = 0; + constexpr auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } + constexpr auto getResult() const -> bool { return m_result; } + //! This function **has** to be overriden by the derived class. + virtual void streamReconstructedExpression( std::ostream& os ) const; - ITransientExpression( bool isBinaryExpression, bool result ) + constexpr ITransientExpression( bool isBinaryExpression, bool result ) : m_isBinaryExpression( isBinaryExpression ), m_result( result ) {} @@ -5185,14 +5302,13 @@ namespace Catch { ITransientExpression(ITransientExpression const&) = default; ITransientExpression& operator=(ITransientExpression const&) = default; - // We don't actually need a virtual destructor, but many static analysers - // complain if it's not here :-( - virtual ~ITransientExpression(); // = default; - friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) { expr.streamReconstructedExpression(out); return out; } + + protected: + ~ITransientExpression() = default; }; void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ); @@ -5209,7 +5325,7 @@ namespace Catch { } public: - BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) + constexpr BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) : ITransientExpression{ true, comparisonResult }, m_lhs( lhs ), m_op( op ), @@ -5282,7 +5398,7 @@ namespace Catch { } public: - explicit UnaryExpr( LhsT lhs ) + explicit constexpr UnaryExpr( LhsT lhs ) : ITransientExpression{ false, static_cast(lhs) }, m_lhs( lhs ) {} @@ -5293,31 +5409,31 @@ namespace Catch { class ExprLhs { LhsT m_lhs; public: - explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} + explicit constexpr ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} #define CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( id, op ) \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ Detail::conjunction, \ - Detail::negation>>>::value, \ + Detail::negation>>>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction, \ - std::is_arithmetic>::value, \ + capture_by_value>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation>, \ Detail::is_eq_0_comparable, \ @@ -5330,8 +5446,8 @@ namespace Catch { static_cast( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation>, \ Detail::is_eq_0_comparable, \ @@ -5348,29 +5464,30 @@ namespace Catch { #undef CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR + #define CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( id, op ) \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ Detail::conjunction, \ - Detail::negation>>>::value, \ + Detail::negation>>>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction, \ - std::is_arithmetic>::value, \ + capture_by_value>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation>, \ Detail::is_##id##_0_comparable, \ @@ -5381,8 +5498,8 @@ namespace Catch { static_cast( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation>, \ Detail::is_##id##_0_comparable, \ @@ -5402,17 +5519,17 @@ namespace Catch { #define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR( op ) \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ - !std::is_arithmetic>::value, \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ + !capture_by_value>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t::value, \ - BinaryExpr> { \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t::value, \ + BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } @@ -5437,19 +5554,22 @@ namespace Catch { "wrap the expression inside parentheses, or decompose it"); } - auto makeUnaryExpr() const -> UnaryExpr { + constexpr auto makeUnaryExpr() const -> UnaryExpr { return UnaryExpr{ m_lhs }; } }; struct Decomposer { - template>::value, int> = 0> - friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs { + template >::value, + int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs { return ExprLhs{ lhs }; } - template::value, int> = 0> - friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs { + template ::value, int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs { return ExprLhs{ value }; } }; @@ -5569,7 +5689,7 @@ namespace Catch { INTERNAL_CATCH_TRY { \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ - catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \ + catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); /* NOLINT(bugprone-chained-comparison) */ \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ INTERNAL_CATCH_REACT( catchAssertionHandler ) \ @@ -5784,7 +5904,9 @@ namespace Catch { namespace Detail { // Intentionally without linkage, as it should only be used as a dummy // symbol for static analysis. - int GetNewSectionHint(); + // The arguments are used as a dummy for checking warnings in the passed + // expressions. + int GetNewSectionHint( StringRef, const char* const = nullptr ); } // namespace Detail } // namespace Catch @@ -5795,7 +5917,8 @@ namespace Catch { CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ catchInternalSectionHint, \ - catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \ + catchInternalSectionHint = \ + Catch::Detail::GetNewSectionHint(__VA_ARGS__); \ catchInternalPreviousSectionHint == __LINE__ ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION @@ -5805,7 +5928,8 @@ namespace Catch { CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ catchInternalSectionHint, \ - catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \ + catchInternalSectionHint = Catch::Detail::GetNewSectionHint( \ + ( Catch::ReusableStringStream() << __VA_ARGS__ ).str()); \ catchInternalPreviousSectionHint == __LINE__ ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION @@ -5927,7 +6051,7 @@ struct AutoReg : Detail::NonCopyable { namespace Catch { namespace Detail { struct DummyUse { - DummyUse( void ( * )( int ) ); + DummyUse( void ( * )( int ), Catch::NameAndTags const& ); }; } // namespace Detail } // namespace Catch @@ -5939,18 +6063,18 @@ namespace Catch { // tests can compile. The redefined `TEST_CASE` shadows this with param. static int catchInternalSectionHint = 0; -# define INTERNAL_CATCH_TESTCASE2( fname ) \ +# define INTERNAL_CATCH_TESTCASE2( fname, ... ) \ static void fname( int ); \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ static const Catch::Detail::DummyUse INTERNAL_CATCH_UNIQUE_NAME( \ - dummyUser )( &(fname) ); \ + dummyUser )( &(fname), Catch::NameAndTags{ __VA_ARGS__ } ); \ CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ static void fname( [[maybe_unused]] int catchInternalSectionHint ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION # define INTERNAL_CATCH_TESTCASE( ... ) \ - INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ) ) + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ), __VA_ARGS__ ) #endif // CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT @@ -6933,7 +7057,7 @@ namespace Catch { struct TestCaseInfo : Detail::NonCopyable { TestCaseInfo(StringRef _className, - NameAndTags const& _tags, + NameAndTags const& _nameAndTags, SourceLineInfo const& _lineInfo); bool isHidden() const; @@ -7146,7 +7270,7 @@ namespace Catch { #define CATCH_VERSION_MAJOR 3 #define CATCH_VERSION_MINOR 5 -#define CATCH_VERSION_PATCH 1 +#define CATCH_VERSION_PATCH 4 #endif // CATCH_VERSION_MACROS_HPP_INCLUDED @@ -7304,12 +7428,6 @@ namespace Detail { } public: - ~IGenerator() override = default; - IGenerator() = default; - IGenerator(IGenerator const&) = default; - IGenerator& operator=(IGenerator const&) = default; - - // Returns the current element of the generator // // \Precondition The generator is either freshly constructed, @@ -7824,6 +7942,32 @@ namespace Catch { #include #include +// Note: We use the usual enable-disable-autodetect dance here even though +// we do not support these in CMake configuration options (yet?). +// It is highly unlikely that we will need to make these actually +// user-configurable, but this will make it simpler if weend up needing +// it, and it provides an escape hatch to the users who need it. +#if defined( __SIZEOF_INT128__ ) +# define CATCH_CONFIG_INTERNAL_UINT128 +#elif defined( _MSC_VER ) && ( defined( _WIN64 ) || defined( _M_ARM64 ) ) +# define CATCH_CONFIG_INTERNAL_MSVC_UMUL128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_UINT128 ) && \ + !defined( CATCH_CONFIG_NO_UINT128 ) && \ + !defined( CATCH_CONFIG_UINT128 ) +#define CATCH_CONFIG_UINT128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_NO_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_MSVC_UMUL128 ) +# define CATCH_CONFIG_MSVC_UMUL128 +# include +# pragma intrinsic( _umul128 ) +#endif + + namespace Catch { namespace Detail { @@ -7851,65 +7995,57 @@ namespace Catch { struct ExtendedMultResult { T upper; T lower; - friend bool operator==( ExtendedMultResult const& lhs, - ExtendedMultResult const& rhs ) { - return lhs.upper == rhs.upper && lhs.lower == rhs.lower; + bool operator==( ExtendedMultResult const& rhs ) const { + return upper == rhs.upper && lower == rhs.lower; } }; - // Returns 128 bit result of multiplying lhs and rhs + /** + * Returns 128 bit result of lhs * rhs using portable C++ code + * + * This implementation is almost twice as fast as naive long multiplication, + * and unlike intrinsic-based approach, it supports constexpr evaluation. + */ constexpr ExtendedMultResult - extendedMult( std::uint64_t lhs, std::uint64_t rhs ) { - // We use the simple long multiplication approach for - // correctness, we can use platform specific builtins - // for performance later. - - // Split the lhs and rhs into two 32bit "digits", so that we can - // do 64 bit arithmetic to handle carry bits. - // 32b 32b 32b 32b - // lhs L1 L2 - // * rhs R1 R2 - // ------------------------ - // | R2 * L2 | - // | R2 * L1 | - // | R1 * L2 | - // | R1 * L1 | - // ------------------------- - // | a | b | c | d | - + extendedMultPortable(std::uint64_t lhs, std::uint64_t rhs) { #define CarryBits( x ) ( x >> 32 ) #define Digits( x ) ( x & 0xFF'FF'FF'FF ) - - auto r2l2 = Digits( rhs ) * Digits( lhs ); - auto r2l1 = Digits( rhs ) * CarryBits( lhs ); - auto r1l2 = CarryBits( rhs ) * Digits( lhs ); - auto r1l1 = CarryBits( rhs ) * CarryBits( lhs ); - - // Sum to columns first - auto d = Digits( r2l2 ); - auto c = CarryBits( r2l2 ) + Digits( r2l1 ) + Digits( r1l2 ); - auto b = CarryBits( r2l1 ) + CarryBits( r1l2 ) + Digits( r1l1 ); - auto a = CarryBits( r1l1 ); - - // Propagate carries between columns - c += CarryBits( d ); - b += CarryBits( c ); - a += CarryBits( b ); - - // Remove the used carries - c = Digits( c ); - b = Digits( b ); - a = Digits( a ); - + std::uint64_t lhs_low = Digits( lhs ); + std::uint64_t rhs_low = Digits( rhs ); + std::uint64_t low_low = ( lhs_low * rhs_low ); + std::uint64_t high_high = CarryBits( lhs ) * CarryBits( rhs ); + + // We add in carry bits from low-low already + std::uint64_t high_low = + ( CarryBits( lhs ) * rhs_low ) + CarryBits( low_low ); + // Note that we can add only low bits from high_low, to avoid + // overflow with large inputs + std::uint64_t low_high = + ( lhs_low * CarryBits( rhs ) ) + Digits( high_low ); + + return { high_high + CarryBits( high_low ) + CarryBits( low_high ), + ( low_high << 32 ) | Digits( low_low ) }; #undef CarryBits #undef Digits + } - return { - a << 32 | b, // upper 64 bits - c << 32 | d // lower 64 bits - }; + //! Returns 128 bit result of lhs * rhs + inline ExtendedMultResult + extendedMult( std::uint64_t lhs, std::uint64_t rhs ) { +#if defined( CATCH_CONFIG_UINT128 ) + auto result = __uint128_t( lhs ) * __uint128_t( rhs ); + return { static_cast( result >> 64 ), + static_cast( result ) }; +#elif defined( CATCH_CONFIG_MSVC_UMUL128 ) + std::uint64_t high; + std::uint64_t low = _umul128( lhs, rhs, &high ); + return { high, low }; +#else + return extendedMultPortable( lhs, rhs ); +#endif } + template constexpr ExtendedMultResult extendedMult( UInt lhs, UInt rhs ) { static_assert( std::is_unsigned::value, @@ -8013,22 +8149,6 @@ namespace Catch { namespace Catch { - namespace Detail { - // Indirection to enable make_unsigned behaviour. - template - struct make_unsigned { - using type = std::make_unsigned_t; - }; - - template <> - struct make_unsigned { - using type = uint8_t; - }; - - template - using make_unsigned_t = typename make_unsigned::type; - } - /** * Implementation of uniform distribution on integers. * @@ -8044,7 +8164,7 @@ template class uniform_integer_distribution { static_assert(std::is_integral::value, "..."); - using UnsignedIntegerType = Detail::make_unsigned_t; + using UnsignedIntegerType = Detail::SizedUnsignedType_t; // Only the left bound is stored, and we store it converted to its // unsigned image. This avoids having to do the conversions inside @@ -9326,7 +9446,7 @@ namespace Catch { std::vector> m_enumInfos; - EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector const& values) override; + EnumInfo const& registerEnum( StringRef enumName, StringRef allValueNames, std::vector const& values) override; }; std::vector parseEnums( StringRef enums ); @@ -9799,7 +9919,7 @@ namespace Catch { JsonObjectWriter( std::ostream& os ); JsonObjectWriter( std::ostream& os, std::uint64_t indent_level ); - JsonObjectWriter( JsonObjectWriter&& source ); + JsonObjectWriter( JsonObjectWriter&& source ) noexcept; JsonObjectWriter& operator=( JsonObjectWriter&& source ) = delete; ~JsonObjectWriter(); @@ -9818,7 +9938,7 @@ namespace Catch { JsonArrayWriter( std::ostream& os ); JsonArrayWriter( std::ostream& os, std::uint64_t indent_level ); - JsonArrayWriter( JsonArrayWriter&& source ); + JsonArrayWriter( JsonArrayWriter&& source ) noexcept; JsonArrayWriter& operator=( JsonArrayWriter&& source ) = delete; ~JsonArrayWriter(); @@ -10707,14 +10827,14 @@ namespace Catch { class TestRegistry : public ITestCaseRegistry { public: - ~TestRegistry() override = default; - void registerTest( Detail::unique_ptr testInfo, Detail::unique_ptr testInvoker ); std::vector const& getAllInfos() const override; std::vector const& getAllTests() const override; std::vector const& getAllTestsSorted( IConfig const& config ) const override; + ~TestRegistry() override; // = default + private: std::vector> m_owned_test_infos; // Keeps a materialized vector for `getAllInfos`. @@ -13376,8 +13496,6 @@ namespace Catch { public: JunitReporter(ReporterConfig&& _config); - ~JunitReporter() override = default; - static std::string getDescription(); void testRunStarting(TestRunInfo const& runInfo) override; @@ -13462,7 +13580,7 @@ namespace Catch { void assertionEnded( AssertionStats const& assertionStats ) override; void sectionEnded( SectionStats const& sectionStats ) override; - void testCasePartialEnded(TestCaseStats const& testInfo, uint64_t partNumber) override; + void testCasePartialEnded(TestCaseStats const& testStats, uint64_t partNumber) override; void testCaseEnded( TestCaseStats const& testCaseStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; @@ -13618,8 +13736,6 @@ namespace Catch { m_shouldStoreSuccesfulAssertions = false; } - ~SonarQubeReporter() override = default; - static std::string getDescription() { using namespace std::string_literals; return "Reports test results in the Generic Test Data SonarQube XML format"s; @@ -13632,7 +13748,7 @@ namespace Catch { xml.endElement(); } - void writeRun( TestRunNode const& groupNode ); + void writeRun( TestRunNode const& runNode ); void writeTestFile(StringRef filename, std::vector const& testCaseNodes); @@ -13666,7 +13782,6 @@ namespace Catch { StreamingReporterBase( CATCH_MOVE(config) ) { m_preferences.shouldReportAllAssertions = true; } - ~TAPReporter() override = default; static std::string getDescription() { using namespace std::string_literals; @@ -13718,8 +13833,8 @@ namespace Catch { return "Reports test results as TeamCity service messages"s; } - void testRunStarting( TestRunInfo const& groupInfo ) override; - void testRunEnded( TestRunStats const& testGroupStats ) override; + void testRunStarting( TestRunInfo const& runInfo ) override; + void testRunEnded( TestRunStats const& runStats ) override; void assertionEnded(AssertionStats const& assertionStats) override; diff --git a/third_party/Catch2/meson.build b/third_party/Catch2/meson.build index 75cb4183..7c216f96 100644 --- a/third_party/Catch2/meson.build +++ b/third_party/Catch2/meson.build @@ -8,7 +8,7 @@ project( 'catch2', 'cpp', - version: '3.5.1', # CML version placeholder, don't delete + version: '3.5.4', # CML version placeholder, don't delete license: 'BSL-1.0', meson_version: '>=0.54.1', ) diff --git a/third_party/Catch2/src/CMakeLists.txt b/third_party/Catch2/src/CMakeLists.txt index eb805ddd..28cd4e25 100644 --- a/third_party/Catch2/src/CMakeLists.txt +++ b/third_party/Catch2/src/CMakeLists.txt @@ -354,7 +354,7 @@ endif() add_library(Catch2::Catch2 ALIAS Catch2) if (ANDROID) - target_link_libraries(Catch2 INTERFACE log) + target_link_libraries(Catch2 PRIVATE log) endif() set_target_properties(Catch2 PROPERTIES @@ -362,29 +362,10 @@ set_target_properties(Catch2 PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION}) -# depend on bunch of C++11 and C++14 features to have C++14 enabled by default +# require C++14 target_compile_features(Catch2 PUBLIC - cxx_alignas - cxx_alignof - cxx_attributes - cxx_auto_type - cxx_constexpr - cxx_defaulted_functions - cxx_deleted_functions - cxx_final - cxx_lambdas - cxx_noexcept - cxx_override - cxx_range_for - cxx_rvalue_references - cxx_static_assert - cxx_strong_enums - cxx_trailing_return_types - cxx_unicode_literals - cxx_user_literals - cxx_variable_templates - cxx_variadic_macros + cxx_std_14 ) configure_file( @@ -475,26 +456,7 @@ if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS) ) target_compile_features(Catch2_buildall_interface INTERFACE - cxx_alignas - cxx_alignof - cxx_attributes - cxx_auto_type - cxx_constexpr - cxx_defaulted_functions - cxx_deleted_functions - cxx_final - cxx_lambdas - cxx_noexcept - cxx_override - cxx_range_for - cxx_rvalue_references - cxx_static_assert - cxx_strong_enums - cxx_trailing_return_types - cxx_unicode_literals - cxx_user_literals - cxx_variable_templates - cxx_variadic_macros + cxx_std_14 ) endif() diff --git a/third_party/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp b/third_party/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp index 7d27daf1..14d7f450 100644 --- a/third_party/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp +++ b/third_party/Catch2/src/catch2/benchmark/detail/catch_analyse.cpp @@ -63,8 +63,8 @@ namespace Catch { FDuration mean = FDuration(0); int i = 0; for (auto it = first; it < last; ++it, ++i) { - samples.push_back(FDuration(*it)); - mean += FDuration(*it); + samples.push_back(*it); + mean += *it; } mean /= i; diff --git a/third_party/Catch2/src/catch2/benchmark/detail/catch_stats.cpp b/third_party/Catch2/src/catch2/benchmark/detail/catch_stats.cpp index 2dd2d864..e6de359c 100644 --- a/third_party/Catch2/src/catch2/benchmark/detail/catch_stats.cpp +++ b/third_party/Catch2/src/catch2/benchmark/detail/catch_stats.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -38,21 +39,16 @@ namespace Catch { double const* last, Estimator& estimator ) { auto n = static_cast( last - first ); - std::uniform_int_distribution dist( 0, - n - 1 ); + Catch::uniform_integer_distribution dist( 0, n - 1 ); sample out; out.reserve( resamples ); - // We allocate the vector outside the loop to avoid realloc - // per resample std::vector resampled; resampled.reserve( n ); for ( size_t i = 0; i < resamples; ++i ) { resampled.clear(); for ( size_t s = 0; s < n; ++s ) { - resampled.push_back( - first[static_cast( - dist( rng ) )] ); + resampled.push_back( first[dist( rng )] ); } const auto estimate = estimator( resampled.data(), resampled.data() + resampled.size() ); diff --git a/third_party/Catch2/src/catch2/catch_approx.cpp b/third_party/Catch2/src/catch2/catch_approx.cpp index 9ad4ce3e..08c6799b 100644 --- a/third_party/Catch2/src/catch2/catch_approx.cpp +++ b/third_party/Catch2/src/catch2/catch_approx.cpp @@ -25,7 +25,7 @@ bool marginComparison(double lhs, double rhs, double margin) { namespace Catch { Approx::Approx ( double value ) - : m_epsilon( std::numeric_limits::epsilon()*100. ), + : m_epsilon( static_cast(std::numeric_limits::epsilon())*100. ), m_margin( 0.0 ), m_scale( 0.0 ), m_value( value ) diff --git a/third_party/Catch2/src/catch2/catch_config.cpp b/third_party/Catch2/src/catch2/catch_config.cpp index 34f50f17..352c1f42 100644 --- a/third_party/Catch2/src/catch2/catch_config.cpp +++ b/third_party/Catch2/src/catch2/catch_config.cpp @@ -107,14 +107,16 @@ namespace Catch { // Insert the default reporter if user hasn't asked for a specific one if ( m_data.reporterSpecifications.empty() ) { - m_data.reporterSpecifications.push_back( { #if defined( CATCH_CONFIG_DEFAULT_REPORTER ) - CATCH_CONFIG_DEFAULT_REPORTER, + const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER; #else - "console", + const auto default_spec = "console"; #endif - {}, {}, {} - } ); + auto parsed = parseReporterSpec(default_spec); + CATCH_ENFORCE( parsed, + "Cannot parse the provided default reporter spec: '" + << default_spec << '\'' ); + m_data.reporterSpecifications.push_back( std::move( *parsed ) ); } if ( enableBazelEnvSupport() ) { diff --git a/third_party/Catch2/src/catch2/catch_config.hpp b/third_party/Catch2/src/catch2/catch_config.hpp index 784de4aa..17e983e5 100644 --- a/third_party/Catch2/src/catch2/catch_config.hpp +++ b/third_party/Catch2/src/catch2/catch_config.hpp @@ -69,7 +69,7 @@ namespace Catch { bool benchmarkNoAnalysis = false; unsigned int benchmarkSamples = 100; double benchmarkConfidenceInterval = 0.95; - unsigned int benchmarkResamples = 100000; + unsigned int benchmarkResamples = 100'000; std::chrono::milliseconds::rep benchmarkWarmupTime = 100; Verbosity verbosity = Verbosity::Normal; diff --git a/third_party/Catch2/src/catch2/catch_message.cpp b/third_party/Catch2/src/catch2/catch_message.cpp index 384f180e..4b223d96 100644 --- a/third_party/Catch2/src/catch2/catch_message.cpp +++ b/third_party/Catch2/src/catch2/catch_message.cpp @@ -91,6 +91,7 @@ namespace Catch { m_messages.back().message += " := "; start = pos; } + default:; // noop } } assert(openings.empty() && "Mismatched openings"); diff --git a/third_party/Catch2/src/catch2/catch_registry_hub.cpp b/third_party/Catch2/src/catch2/catch_registry_hub.cpp index 8716db3a..3a594678 100644 --- a/third_party/Catch2/src/catch2/catch_registry_hub.cpp +++ b/third_party/Catch2/src/catch2/catch_registry_hub.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include diff --git a/third_party/Catch2/src/catch2/catch_test_case_info.cpp b/third_party/Catch2/src/catch2/catch_test_case_info.cpp index c38ee55a..2a4fbd33 100644 --- a/third_party/Catch2/src/catch2/catch_test_case_info.cpp +++ b/third_party/Catch2/src/catch2/catch_test_case_info.cpp @@ -85,8 +85,10 @@ namespace Catch { while (lastDot > 0 && filename[lastDot - 1] != '.') { --lastDot; } - --lastDot; + // In theory we could have filename without any extension in it + if ( lastDot == 0 ) { return StringRef(); } + --lastDot; size_t nameStart = lastDot; while (nameStart > 0 && filename[nameStart - 1] != '/' && filename[nameStart - 1] != '\\') { --nameStart; diff --git a/third_party/Catch2/src/catch2/catch_test_case_info.hpp b/third_party/Catch2/src/catch2/catch_test_case_info.hpp index a2f4b43e..da9927e7 100644 --- a/third_party/Catch2/src/catch2/catch_test_case_info.hpp +++ b/third_party/Catch2/src/catch2/catch_test_case_info.hpp @@ -68,7 +68,7 @@ namespace Catch { struct TestCaseInfo : Detail::NonCopyable { TestCaseInfo(StringRef _className, - NameAndTags const& _tags, + NameAndTags const& _nameAndTags, SourceLineInfo const& _lineInfo); bool isHidden() const; diff --git a/third_party/Catch2/src/catch2/catch_tostring.cpp b/third_party/Catch2/src/catch2/catch_tostring.cpp index b97cf560..b0b53c5e 100644 --- a/third_party/Catch2/src/catch2/catch_tostring.cpp +++ b/third_party/Catch2/src/catch2/catch_tostring.cpp @@ -54,13 +54,13 @@ namespace Detail { } } // end unnamed namespace - std::string convertIntoString(StringRef string, bool escape_invisibles) { + std::string convertIntoString(StringRef string, bool escapeInvisibles) { std::string ret; // This is enough for the "don't escape invisibles" case, and a good // lower bound on the "escape invisibles" case. ret.reserve(string.size() + 2); - if (!escape_invisibles) { + if (!escapeInvisibles) { ret += '"'; ret += string; ret += '"'; @@ -138,7 +138,7 @@ std::string StringMaker::convert(char const* str) { return{ "{null string}" }; } } -std::string StringMaker::convert(char* str) { +std::string StringMaker::convert(char* str) { // NOLINT(readability-non-const-parameter) if (str) { return Detail::convertIntoString( str ); } else { @@ -235,8 +235,8 @@ std::string StringMaker::convert(signed char value) { std::string StringMaker::convert(char c) { return ::Catch::Detail::stringify(static_cast(c)); } -std::string StringMaker::convert(unsigned char c) { - return ::Catch::Detail::stringify(static_cast(c)); +std::string StringMaker::convert(unsigned char value) { + return ::Catch::Detail::stringify(static_cast(value)); } int StringMaker::precision = 5; diff --git a/third_party/Catch2/src/catch2/catch_tostring.hpp b/third_party/Catch2/src/catch2/catch_tostring.hpp index f3fb0beb..67a7c1d2 100644 --- a/third_party/Catch2/src/catch2/catch_tostring.hpp +++ b/third_party/Catch2/src/catch2/catch_tostring.hpp @@ -279,11 +279,11 @@ namespace Catch { }; template<> struct StringMaker { - static std::string convert(signed char c); + static std::string convert(signed char value); }; template<> struct StringMaker { - static std::string convert(unsigned char c); + static std::string convert(unsigned char value); }; template<> diff --git a/third_party/Catch2/src/catch2/catch_version.cpp b/third_party/Catch2/src/catch2/catch_version.cpp index c56fb806..9e8765b3 100644 --- a/third_party/Catch2/src/catch2/catch_version.cpp +++ b/third_party/Catch2/src/catch2/catch_version.cpp @@ -36,7 +36,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 3, 5, 1, "", 0 ); + static Version version( 3, 5, 4, "", 0 ); return version; } diff --git a/third_party/Catch2/src/catch2/catch_version_macros.hpp b/third_party/Catch2/src/catch2/catch_version_macros.hpp index 6f41667c..ff50c09c 100644 --- a/third_party/Catch2/src/catch2/catch_version_macros.hpp +++ b/third_party/Catch2/src/catch2/catch_version_macros.hpp @@ -10,6 +10,6 @@ #define CATCH_VERSION_MAJOR 3 #define CATCH_VERSION_MINOR 5 -#define CATCH_VERSION_PATCH 1 +#define CATCH_VERSION_PATCH 4 #endif // CATCH_VERSION_MACROS_HPP_INCLUDED diff --git a/third_party/Catch2/src/catch2/generators/catch_generators.hpp b/third_party/Catch2/src/catch2/generators/catch_generators.hpp index 117f1901..0f35a996 100644 --- a/third_party/Catch2/src/catch2/generators/catch_generators.hpp +++ b/third_party/Catch2/src/catch2/generators/catch_generators.hpp @@ -37,12 +37,6 @@ namespace Detail { } public: - ~IGenerator() override = default; - IGenerator() = default; - IGenerator(IGenerator const&) = default; - IGenerator& operator=(IGenerator const&) = default; - - // Returns the current element of the generator // // \Precondition The generator is either freshly constructed, diff --git a/third_party/Catch2/src/catch2/internal/catch_clara.hpp b/third_party/Catch2/src/catch2/internal/catch_clara.hpp index b7001db2..d869593b 100644 --- a/third_party/Catch2/src/catch2/internal/catch_clara.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_clara.hpp @@ -673,7 +673,9 @@ namespace Catch { template friend Parser operator|( Parser const& p, T&& rhs ) { - return Parser( p ) |= CATCH_FORWARD(rhs); + Parser temp( p ); + temp |= rhs; + return temp; } template diff --git a/third_party/Catch2/src/catch2/internal/catch_commandline.cpp b/third_party/Catch2/src/catch2/internal/catch_commandline.cpp index c29a801d..212f1774 100644 --- a/third_party/Catch2/src/catch2/internal/catch_commandline.cpp +++ b/third_party/Catch2/src/catch2/internal/catch_commandline.cpp @@ -47,7 +47,7 @@ namespace Catch { line = trim(line); if( !line.empty() && !startsWith( line, '#' ) ) { if( !startsWith( line, '"' ) ) - line = '"' + line + '"'; + line = '"' + CATCH_MOVE(line) + '"'; config.testsOrTags.push_back( line ); config.testsOrTags.emplace_back( "," ); } diff --git a/third_party/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp b/third_party/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp index dacae01b..7f09da51 100644 --- a/third_party/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp @@ -29,14 +29,14 @@ #ifdef __cplusplus -# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) -# define CATCH_CPP14_OR_GREATER -# endif - # if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) # define CATCH_CPP17_OR_GREATER # endif +# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) +# define CATCH_CPP20_OR_GREATER +# endif + #endif // Only GCC compiler should be used in this block, so other compilers trying to diff --git a/third_party/Catch2/src/catch2/internal/catch_console_colour.cpp b/third_party/Catch2/src/catch2/internal/catch_console_colour.cpp index e1238816..b19e01ec 100644 --- a/third_party/Catch2/src/catch2/internal/catch_console_colour.cpp +++ b/third_party/Catch2/src/catch2/internal/catch_console_colour.cpp @@ -230,21 +230,21 @@ namespace { namespace Catch { - Detail::unique_ptr makeColourImpl( ColourMode implSelection, + Detail::unique_ptr makeColourImpl( ColourMode colourSelection, IStream* stream ) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) - if ( implSelection == ColourMode::Win32 ) { + if ( colourSelection == ColourMode::Win32 ) { return Detail::make_unique( stream ); } #endif - if ( implSelection == ColourMode::ANSI ) { + if ( colourSelection == ColourMode::ANSI ) { return Detail::make_unique( stream ); } - if ( implSelection == ColourMode::None ) { + if ( colourSelection == ColourMode::None ) { return Detail::make_unique( stream ); } - if ( implSelection == ColourMode::PlatformDefault) { + if ( colourSelection == ColourMode::PlatformDefault) { #if defined( CATCH_CONFIG_COLOUR_WIN32 ) if ( Win32ColourImpl::useImplementationForStream( *stream ) ) { return Detail::make_unique( stream ); @@ -256,7 +256,7 @@ namespace Catch { return Detail::make_unique( stream ); } - CATCH_ERROR( "Could not create colour impl for selection " << static_cast(implSelection) ); + CATCH_ERROR( "Could not create colour impl for selection " << static_cast(colourSelection) ); } bool isColourImplAvailable( ColourMode colourSelection ) { diff --git a/third_party/Catch2/src/catch2/internal/catch_decomposer.cpp b/third_party/Catch2/src/catch2/internal/catch_decomposer.cpp index 3f398fcc..17a7bc95 100644 --- a/third_party/Catch2/src/catch2/internal/catch_decomposer.cpp +++ b/third_party/Catch2/src/catch2/internal/catch_decomposer.cpp @@ -10,7 +10,12 @@ namespace Catch { - ITransientExpression::~ITransientExpression() = default; + void ITransientExpression::streamReconstructedExpression( + std::ostream& os ) const { + // We can't make this function pure virtual to keep ITransientExpression + // constexpr, so we write error message instead + os << "Some class derived from ITransientExpression without overriding streamReconstructedExpression"; + } void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) { if( lhs.size() + rhs.size() < 40 && diff --git a/third_party/Catch2/src/catch2/internal/catch_decomposer.hpp b/third_party/Catch2/src/catch2/internal/catch_decomposer.hpp index e0e46c1d..41365b70 100644 --- a/third_party/Catch2/src/catch2/internal/catch_decomposer.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_decomposer.hpp @@ -13,10 +13,91 @@ #include #include #include +#include #include #include +/** \file + * Why does decomposing look the way it does: + * + * Conceptually, decomposing is simple. We change `REQUIRE( a == b )` into + * `Decomposer{} <= a == b`, so that `Decomposer{} <= a` is evaluated first, + * and our custom operator is used for `a == b`, because `a` is transformed + * into `ExprLhs` and then into `BinaryExpr`. + * + * In practice, decomposing ends up a mess, because we have to support + * various fun things. + * + * 1) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with pointer constructor and deleted + * other constructors. Example: `REQUIRE((a <=> b) == 0)` in libstdc++ + * + * 2) Types that are only comparable with literal 0, and they do this by + * comparing against a magic type with consteval integer constructor. + * Example: `REQUIRE((a <=> b) == 0)` in current MSVC STL. + * + * 3) Types that have no linkage, and so we cannot form a reference to + * them. Example: some implementations of traits. + * + * 4) Starting with C++20, when the compiler sees `a == b`, it also uses + * `b == a` when constructing the overload set. For us this means that + * when the compiler handles `ExprLhs == b`, it also tries to resolve + * the overload set for `b == ExprLhs`. + * + * To accomodate these use cases, decomposer ended up rather complex. + * + * 1) These types are handled by adding SFINAE overloads to our comparison + * operators, checking whether `T == U` are comparable with the given + * operator, and if not, whether T (or U) are comparable with literal 0. + * If yes, the overload compares T (or U) with 0 literal inline in the + * definition. + * + * Note that for extra correctness, we check that the other type is + * either an `int` (literal 0 is captured as `int` by templates), or + * a `long` (some platforms use 0L for `NULL` and we want to support + * that for pointer comparisons). + * + * 2) For these types, `is_foo_comparable` is true, but letting + * them fall into the overload that actually does `T == int` causes + * compilation error. Handling them requires that the decomposition + * is `constexpr`, so that P2564R3 applies and the `consteval` from + * their accompanying magic type is propagated through the `constexpr` + * call stack. + * + * However this is not enough to handle these types automatically, + * because our default is to capture types by reference, to avoid + * runtime copies. While these references cannot become dangling, + * they outlive the constexpr context and thus the default capture + * path cannot be actually constexpr. + * + * The solution is to capture these types by value, by explicitly + * specializing `Catch::capture_by_value` for them. Catch2 provides + * specialization for `std::foo_ordering`s, but users can specialize + * the trait for their own types as well. + * + * 3) If a type has no linkage, we also cannot capture it by reference. + * The solution is once again to capture them by value. We handle + * the common cases by using `std::is_arithmetic` as the default + * for `Catch::capture_by_value`, but that is only a some-effort + * heuristic. But as with 2), users can specialize `capture_by_value` + * for their own types as needed. + * + * 4) To support C++20 and make the SFINAE on our decomposing operators + * work, the SFINAE has to happen in return type, rather than in + * a template type. This is due to our use of logical type traits + * (`conjunction`/`disjunction`/`negation`), that we use to workaround + * an issue in older (9-) versions of GCC. I still blame C++20 for + * this, because without the comparison order switching, the logical + * traits could still be used in template type. + * + * There are also other side concerns, e.g. supporting both `REQUIRE(a)` + * and `REQUIRE(a == b)`, or making `REQUIRE_THAT(a, IsEqual(b))` slot + * nicely into the same expression handling logic, but these are rather + * straightforward and add only a bit of complexity (e.g. common base + * class for decomposed expressions). + */ + #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4389) // '==' : signed/unsigned mismatch @@ -34,8 +115,39 @@ # pragma GCC diagnostic ignored "-Wsign-compare" #endif +#if defined(CATCH_CPP20_OR_GREATER) && __has_include() +# include +# if defined( __cpp_lib_three_way_comparison ) && \ + __cpp_lib_three_way_comparison >= 201907L +# define CATCH_CONFIG_CPP20_COMPARE_OVERLOADS +# endif +#endif + namespace Catch { + namespace Detail { + // This was added in C++20, but we require only C++14 for now. + template + using RemoveCVRef_t = std::remove_cv_t>; + } + + // Note: There is nothing that stops us from extending this, + // e.g. to `std::is_scalar`, but the more encompassing + // traits are usually also more expensive. For now we + // keep this as it used to be and it can be changed later. + template + struct capture_by_value + : std::integral_constant{}> {}; + +#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS ) + template <> + struct capture_by_value : std::true_type {}; + template <> + struct capture_by_value : std::true_type {}; + template <> + struct capture_by_value : std::true_type {}; +#endif + template struct always_false : std::false_type {}; @@ -44,11 +156,12 @@ namespace Catch { bool m_result; public: - auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } - auto getResult() const -> bool { return m_result; } - virtual void streamReconstructedExpression( std::ostream &os ) const = 0; + constexpr auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } + constexpr auto getResult() const -> bool { return m_result; } + //! This function **has** to be overriden by the derived class. + virtual void streamReconstructedExpression( std::ostream& os ) const; - ITransientExpression( bool isBinaryExpression, bool result ) + constexpr ITransientExpression( bool isBinaryExpression, bool result ) : m_isBinaryExpression( isBinaryExpression ), m_result( result ) {} @@ -57,14 +170,13 @@ namespace Catch { ITransientExpression(ITransientExpression const&) = default; ITransientExpression& operator=(ITransientExpression const&) = default; - // We don't actually need a virtual destructor, but many static analysers - // complain if it's not here :-( - virtual ~ITransientExpression(); // = default; - friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) { expr.streamReconstructedExpression(out); return out; } + + protected: + ~ITransientExpression() = default; }; void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ); @@ -81,7 +193,7 @@ namespace Catch { } public: - BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) + constexpr BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs ) : ITransientExpression{ true, comparisonResult }, m_lhs( lhs ), m_op( op ), @@ -154,7 +266,7 @@ namespace Catch { } public: - explicit UnaryExpr( LhsT lhs ) + explicit constexpr UnaryExpr( LhsT lhs ) : ITransientExpression{ false, static_cast(lhs) }, m_lhs( lhs ) {} @@ -165,31 +277,31 @@ namespace Catch { class ExprLhs { LhsT m_lhs; public: - explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} + explicit constexpr ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} #define CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR( id, op ) \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ Detail::conjunction, \ - Detail::negation>>>::value, \ + Detail::negation>>>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction, \ - std::is_arithmetic>::value, \ + capture_by_value>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation>, \ Detail::is_eq_0_comparable, \ @@ -202,8 +314,8 @@ namespace Catch { static_cast( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation>, \ Detail::is_eq_0_comparable, \ @@ -220,29 +332,30 @@ namespace Catch { #undef CATCH_INTERNAL_DEFINE_EXPRESSION_EQUALITY_OPERATOR + #define CATCH_INTERNAL_DEFINE_EXPRESSION_COMPARISON_OPERATOR( id, op ) \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ Detail::conjunction, \ - Detail::negation>>>::value, \ + Detail::negation>>>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction, \ - std::is_arithmetic>::value, \ + capture_by_value>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation>, \ Detail::is_##id##_0_comparable, \ @@ -253,8 +366,8 @@ namespace Catch { static_cast( lhs.m_lhs op 0 ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t< \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t< \ Detail::conjunction< \ Detail::negation>, \ Detail::is_##id##_0_comparable, \ @@ -274,17 +387,17 @@ namespace Catch { #define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR( op ) \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ - ->std::enable_if_t< \ - !std::is_arithmetic>::value, \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \ + -> std::enable_if_t< \ + !capture_by_value>::value, \ BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } \ template \ - friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ - ->std::enable_if_t::value, \ - BinaryExpr> { \ + constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \ + -> std::enable_if_t::value, \ + BinaryExpr> { \ return { \ static_cast( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \ } @@ -309,19 +422,22 @@ namespace Catch { "wrap the expression inside parentheses, or decompose it"); } - auto makeUnaryExpr() const -> UnaryExpr { + constexpr auto makeUnaryExpr() const -> UnaryExpr { return UnaryExpr{ m_lhs }; } }; struct Decomposer { - template>::value, int> = 0> - friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs { + template >::value, + int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs { return ExprLhs{ lhs }; } - template::value, int> = 0> - friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs { + template ::value, int> = 0> + constexpr friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs { return ExprLhs{ value }; } }; diff --git a/third_party/Catch2/src/catch2/internal/catch_enum_values_registry.hpp b/third_party/Catch2/src/catch2/internal/catch_enum_values_registry.hpp index 999059ae..de994c35 100644 --- a/third_party/Catch2/src/catch2/internal/catch_enum_values_registry.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_enum_values_registry.hpp @@ -24,7 +24,7 @@ namespace Catch { std::vector> m_enumInfos; - EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector const& values) override; + EnumInfo const& registerEnum( StringRef enumName, StringRef allValueNames, std::vector const& values) override; }; std::vector parseEnums( StringRef enums ); diff --git a/third_party/Catch2/src/catch2/internal/catch_istream.cpp b/third_party/Catch2/src/catch2/internal/catch_istream.cpp index bf0f66e4..2867ce74 100644 --- a/third_party/Catch2/src/catch2/internal/catch_istream.cpp +++ b/third_party/Catch2/src/catch2/internal/catch_istream.cpp @@ -80,7 +80,6 @@ namespace Detail { CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << '\'' ); m_ofs << std::unitbuf; } - ~FileStream() override = default; public: // IStream std::ostream& stream() override { return m_ofs; @@ -95,7 +94,6 @@ namespace Detail { // Store the streambuf from cout up-front because // cout may get redirected when running tests CoutStream() : m_os( Catch::cout().rdbuf() ) {} - ~CoutStream() override = default; public: // IStream std::ostream& stream() override { return m_os; } @@ -109,7 +107,6 @@ namespace Detail { // Store the streambuf from cerr up-front because // cout may get redirected when running tests CerrStream(): m_os( Catch::cerr().rdbuf() ) {} - ~CerrStream() override = default; public: // IStream std::ostream& stream() override { return m_os; } @@ -127,8 +124,6 @@ namespace Detail { m_os( m_streamBuf.get() ) {} - ~DebugOutStream() override = default; - public: // IStream std::ostream& stream() override { return m_os; } }; diff --git a/third_party/Catch2/src/catch2/internal/catch_jsonwriter.cpp b/third_party/Catch2/src/catch2/internal/catch_jsonwriter.cpp index ff65a9d3..1a96e348 100644 --- a/third_party/Catch2/src/catch2/internal/catch_jsonwriter.cpp +++ b/third_party/Catch2/src/catch2/internal/catch_jsonwriter.cpp @@ -31,7 +31,7 @@ namespace Catch { m_os{ os }, m_indent_level{ indent_level } { m_os << '{'; } - JsonObjectWriter::JsonObjectWriter( JsonObjectWriter&& source ): + JsonObjectWriter::JsonObjectWriter( JsonObjectWriter&& source ) noexcept: m_os{ source.m_os }, m_indent_level{ source.m_indent_level }, m_should_comma{ source.m_should_comma }, @@ -62,7 +62,7 @@ namespace Catch { m_os{ os }, m_indent_level{ indent_level } { m_os << '['; } - JsonArrayWriter::JsonArrayWriter( JsonArrayWriter&& source ): + JsonArrayWriter::JsonArrayWriter( JsonArrayWriter&& source ) noexcept: m_os{ source.m_os }, m_indent_level{ source.m_indent_level }, m_should_comma{ source.m_should_comma }, diff --git a/third_party/Catch2/src/catch2/internal/catch_jsonwriter.hpp b/third_party/Catch2/src/catch2/internal/catch_jsonwriter.hpp index 59c044e4..23b56d13 100644 --- a/third_party/Catch2/src/catch2/internal/catch_jsonwriter.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_jsonwriter.hpp @@ -65,7 +65,7 @@ namespace Catch { JsonObjectWriter( std::ostream& os ); JsonObjectWriter( std::ostream& os, std::uint64_t indent_level ); - JsonObjectWriter( JsonObjectWriter&& source ); + JsonObjectWriter( JsonObjectWriter&& source ) noexcept; JsonObjectWriter& operator=( JsonObjectWriter&& source ) = delete; ~JsonObjectWriter(); @@ -84,7 +84,7 @@ namespace Catch { JsonArrayWriter( std::ostream& os ); JsonArrayWriter( std::ostream& os, std::uint64_t indent_level ); - JsonArrayWriter( JsonArrayWriter&& source ); + JsonArrayWriter( JsonArrayWriter&& source ) noexcept; JsonArrayWriter& operator=( JsonArrayWriter&& source ) = delete; ~JsonArrayWriter(); diff --git a/third_party/Catch2/src/catch2/internal/catch_platform.hpp b/third_party/Catch2/src/catch2/internal/catch_platform.hpp index b11d9ccd..b653a58c 100644 --- a/third_party/Catch2/src/catch2/internal/catch_platform.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_platform.hpp @@ -11,6 +11,9 @@ // See e.g.: // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html #ifdef __APPLE__ +# ifndef __has_extension +# define __has_extension(x) 0 +# endif # include # if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) diff --git a/third_party/Catch2/src/catch2/internal/catch_random_integer_helpers.hpp b/third_party/Catch2/src/catch2/internal/catch_random_integer_helpers.hpp index 1c450f05..cb5e004f 100644 --- a/third_party/Catch2/src/catch2/internal/catch_random_integer_helpers.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_random_integer_helpers.hpp @@ -14,6 +14,34 @@ #include #include +// Note: We use the usual enable-disable-autodetect dance here even though +// we do not support these in CMake configuration options (yet?). +// It is highly unlikely that we will need to make these actually +// user-configurable, but this will make it simpler if weend up needing +// it, and it provides an escape hatch to the users who need it. +#if defined( __SIZEOF_INT128__ ) +# define CATCH_CONFIG_INTERNAL_UINT128 +// Unlike GCC, MSVC does not polyfill umul as mulh + mul pair on ARM machines. +// Currently we do not bother doing this ourselves, but we could if it became +// important for perf. +#elif defined( _MSC_VER ) && defined( _M_X64 ) +# define CATCH_CONFIG_INTERNAL_MSVC_UMUL128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_UINT128 ) && \ + !defined( CATCH_CONFIG_NO_UINT128 ) && \ + !defined( CATCH_CONFIG_UINT128 ) +#define CATCH_CONFIG_UINT128 +#endif + +#if defined( CATCH_CONFIG_INTERNAL_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_NO_MSVC_UMUL128 ) && \ + !defined( CATCH_CONFIG_MSVC_UMUL128 ) +# define CATCH_CONFIG_MSVC_UMUL128 +# include +#endif + + namespace Catch { namespace Detail { @@ -41,65 +69,57 @@ namespace Catch { struct ExtendedMultResult { T upper; T lower; - friend bool operator==( ExtendedMultResult const& lhs, - ExtendedMultResult const& rhs ) { - return lhs.upper == rhs.upper && lhs.lower == rhs.lower; + bool operator==( ExtendedMultResult const& rhs ) const { + return upper == rhs.upper && lower == rhs.lower; } }; - // Returns 128 bit result of multiplying lhs and rhs + /** + * Returns 128 bit result of lhs * rhs using portable C++ code + * + * This implementation is almost twice as fast as naive long multiplication, + * and unlike intrinsic-based approach, it supports constexpr evaluation. + */ constexpr ExtendedMultResult - extendedMult( std::uint64_t lhs, std::uint64_t rhs ) { - // We use the simple long multiplication approach for - // correctness, we can use platform specific builtins - // for performance later. - - // Split the lhs and rhs into two 32bit "digits", so that we can - // do 64 bit arithmetic to handle carry bits. - // 32b 32b 32b 32b - // lhs L1 L2 - // * rhs R1 R2 - // ------------------------ - // | R2 * L2 | - // | R2 * L1 | - // | R1 * L2 | - // | R1 * L1 | - // ------------------------- - // | a | b | c | d | - + extendedMultPortable(std::uint64_t lhs, std::uint64_t rhs) { #define CarryBits( x ) ( x >> 32 ) #define Digits( x ) ( x & 0xFF'FF'FF'FF ) - - auto r2l2 = Digits( rhs ) * Digits( lhs ); - auto r2l1 = Digits( rhs ) * CarryBits( lhs ); - auto r1l2 = CarryBits( rhs ) * Digits( lhs ); - auto r1l1 = CarryBits( rhs ) * CarryBits( lhs ); - - // Sum to columns first - auto d = Digits( r2l2 ); - auto c = CarryBits( r2l2 ) + Digits( r2l1 ) + Digits( r1l2 ); - auto b = CarryBits( r2l1 ) + CarryBits( r1l2 ) + Digits( r1l1 ); - auto a = CarryBits( r1l1 ); - - // Propagate carries between columns - c += CarryBits( d ); - b += CarryBits( c ); - a += CarryBits( b ); - - // Remove the used carries - c = Digits( c ); - b = Digits( b ); - a = Digits( a ); - + std::uint64_t lhs_low = Digits( lhs ); + std::uint64_t rhs_low = Digits( rhs ); + std::uint64_t low_low = ( lhs_low * rhs_low ); + std::uint64_t high_high = CarryBits( lhs ) * CarryBits( rhs ); + + // We add in carry bits from low-low already + std::uint64_t high_low = + ( CarryBits( lhs ) * rhs_low ) + CarryBits( low_low ); + // Note that we can add only low bits from high_low, to avoid + // overflow with large inputs + std::uint64_t low_high = + ( lhs_low * CarryBits( rhs ) ) + Digits( high_low ); + + return { high_high + CarryBits( high_low ) + CarryBits( low_high ), + ( low_high << 32 ) | Digits( low_low ) }; #undef CarryBits #undef Digits + } - return { - a << 32 | b, // upper 64 bits - c << 32 | d // lower 64 bits - }; + //! Returns 128 bit result of lhs * rhs + inline ExtendedMultResult + extendedMult( std::uint64_t lhs, std::uint64_t rhs ) { +#if defined( CATCH_CONFIG_UINT128 ) + auto result = __uint128_t( lhs ) * __uint128_t( rhs ); + return { static_cast( result >> 64 ), + static_cast( result ) }; +#elif defined( CATCH_CONFIG_MSVC_UMUL128 ) + std::uint64_t high; + std::uint64_t low = _umul128( lhs, rhs, &high ); + return { high, low }; +#else + return extendedMultPortable( lhs, rhs ); +#endif } + template constexpr ExtendedMultResult extendedMult( UInt lhs, UInt rhs ) { static_assert( std::is_unsigned::value, diff --git a/third_party/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp b/third_party/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp index 8b88b170..2b08758a 100644 --- a/third_party/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp +++ b/third_party/Catch2/src/catch2/internal/catch_reporter_spec_parser.cpp @@ -117,7 +117,7 @@ namespace Catch { auto kv = splitKVPair( parts[i] ); auto key = kv.key, value = kv.value; - if ( key.empty() || value.empty() ) { + if ( key.empty() || value.empty() ) { // NOLINT(bugprone-branch-clone) return {}; } else if ( key[0] == 'X' ) { // This is a reporter-specific option, we don't check these diff --git a/third_party/Catch2/src/catch2/internal/catch_run_context.cpp b/third_party/Catch2/src/catch2/internal/catch_run_context.cpp index e568100d..77b476d8 100644 --- a/third_party/Catch2/src/catch2/internal/catch_run_context.cpp +++ b/third_party/Catch2/src/catch2/internal/catch_run_context.cpp @@ -38,7 +38,6 @@ namespace Catch { TrackerContext& ctx, ITracker* parent ): TrackerBase( CATCH_MOVE( nameAndLocation ), ctx, parent ) {} - ~GeneratorTracker() override = default; static GeneratorTracker* acquire( TrackerContext& ctx, diff --git a/third_party/Catch2/src/catch2/internal/catch_section.hpp b/third_party/Catch2/src/catch2/internal/catch_section.hpp index 8c894eeb..e56c79f3 100644 --- a/third_party/Catch2/src/catch2/internal/catch_section.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_section.hpp @@ -69,7 +69,9 @@ namespace Catch { namespace Detail { // Intentionally without linkage, as it should only be used as a dummy // symbol for static analysis. - int GetNewSectionHint(); + // The arguments are used as a dummy for checking warnings in the passed + // expressions. + int GetNewSectionHint( StringRef, const char* const = nullptr ); } // namespace Detail } // namespace Catch @@ -80,7 +82,8 @@ namespace Catch { CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ catchInternalSectionHint, \ - catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \ + catchInternalSectionHint = \ + Catch::Detail::GetNewSectionHint(__VA_ARGS__); \ catchInternalPreviousSectionHint == __LINE__ ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION @@ -90,7 +93,8 @@ namespace Catch { CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \ catchInternalSectionHint, \ - catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \ + catchInternalSectionHint = Catch::Detail::GetNewSectionHint( \ + ( Catch::ReusableStringStream() << __VA_ARGS__ ).str()); \ catchInternalPreviousSectionHint == __LINE__ ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION diff --git a/third_party/Catch2/src/catch2/internal/catch_string_manip.cpp b/third_party/Catch2/src/catch2/internal/catch_string_manip.cpp index 0c889ca1..ce1abaa0 100644 --- a/third_party/Catch2/src/catch2/internal/catch_string_manip.cpp +++ b/third_party/Catch2/src/catch2/internal/catch_string_manip.cpp @@ -5,6 +5,7 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 +#include #include #include @@ -65,17 +66,29 @@ namespace Catch { } bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { - bool replaced = false; std::size_t i = str.find( replaceThis ); - while( i != std::string::npos ) { - replaced = true; - str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); - if( i < str.size()-withThis.size() ) - i = str.find( replaceThis, i+withThis.size() ); + if (i == std::string::npos) { + return false; + } + std::size_t copyBegin = 0; + std::string origStr = CATCH_MOVE(str); + str.clear(); + // There is at least one replacement, so reserve with the best guess + // we can make without actually counting the number of occurences. + str.reserve(origStr.size() - replaceThis.size() + withThis.size()); + do { + str.append(origStr, copyBegin, i-copyBegin ); + str += withThis; + copyBegin = i + replaceThis.size(); + if( copyBegin < origStr.size() ) + i = origStr.find( replaceThis, copyBegin ); else i = std::string::npos; + } while( i != std::string::npos ); + if ( copyBegin < origStr.size() ) { + str.append(origStr, copyBegin, origStr.size() ); } - return replaced; + return true; } std::vector splitStringRef( StringRef str, char delimiter ) { diff --git a/third_party/Catch2/src/catch2/internal/catch_stringref.hpp b/third_party/Catch2/src/catch2/internal/catch_stringref.hpp index 4b9212bf..421ce712 100644 --- a/third_party/Catch2/src/catch2/internal/catch_stringref.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_stringref.hpp @@ -97,8 +97,8 @@ namespace Catch { constexpr const_iterator end() const { return m_start + m_size; } - friend std::string& operator += (std::string& lhs, StringRef sr); - friend std::ostream& operator << (std::ostream& os, StringRef sr); + friend std::string& operator += (std::string& lhs, StringRef rhs); + friend std::ostream& operator << (std::ostream& os, StringRef str); friend std::string operator+(StringRef lhs, StringRef rhs); /** diff --git a/third_party/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp b/third_party/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp index c2b052da..e77e7bce 100644 --- a/third_party/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp +++ b/third_party/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp @@ -123,6 +123,8 @@ namespace Catch { return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); } + TestRegistry::~TestRegistry() = default; + void TestRegistry::registerTest(Detail::unique_ptr testInfo, Detail::unique_ptr testInvoker) { m_handles.emplace_back(testInfo.get(), testInvoker.get()); m_viewed_test_infos.push_back(testInfo.get()); diff --git a/third_party/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp b/third_party/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp index a4a27ed1..fbca89f9 100644 --- a/third_party/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp @@ -30,14 +30,14 @@ namespace Catch { class TestRegistry : public ITestCaseRegistry { public: - ~TestRegistry() override = default; - void registerTest( Detail::unique_ptr testInfo, Detail::unique_ptr testInvoker ); std::vector const& getAllInfos() const override; std::vector const& getAllTests() const override; std::vector const& getAllTestsSorted( IConfig const& config ) const override; + ~TestRegistry() override; // = default + private: std::vector> m_owned_test_infos; // Keeps a materialized vector for `getAllInfos`. diff --git a/third_party/Catch2/src/catch2/internal/catch_test_macro_impl.hpp b/third_party/Catch2/src/catch2/internal/catch_test_macro_impl.hpp index 59c851e8..0d95650f 100644 --- a/third_party/Catch2/src/catch2/internal/catch_test_macro_impl.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_test_macro_impl.hpp @@ -49,7 +49,7 @@ INTERNAL_CATCH_TRY { \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ - catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \ + catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); /* NOLINT(bugprone-chained-comparison) */ \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ INTERNAL_CATCH_REACT( catchAssertionHandler ) \ diff --git a/third_party/Catch2/src/catch2/internal/catch_test_registry.hpp b/third_party/Catch2/src/catch2/internal/catch_test_registry.hpp index 7766fe11..c62fbdcc 100644 --- a/third_party/Catch2/src/catch2/internal/catch_test_registry.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_test_registry.hpp @@ -95,7 +95,7 @@ struct AutoReg : Detail::NonCopyable { namespace Catch { namespace Detail { struct DummyUse { - DummyUse( void ( * )( int ) ); + DummyUse( void ( * )( int ), Catch::NameAndTags const& ); }; } // namespace Detail } // namespace Catch @@ -107,18 +107,18 @@ namespace Catch { // tests can compile. The redefined `TEST_CASE` shadows this with param. static int catchInternalSectionHint = 0; -# define INTERNAL_CATCH_TESTCASE2( fname ) \ +# define INTERNAL_CATCH_TESTCASE2( fname, ... ) \ static void fname( int ); \ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ static const Catch::Detail::DummyUse INTERNAL_CATCH_UNIQUE_NAME( \ - dummyUser )( &(fname) ); \ + dummyUser )( &(fname), Catch::NameAndTags{ __VA_ARGS__ } ); \ CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ static void fname( [[maybe_unused]] int catchInternalSectionHint ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION # define INTERNAL_CATCH_TESTCASE( ... ) \ - INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ) ) + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ), __VA_ARGS__ ) #endif // CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT diff --git a/third_party/Catch2/src/catch2/internal/catch_uniform_integer_distribution.hpp b/third_party/Catch2/src/catch2/internal/catch_uniform_integer_distribution.hpp index afa2015d..3332489a 100644 --- a/third_party/Catch2/src/catch2/internal/catch_uniform_integer_distribution.hpp +++ b/third_party/Catch2/src/catch2/internal/catch_uniform_integer_distribution.hpp @@ -13,22 +13,6 @@ namespace Catch { - namespace Detail { - // Indirection to enable make_unsigned behaviour. - template - struct make_unsigned { - using type = std::make_unsigned_t; - }; - - template <> - struct make_unsigned { - using type = uint8_t; - }; - - template - using make_unsigned_t = typename make_unsigned::type; - } - /** * Implementation of uniform distribution on integers. * @@ -44,7 +28,7 @@ template class uniform_integer_distribution { static_assert(std::is_integral::value, "..."); - using UnsignedIntegerType = Detail::make_unsigned_t; + using UnsignedIntegerType = Detail::SizedUnsignedType_t; // Only the left bound is stored, and we store it converted to its // unsigned image. This avoids having to do the conversions inside diff --git a/third_party/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp b/third_party/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp index 206332ef..fc7b444e 100644 --- a/third_party/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp +++ b/third_party/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp @@ -176,7 +176,7 @@ namespace Detail { std::string WithinRelMatcher::describe() const { Catch::ReusableStringStream sstr; - sstr << "and " << m_target << " are within " << m_epsilon * 100. << "% of each other"; + sstr << "and " << ::Catch::Detail::stringify(m_target) << " are within " << m_epsilon * 100. << "% of each other"; return sstr.str(); } diff --git a/third_party/Catch2/src/catch2/reporters/catch_reporter_console.cpp b/third_party/Catch2/src/catch2/reporters/catch_reporter_console.cpp index 81fc656f..c5678548 100644 --- a/third_party/Catch2/src/catch2/reporters/catch_reporter_console.cpp +++ b/third_party/Catch2/src/catch2/reporters/catch_reporter_console.cpp @@ -209,13 +209,6 @@ findMax( std::size_t& i, std::size_t& j, std::size_t& k, std::size_t& l ) { return l; } -enum class Justification { Left, Right }; - -struct ColumnInfo { - std::string name; - std::size_t width; - Justification justification; -}; struct ColumnBreak {}; struct RowBreak {}; struct OutputFlush {}; @@ -293,6 +286,14 @@ class Duration { }; } // end anon namespace +enum class Justification { Left, Right }; + +struct ColumnInfo { + std::string name; + std::size_t width; + Justification justification; +}; + class TablePrinter { std::ostream& m_os; std::vector m_columnInfos; @@ -519,8 +520,8 @@ void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { m_stream << '\n' << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } -void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { - StreamingReporterBase::testRunStarting(_testInfo); +void ConsoleReporter::testRunStarting(TestRunInfo const& _testRunInfo) { + StreamingReporterBase::testRunStarting(_testRunInfo); if ( m_config->testSpec().hasFilters() ) { m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: " << m_config->testSpec() << '\n'; diff --git a/third_party/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/third_party/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp index 5e106326..09169632 100644 --- a/third_party/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp +++ b/third_party/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp @@ -16,8 +16,7 @@ namespace Catch { namespace { struct BySectionInfo { BySectionInfo( SectionInfo const& other ): m_other( other ) {} - BySectionInfo( BySectionInfo const& other ): - m_other( other.m_other ) {} + BySectionInfo( BySectionInfo const& other ) = default; bool operator()( Detail::unique_ptr const& node ) const { diff --git a/third_party/Catch2/src/catch2/reporters/catch_reporter_json.cpp b/third_party/Catch2/src/catch2/reporters/catch_reporter_json.cpp index 1f0db8b0..6a8e655f 100644 --- a/third_party/Catch2/src/catch2/reporters/catch_reporter_json.cpp +++ b/third_party/Catch2/src/catch2/reporters/catch_reporter_json.cpp @@ -133,8 +133,8 @@ namespace Catch { return "Outputs listings as JSON. Test listing is Work-in-Progress!"; } - void JsonReporter::testRunStarting( TestRunInfo const& testInfo ) { - StreamingReporterBase::testRunStarting( testInfo ); + void JsonReporter::testRunStarting( TestRunInfo const& runInfo ) { + StreamingReporterBase::testRunStarting( runInfo ); endListing(); assert( isInside( Writer::Object ) ); diff --git a/third_party/Catch2/src/catch2/reporters/catch_reporter_junit.cpp b/third_party/Catch2/src/catch2/reporters/catch_reporter_junit.cpp index fc5cae34..4589365c 100644 --- a/third_party/Catch2/src/catch2/reporters/catch_reporter_junit.cpp +++ b/third_party/Catch2/src/catch2/reporters/catch_reporter_junit.cpp @@ -74,7 +74,7 @@ namespace Catch { static void normalizeNamespaceMarkers(std::string& str) { std::size_t pos = str.find( "::" ); - while ( pos != str.npos ) { + while ( pos != std::string::npos ) { str.replace( pos, 2, "." ); pos += 1; pos = str.find( "::", pos ); diff --git a/third_party/Catch2/src/catch2/reporters/catch_reporter_junit.hpp b/third_party/Catch2/src/catch2/reporters/catch_reporter_junit.hpp index 87c7c567..7cb53c25 100644 --- a/third_party/Catch2/src/catch2/reporters/catch_reporter_junit.hpp +++ b/third_party/Catch2/src/catch2/reporters/catch_reporter_junit.hpp @@ -19,8 +19,6 @@ namespace Catch { public: JunitReporter(ReporterConfig&& _config); - ~JunitReporter() override = default; - static std::string getDescription(); void testRunStarting(TestRunInfo const& runInfo) override; diff --git a/third_party/Catch2/src/catch2/reporters/catch_reporter_multi.hpp b/third_party/Catch2/src/catch2/reporters/catch_reporter_multi.hpp index c43f511f..66113837 100644 --- a/third_party/Catch2/src/catch2/reporters/catch_reporter_multi.hpp +++ b/third_party/Catch2/src/catch2/reporters/catch_reporter_multi.hpp @@ -53,7 +53,7 @@ namespace Catch { void assertionEnded( AssertionStats const& assertionStats ) override; void sectionEnded( SectionStats const& sectionStats ) override; - void testCasePartialEnded(TestCaseStats const& testInfo, uint64_t partNumber) override; + void testCasePartialEnded(TestCaseStats const& testStats, uint64_t partNumber) override; void testCaseEnded( TestCaseStats const& testCaseStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; diff --git a/third_party/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp b/third_party/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp index cad6deec..906578bb 100644 --- a/third_party/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp +++ b/third_party/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp @@ -25,8 +25,6 @@ namespace Catch { m_shouldStoreSuccesfulAssertions = false; } - ~SonarQubeReporter() override = default; - static std::string getDescription() { using namespace std::string_literals; return "Reports test results in the Generic Test Data SonarQube XML format"s; @@ -39,7 +37,7 @@ namespace Catch { xml.endElement(); } - void writeRun( TestRunNode const& groupNode ); + void writeRun( TestRunNode const& runNode ); void writeTestFile(StringRef filename, std::vector const& testCaseNodes); diff --git a/third_party/Catch2/src/catch2/reporters/catch_reporter_tap.hpp b/third_party/Catch2/src/catch2/reporters/catch_reporter_tap.hpp index fe45df63..e6889bb1 100644 --- a/third_party/Catch2/src/catch2/reporters/catch_reporter_tap.hpp +++ b/third_party/Catch2/src/catch2/reporters/catch_reporter_tap.hpp @@ -19,7 +19,6 @@ namespace Catch { StreamingReporterBase( CATCH_MOVE(config) ) { m_preferences.shouldReportAllAssertions = true; } - ~TAPReporter() override = default; static std::string getDescription() { using namespace std::string_literals; diff --git a/third_party/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp b/third_party/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp index 04feb2e6..662e9892 100644 --- a/third_party/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp +++ b/third_party/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp @@ -35,8 +35,8 @@ namespace Catch { return "Reports test results as TeamCity service messages"s; } - void testRunStarting( TestRunInfo const& groupInfo ) override; - void testRunEnded( TestRunStats const& testGroupStats ) override; + void testRunStarting( TestRunInfo const& runInfo ) override; + void testRunEnded( TestRunStats const& runStats ) override; void assertionEnded(AssertionStats const& assertionStats) override; diff --git a/third_party/Catch2/tests/CMakeLists.txt b/third_party/Catch2/tests/CMakeLists.txt index d3ab14a7..37a5977e 100644 --- a/third_party/Catch2/tests/CMakeLists.txt +++ b/third_party/Catch2/tests/CMakeLists.txt @@ -59,7 +59,7 @@ if (CATCH_BUILD_SURROGATES) ) target_link_libraries(Catch2SurrogateTarget PRIVATE Catch2WithMain) -endif(CATCH_BUILD_SURROGATES) +endif() #### # Temporary workaround for VS toolset changes in 2017 @@ -70,7 +70,7 @@ if (MSVC) configure_file(${CATCH_DIR}/tools/misc/SelfTest.vcxproj.user ${CMAKE_BINARY_DIR}/tests COPYONLY) -endif(MSVC) #Temporary workaround +endif() #Temporary workaround # define the sources of the self test diff --git a/third_party/Catch2/tests/ExtraTests/CMakeLists.txt b/third_party/Catch2/tests/ExtraTests/CMakeLists.txt index 2a810e25..8eaf3a56 100644 --- a/third_party/Catch2/tests/ExtraTests/CMakeLists.txt +++ b/third_party/Catch2/tests/ExtraTests/CMakeLists.txt @@ -183,7 +183,7 @@ if (NOT WIN32) PROPERTIES PASS_REGULAR_EXPRESSION "Catch will terminate" ) -endif(NOT WIN32) +endif() add_test(NAME CATCH_CONFIG_DISABLE_EXCEPTIONS-3 COMMAND DisabledExceptions-CustomHandler "Tests that run") @@ -556,6 +556,7 @@ add_executable(AmalgamatedTestCompilation ${CATCH_DIR}/extras/catch_amalgamated.cpp ) target_include_directories(AmalgamatedTestCompilation PRIVATE ${CATCH_DIR}/extras) +target_compile_features(AmalgamatedTestCompilation PRIVATE cxx_std_14) add_test(NAME AmalgamatedFileTest COMMAND AmalgamatedTestCompilation) set_tests_properties( diff --git a/third_party/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp b/third_party/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp index af03ce30..33399a68 100644 --- a/third_party/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp +++ b/third_party/Catch2/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp @@ -34,7 +34,7 @@ class CumulativeBenchmarkReporter final : public Catch::CumulativeReporterBase { return "Custom reporter for testing cumulative reporter base"; } - virtual void testRunEndedCumulative() override; + void testRunEndedCumulative() override; }; CATCH_REGISTER_REPORTER("testReporter", CumulativeBenchmarkReporter) diff --git a/third_party/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp b/third_party/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp index 9bd816ef..13d9fc18 100644 --- a/third_party/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp +++ b/third_party/Catch2/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp @@ -36,6 +36,7 @@ class TestReporter : public Catch::StreamingReporterBase { void testRunStarting( Catch::TestRunInfo const& ) override { std::vector> options; + options.reserve( m_customOptions.size() ); for ( auto const& kv : m_customOptions ) { options.push_back( kv ); } diff --git a/third_party/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp b/third_party/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp index c00462be..78d45a2c 100644 --- a/third_party/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp +++ b/third_party/Catch2/tests/ExtraTests/X91-AmalgamatedCatch.cpp @@ -16,10 +16,10 @@ TEST_CASE("Just a dummy test") { auto i = GENERATE(1, 2, 3); SECTION("a") { - REQUIRE(1 != 4); + REQUIRE(i != 4); } SECTION("b") { - CHECK(1 != 5); + CHECK(i != 5); } REQUIRE_THAT(1, Catch::Matchers::Predicate([](int i) { diff --git a/third_party/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt index 0669fdbb..a0d83496 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -350,20 +350,16 @@ Details.tests.cpp:: passed: lt( "a", "b" ) for: true Details.tests.cpp:: passed: lt( "a", "B" ) for: true Details.tests.cpp:: passed: lt( "A", "b" ) for: true Details.tests.cpp:: passed: lt( "A", "B" ) for: true -ToStringGeneral.tests.cpp:: passed: tab == '\t' for: '\t' == '\t' -ToStringGeneral.tests.cpp:: passed: newline == '\n' for: '\n' == '\n' -ToStringGeneral.tests.cpp:: passed: carr_return == '\r' for: '\r' == '\r' -ToStringGeneral.tests.cpp:: passed: form_feed == '\f' for: '\f' == '\f' -ToStringGeneral.tests.cpp:: passed: space == ' ' for: ' ' == ' ' -ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'a' == 'a' -ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'z' == 'z' -ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'A' == 'A' -ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'Z' == 'Z' -ToStringGeneral.tests.cpp:: passed: null_terminator == '\0' for: 0 == 0 -ToStringGeneral.tests.cpp:: passed: c == i for: 2 == 2 -ToStringGeneral.tests.cpp:: passed: c == i for: 3 == 3 -ToStringGeneral.tests.cpp:: passed: c == i for: 4 == 4 -ToStringGeneral.tests.cpp:: passed: c == i for: 5 == 5 +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify('\t') == "'\\t'" for: "'\t'" == "'\t'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify('\n') == "'\\n'" for: "'\n'" == "'\n'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify('\r') == "'\\r'" for: "'\r'" == "'\r'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify('\f') == "'\\f'" for: "'\f'" == "'\f'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( ' ' ) == "' '" for: "' '" == "' '" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( 'A' ) == "'A'" for: "'A'" == "'A'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( 'z' ) == "'z'" for: "'z'" == "'z'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( '\0' ) == "0" for: "0" == "0" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( static_cast(2) ) == "2" for: "2" == "2" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( static_cast(5) ) == "5" for: "5" == "5" Clara.tests.cpp:: passed: name.empty() for: true Clara.tests.cpp:: passed: name == "foo" for: "foo" == "foo" Clara.tests.cpp:: passed: !(parse_result) for: !{?} @@ -602,9 +598,9 @@ Misc.tests.cpp:: passed: Factorial(10) == 3628800 for: 3628800 (0x< GeneratorsImpl.tests.cpp:: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException Matchers.tests.cpp:: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other Matchers.tests.cpp:: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other -Matchers.tests.cpp:: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other -Matchers.tests.cpp:: passed: -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other -Matchers.tests.cpp:: passed: v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other +Matchers.tests.cpp:: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other +Matchers.tests.cpp:: passed: -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other +Matchers.tests.cpp:: passed: v1, WithinRel( v2 ) for: 0.0 and 0.0 are within 2.22045e-12% of each other Matchers.tests.cpp:: passed: 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0 Matchers.tests.cpp:: passed: 0., WithinAbs( 1., 1 ) for: 0.0 is within 1.0 of 1.0 Matchers.tests.cpp:: passed: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0 @@ -622,7 +618,7 @@ Matchers.tests.cpp:: passed: 1., WithinULP( 1., 0 ) for: 1.0 is wit Matchers.tests.cpp:: passed: -0., WithinULP( 0., 0 ) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00]) Matchers.tests.cpp:: passed: 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) ) Matchers.tests.cpp:: passed: 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) -Matchers.tests.cpp:: passed: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +Matchers.tests.cpp:: passed: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) Matchers.tests.cpp:: passed: WithinAbs( 1., 0. ) Matchers.tests.cpp:: passed: WithinAbs( 1., -1. ), std::domain_error Matchers.tests.cpp:: passed: WithinULP( 1., 0 ) @@ -630,11 +626,11 @@ Matchers.tests.cpp:: passed: WithinRel( 1., 0. ) Matchers.tests.cpp:: passed: WithinRel( 1., -0.2 ), std::domain_error Matchers.tests.cpp:: passed: WithinRel( 1., 1. ), std::domain_error Matchers.tests.cpp:: passed: 1., !IsNaN() for: 1.0 not is NaN -Matchers.tests.cpp:: passed: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other -Matchers.tests.cpp:: passed: 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other -Matchers.tests.cpp:: passed: 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other -Matchers.tests.cpp:: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other -Matchers.tests.cpp:: passed: v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other +Matchers.tests.cpp:: passed: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1000003815 are within 10% of each other +Matchers.tests.cpp:: passed: 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.1999998093 are within 10% of each other +Matchers.tests.cpp:: passed: 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.0 are within 99% of each other +Matchers.tests.cpp:: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other +Matchers.tests.cpp:: passed: v1, WithinRel( v2 ) for: 0.0f and 0.0 are within 0.00119209% of each other Matchers.tests.cpp:: passed: 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0 Matchers.tests.cpp:: passed: 0.f, WithinAbs( 1.f, 1 ) for: 0.0f is within 1.0 of 1.0 Matchers.tests.cpp:: passed: 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0 @@ -654,7 +650,7 @@ Matchers.tests.cpp:: passed: 1.f, WithinULP( 1.f, 0 ) for: 1.0f is Matchers.tests.cpp:: passed: -0.f, WithinULP( 0.f, 0 ) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) Matchers.tests.cpp:: passed: 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) ) Matchers.tests.cpp:: passed: 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) -Matchers.tests.cpp:: passed: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +Matchers.tests.cpp:: passed: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) Matchers.tests.cpp:: passed: WithinAbs( 1.f, 0.f ) Matchers.tests.cpp:: passed: WithinAbs( 1.f, -1.f ), std::domain_error Matchers.tests.cpp:: passed: WithinULP( 1.f, 0 ) @@ -1737,13 +1733,13 @@ Tag.tests.cpp:: passed: testCase.tags, VectorContains( Tag( "tag wi Class.tests.cpp:: passed: Template_Fixture::m_a == 1 for: 1 == 1 Class.tests.cpp:: passed: Template_Fixture::m_a == 1 for: 1 == 1 Class.tests.cpp:: passed: Template_Fixture::m_a == 1 for: 1.0 == 1 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 1 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 1 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 1 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 +Misc.tests.cpp:: passed: std::is_default_constructible::value for: true +Misc.tests.cpp:: passed: std::is_default_constructible::value for: true +Misc.tests.cpp:: passed: std::is_trivially_copyable::value for: true +Misc.tests.cpp:: passed: std::is_trivially_copyable::value for: true +Misc.tests.cpp:: passed: std::is_arithmetic::value for: true +Misc.tests.cpp:: passed: std::is_arithmetic::value for: true +Misc.tests.cpp:: passed: std::is_arithmetic::value for: true Misc.tests.cpp:: passed: v.size() == 5 for: 5 == 5 Misc.tests.cpp:: passed: v.capacity() >= 5 for: 5 >= 5 Misc.tests.cpp:: passed: v.size() == 10 for: 10 == 10 @@ -2483,6 +2479,10 @@ StringManip.tests.cpp:: passed: Catch::replaceInPlace(letters, lett StringManip.tests.cpp:: passed: letters == "replaced" for: "replaced" == "replaced" StringManip.tests.cpp:: passed: !(Catch::replaceInPlace(letters, "x", "z")) for: !false StringManip.tests.cpp:: passed: letters == letters for: "abcdefcg" == "abcdefcg" +StringManip.tests.cpp:: passed: Catch::replaceInPlace(letters, "c", "cc") for: true +StringManip.tests.cpp:: passed: letters == "abccdefccg" for: "abccdefccg" == "abccdefccg" +StringManip.tests.cpp:: passed: Catch::replaceInPlace(s, "--", "-") for: true +StringManip.tests.cpp:: passed: s == "--" for: "--" == "--" StringManip.tests.cpp:: passed: Catch::replaceInPlace(s, "'", "|'") for: true StringManip.tests.cpp:: passed: s == "didn|'t" for: "didn|'t" == "didn|'t" Stream.tests.cpp:: passed: Catch::makeStream( "%somestream" ) diff --git a/third_party/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index 214fef74..40083820 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -348,20 +348,16 @@ Details.tests.cpp:: passed: lt( "a", "b" ) for: true Details.tests.cpp:: passed: lt( "a", "B" ) for: true Details.tests.cpp:: passed: lt( "A", "b" ) for: true Details.tests.cpp:: passed: lt( "A", "B" ) for: true -ToStringGeneral.tests.cpp:: passed: tab == '\t' for: '\t' == '\t' -ToStringGeneral.tests.cpp:: passed: newline == '\n' for: '\n' == '\n' -ToStringGeneral.tests.cpp:: passed: carr_return == '\r' for: '\r' == '\r' -ToStringGeneral.tests.cpp:: passed: form_feed == '\f' for: '\f' == '\f' -ToStringGeneral.tests.cpp:: passed: space == ' ' for: ' ' == ' ' -ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'a' == 'a' -ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'z' == 'z' -ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'A' == 'A' -ToStringGeneral.tests.cpp:: passed: c == chars[i] for: 'Z' == 'Z' -ToStringGeneral.tests.cpp:: passed: null_terminator == '\0' for: 0 == 0 -ToStringGeneral.tests.cpp:: passed: c == i for: 2 == 2 -ToStringGeneral.tests.cpp:: passed: c == i for: 3 == 3 -ToStringGeneral.tests.cpp:: passed: c == i for: 4 == 4 -ToStringGeneral.tests.cpp:: passed: c == i for: 5 == 5 +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify('\t') == "'\\t'" for: "'\t'" == "'\t'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify('\n') == "'\\n'" for: "'\n'" == "'\n'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify('\r') == "'\\r'" for: "'\r'" == "'\r'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify('\f') == "'\\f'" for: "'\f'" == "'\f'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( ' ' ) == "' '" for: "' '" == "' '" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( 'A' ) == "'A'" for: "'A'" == "'A'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( 'z' ) == "'z'" for: "'z'" == "'z'" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( '\0' ) == "0" for: "0" == "0" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( static_cast(2) ) == "2" for: "2" == "2" +ToStringGeneral.tests.cpp:: passed: ::Catch::Detail::stringify( static_cast(5) ) == "5" for: "5" == "5" Clara.tests.cpp:: passed: name.empty() for: true Clara.tests.cpp:: passed: name == "foo" for: "foo" == "foo" Clara.tests.cpp:: passed: !(parse_result) for: !{?} @@ -600,9 +596,9 @@ Misc.tests.cpp:: passed: Factorial(10) == 3628800 for: 3628800 (0x< GeneratorsImpl.tests.cpp:: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException Matchers.tests.cpp:: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other Matchers.tests.cpp:: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other -Matchers.tests.cpp:: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other -Matchers.tests.cpp:: passed: -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other -Matchers.tests.cpp:: passed: v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other +Matchers.tests.cpp:: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other +Matchers.tests.cpp:: passed: -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other +Matchers.tests.cpp:: passed: v1, WithinRel( v2 ) for: 0.0 and 0.0 are within 2.22045e-12% of each other Matchers.tests.cpp:: passed: 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0 Matchers.tests.cpp:: passed: 0., WithinAbs( 1., 1 ) for: 0.0 is within 1.0 of 1.0 Matchers.tests.cpp:: passed: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0 @@ -620,7 +616,7 @@ Matchers.tests.cpp:: passed: 1., WithinULP( 1., 0 ) for: 1.0 is wit Matchers.tests.cpp:: passed: -0., WithinULP( 0., 0 ) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00]) Matchers.tests.cpp:: passed: 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) ) Matchers.tests.cpp:: passed: 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) -Matchers.tests.cpp:: passed: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +Matchers.tests.cpp:: passed: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) Matchers.tests.cpp:: passed: WithinAbs( 1., 0. ) Matchers.tests.cpp:: passed: WithinAbs( 1., -1. ), std::domain_error Matchers.tests.cpp:: passed: WithinULP( 1., 0 ) @@ -628,11 +624,11 @@ Matchers.tests.cpp:: passed: WithinRel( 1., 0. ) Matchers.tests.cpp:: passed: WithinRel( 1., -0.2 ), std::domain_error Matchers.tests.cpp:: passed: WithinRel( 1., 1. ), std::domain_error Matchers.tests.cpp:: passed: 1., !IsNaN() for: 1.0 not is NaN -Matchers.tests.cpp:: passed: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other -Matchers.tests.cpp:: passed: 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other -Matchers.tests.cpp:: passed: 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other -Matchers.tests.cpp:: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other -Matchers.tests.cpp:: passed: v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other +Matchers.tests.cpp:: passed: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1000003815 are within 10% of each other +Matchers.tests.cpp:: passed: 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.1999998093 are within 10% of each other +Matchers.tests.cpp:: passed: 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.0 are within 99% of each other +Matchers.tests.cpp:: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other +Matchers.tests.cpp:: passed: v1, WithinRel( v2 ) for: 0.0f and 0.0 are within 0.00119209% of each other Matchers.tests.cpp:: passed: 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0 Matchers.tests.cpp:: passed: 0.f, WithinAbs( 1.f, 1 ) for: 0.0f is within 1.0 of 1.0 Matchers.tests.cpp:: passed: 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0 @@ -652,7 +648,7 @@ Matchers.tests.cpp:: passed: 1.f, WithinULP( 1.f, 0 ) for: 1.0f is Matchers.tests.cpp:: passed: -0.f, WithinULP( 0.f, 0 ) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) Matchers.tests.cpp:: passed: 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) ) Matchers.tests.cpp:: passed: 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) -Matchers.tests.cpp:: passed: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +Matchers.tests.cpp:: passed: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) Matchers.tests.cpp:: passed: WithinAbs( 1.f, 0.f ) Matchers.tests.cpp:: passed: WithinAbs( 1.f, -1.f ), std::domain_error Matchers.tests.cpp:: passed: WithinULP( 1.f, 0 ) @@ -1730,13 +1726,13 @@ Tag.tests.cpp:: passed: testCase.tags, VectorContains( Tag( "tag wi Class.tests.cpp:: passed: Template_Fixture::m_a == 1 for: 1 == 1 Class.tests.cpp:: passed: Template_Fixture::m_a == 1 for: 1 == 1 Class.tests.cpp:: passed: Template_Fixture::m_a == 1 for: 1.0 == 1 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 1 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 1 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 1 > 0 -Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 +Misc.tests.cpp:: passed: std::is_default_constructible::value for: true +Misc.tests.cpp:: passed: std::is_default_constructible::value for: true +Misc.tests.cpp:: passed: std::is_trivially_copyable::value for: true +Misc.tests.cpp:: passed: std::is_trivially_copyable::value for: true +Misc.tests.cpp:: passed: std::is_arithmetic::value for: true +Misc.tests.cpp:: passed: std::is_arithmetic::value for: true +Misc.tests.cpp:: passed: std::is_arithmetic::value for: true Misc.tests.cpp:: passed: v.size() == 5 for: 5 == 5 Misc.tests.cpp:: passed: v.capacity() >= 5 for: 5 >= 5 Misc.tests.cpp:: passed: v.size() == 10 for: 10 == 10 @@ -2472,6 +2468,10 @@ StringManip.tests.cpp:: passed: Catch::replaceInPlace(letters, lett StringManip.tests.cpp:: passed: letters == "replaced" for: "replaced" == "replaced" StringManip.tests.cpp:: passed: !(Catch::replaceInPlace(letters, "x", "z")) for: !false StringManip.tests.cpp:: passed: letters == letters for: "abcdefcg" == "abcdefcg" +StringManip.tests.cpp:: passed: Catch::replaceInPlace(letters, "c", "cc") for: true +StringManip.tests.cpp:: passed: letters == "abccdefccg" for: "abccdefccg" == "abccdefccg" +StringManip.tests.cpp:: passed: Catch::replaceInPlace(s, "--", "-") for: true +StringManip.tests.cpp:: passed: s == "--" for: "--" == "--" StringManip.tests.cpp:: passed: Catch::replaceInPlace(s, "'", "|'") for: true StringManip.tests.cpp:: passed: s == "didn|'t" for: "didn|'t" == "didn|'t" Stream.tests.cpp:: passed: Catch::makeStream( "%somestream" ) diff --git a/third_party/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt index 077b7bf7..2424ea11 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt @@ -2904,24 +2904,24 @@ ToStringGeneral.tests.cpp: ............................................................................... ToStringGeneral.tests.cpp:: PASSED: - CHECK( tab == '\t' ) + CHECK( ::Catch::Detail::stringify('\t') == "'\\t'" ) with expansion: - '\t' == '\t' + "'\t'" == "'\t'" ToStringGeneral.tests.cpp:: PASSED: - CHECK( newline == '\n' ) + CHECK( ::Catch::Detail::stringify('\n') == "'\\n'" ) with expansion: - '\n' == '\n' + "'\n'" == "'\n'" ToStringGeneral.tests.cpp:: PASSED: - CHECK( carr_return == '\r' ) + CHECK( ::Catch::Detail::stringify('\r') == "'\\r'" ) with expansion: - '\r' == '\r' + "'\r'" == "'\r'" ToStringGeneral.tests.cpp:: PASSED: - CHECK( form_feed == '\f' ) + CHECK( ::Catch::Detail::stringify('\f') == "'\\f'" ) with expansion: - '\f' == '\f' + "'\f'" == "'\f'" ------------------------------------------------------------------------------- Character pretty printing @@ -2931,29 +2931,19 @@ ToStringGeneral.tests.cpp: ............................................................................... ToStringGeneral.tests.cpp:: PASSED: - CHECK( space == ' ' ) + CHECK( ::Catch::Detail::stringify( ' ' ) == "' '" ) with expansion: - ' ' == ' ' + "' '" == "' '" ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == chars[i] ) + CHECK( ::Catch::Detail::stringify( 'A' ) == "'A'" ) with expansion: - 'a' == 'a' + "'A'" == "'A'" ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == chars[i] ) + CHECK( ::Catch::Detail::stringify( 'z' ) == "'z'" ) with expansion: - 'z' == 'z' - -ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == chars[i] ) -with expansion: - 'A' == 'A' - -ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == chars[i] ) -with expansion: - 'Z' == 'Z' + "'z'" == "'z'" ------------------------------------------------------------------------------- Character pretty printing @@ -2963,29 +2953,19 @@ ToStringGeneral.tests.cpp: ............................................................................... ToStringGeneral.tests.cpp:: PASSED: - CHECK( null_terminator == '\0' ) -with expansion: - 0 == 0 - -ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == i ) -with expansion: - 2 == 2 - -ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( '\0' ) == "0" ) with expansion: - 3 == 3 + "0" == "0" ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( static_cast(2) ) == "2" ) with expansion: - 4 == 4 + "2" == "2" ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( static_cast(5) ) == "5" ) with expansion: - 5 == 5 + "5" == "5" ------------------------------------------------------------------------------- Clara::Arg supports single-arg parse the way Opt does @@ -4507,12 +4487,12 @@ with expansion: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 1., !WithinRel( 0., 0.99 ) ) with expansion: - 1.0 not and 0 are within 99% of each other + 1.0 not and 0.0 are within 99% of each other Matchers.tests.cpp:: PASSED: REQUIRE_THAT( -0., WithinRel( 0. ) ) with expansion: - -0.0 and 0 are within 2.22045e-12% of each other + -0.0 and 0.0 are within 2.22045e-12% of each other ------------------------------------------------------------------------------- Floating point matchers: double @@ -4525,7 +4505,7 @@ Matchers.tests.cpp: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( v1, WithinRel( v2 ) ) with expansion: - 0.0 and 2.22507e-308 are within 2.22045e-12% of each other + 0.0 and 0.0 are within 2.22045e-12% of each other ------------------------------------------------------------------------------- Floating point matchers: double @@ -4645,7 +4625,7 @@ with expansion: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) ) with expansion: - 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) + 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) ------------------------------------------------------------------------------- Floating point matchers: double @@ -4694,22 +4674,22 @@ Matchers.tests.cpp: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 10.f, WithinRel( 11.1f, 0.1f ) ) with expansion: - 10.0f and 11.1 are within 10% of each other + 10.0f and 11.1000003815 are within 10% of each other Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 10.f, !WithinRel( 11.2f, 0.1f ) ) with expansion: - 10.0f not and 11.2 are within 10% of each other + 10.0f not and 11.1999998093 are within 10% of each other Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 1.f, !WithinRel( 0.f, 0.99f ) ) with expansion: - 1.0f not and 0 are within 99% of each other + 1.0f not and 0.0 are within 99% of each other Matchers.tests.cpp:: PASSED: REQUIRE_THAT( -0.f, WithinRel( 0.f ) ) with expansion: - -0.0f and 0 are within 0.00119209% of each other + -0.0f and 0.0 are within 0.00119209% of each other ------------------------------------------------------------------------------- Floating point matchers: float @@ -4722,7 +4702,7 @@ Matchers.tests.cpp: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( v1, WithinRel( v2 ) ) with expansion: - 0.0f and 1.17549e-38 are within 0.00119209% of each other + 0.0f and 0.0 are within 0.00119209% of each other ------------------------------------------------------------------------------- Floating point matchers: float @@ -4847,7 +4827,7 @@ with expansion: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) ) with expansion: - 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) + 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) ------------------------------------------------------------------------------- Floating point matchers: float @@ -11675,9 +11655,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_default_constructible::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-copyable and non- @@ -11687,9 +11667,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_default_constructible::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-default-constructible @@ -11699,9 +11679,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_trivially_copyable::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-default-constructible @@ -11711,9 +11691,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_trivially_copyable::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 0 @@ -11722,9 +11702,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 1 @@ -11733,9 +11713,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 2 @@ -11744,9 +11724,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- TemplateTest: vectors can be sized and resized - float @@ -17309,6 +17289,42 @@ StringManip.tests.cpp:: PASSED: with expansion: "abcdefcg" == "abcdefcg" +------------------------------------------------------------------------------- +replaceInPlace + no replace in already-replaced string + lengthening +------------------------------------------------------------------------------- +StringManip.tests.cpp: +............................................................................... + +StringManip.tests.cpp:: PASSED: + CHECK( Catch::replaceInPlace(letters, "c", "cc") ) +with expansion: + true + +StringManip.tests.cpp:: PASSED: + CHECK( letters == "abccdefccg" ) +with expansion: + "abccdefccg" == "abccdefccg" + +------------------------------------------------------------------------------- +replaceInPlace + no replace in already-replaced string + shortening +------------------------------------------------------------------------------- +StringManip.tests.cpp: +............................................................................... + +StringManip.tests.cpp:: PASSED: + CHECK( Catch::replaceInPlace(s, "--", "-") ) +with expansion: + true + +StringManip.tests.cpp:: PASSED: + CHECK( s == "--" ) +with expansion: + "--" == "--" + ------------------------------------------------------------------------------- replaceInPlace escape ' diff --git a/third_party/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt index 5d204990..e8fd62f7 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -2902,24 +2902,24 @@ ToStringGeneral.tests.cpp: ............................................................................... ToStringGeneral.tests.cpp:: PASSED: - CHECK( tab == '\t' ) + CHECK( ::Catch::Detail::stringify('\t') == "'\\t'" ) with expansion: - '\t' == '\t' + "'\t'" == "'\t'" ToStringGeneral.tests.cpp:: PASSED: - CHECK( newline == '\n' ) + CHECK( ::Catch::Detail::stringify('\n') == "'\\n'" ) with expansion: - '\n' == '\n' + "'\n'" == "'\n'" ToStringGeneral.tests.cpp:: PASSED: - CHECK( carr_return == '\r' ) + CHECK( ::Catch::Detail::stringify('\r') == "'\\r'" ) with expansion: - '\r' == '\r' + "'\r'" == "'\r'" ToStringGeneral.tests.cpp:: PASSED: - CHECK( form_feed == '\f' ) + CHECK( ::Catch::Detail::stringify('\f') == "'\\f'" ) with expansion: - '\f' == '\f' + "'\f'" == "'\f'" ------------------------------------------------------------------------------- Character pretty printing @@ -2929,29 +2929,19 @@ ToStringGeneral.tests.cpp: ............................................................................... ToStringGeneral.tests.cpp:: PASSED: - CHECK( space == ' ' ) + CHECK( ::Catch::Detail::stringify( ' ' ) == "' '" ) with expansion: - ' ' == ' ' + "' '" == "' '" ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == chars[i] ) + CHECK( ::Catch::Detail::stringify( 'A' ) == "'A'" ) with expansion: - 'a' == 'a' + "'A'" == "'A'" ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == chars[i] ) + CHECK( ::Catch::Detail::stringify( 'z' ) == "'z'" ) with expansion: - 'z' == 'z' - -ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == chars[i] ) -with expansion: - 'A' == 'A' - -ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == chars[i] ) -with expansion: - 'Z' == 'Z' + "'z'" == "'z'" ------------------------------------------------------------------------------- Character pretty printing @@ -2961,29 +2951,19 @@ ToStringGeneral.tests.cpp: ............................................................................... ToStringGeneral.tests.cpp:: PASSED: - CHECK( null_terminator == '\0' ) -with expansion: - 0 == 0 - -ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == i ) -with expansion: - 2 == 2 - -ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( '\0' ) == "0" ) with expansion: - 3 == 3 + "0" == "0" ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( static_cast(2) ) == "2" ) with expansion: - 4 == 4 + "2" == "2" ToStringGeneral.tests.cpp:: PASSED: - REQUIRE( c == i ) + CHECK( ::Catch::Detail::stringify( static_cast(5) ) == "5" ) with expansion: - 5 == 5 + "5" == "5" ------------------------------------------------------------------------------- Clara::Arg supports single-arg parse the way Opt does @@ -4505,12 +4485,12 @@ with expansion: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 1., !WithinRel( 0., 0.99 ) ) with expansion: - 1.0 not and 0 are within 99% of each other + 1.0 not and 0.0 are within 99% of each other Matchers.tests.cpp:: PASSED: REQUIRE_THAT( -0., WithinRel( 0. ) ) with expansion: - -0.0 and 0 are within 2.22045e-12% of each other + -0.0 and 0.0 are within 2.22045e-12% of each other ------------------------------------------------------------------------------- Floating point matchers: double @@ -4523,7 +4503,7 @@ Matchers.tests.cpp: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( v1, WithinRel( v2 ) ) with expansion: - 0.0 and 2.22507e-308 are within 2.22045e-12% of each other + 0.0 and 0.0 are within 2.22045e-12% of each other ------------------------------------------------------------------------------- Floating point matchers: double @@ -4643,7 +4623,7 @@ with expansion: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) ) with expansion: - 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) + 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) ------------------------------------------------------------------------------- Floating point matchers: double @@ -4692,22 +4672,22 @@ Matchers.tests.cpp: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 10.f, WithinRel( 11.1f, 0.1f ) ) with expansion: - 10.0f and 11.1 are within 10% of each other + 10.0f and 11.1000003815 are within 10% of each other Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 10.f, !WithinRel( 11.2f, 0.1f ) ) with expansion: - 10.0f not and 11.2 are within 10% of each other + 10.0f not and 11.1999998093 are within 10% of each other Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 1.f, !WithinRel( 0.f, 0.99f ) ) with expansion: - 1.0f not and 0 are within 99% of each other + 1.0f not and 0.0 are within 99% of each other Matchers.tests.cpp:: PASSED: REQUIRE_THAT( -0.f, WithinRel( 0.f ) ) with expansion: - -0.0f and 0 are within 0.00119209% of each other + -0.0f and 0.0 are within 0.00119209% of each other ------------------------------------------------------------------------------- Floating point matchers: float @@ -4720,7 +4700,7 @@ Matchers.tests.cpp: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( v1, WithinRel( v2 ) ) with expansion: - 0.0f and 1.17549e-38 are within 0.00119209% of each other + 0.0f and 0.0 are within 0.00119209% of each other ------------------------------------------------------------------------------- Floating point matchers: float @@ -4845,7 +4825,7 @@ with expansion: Matchers.tests.cpp:: PASSED: REQUIRE_THAT( 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) ) with expansion: - 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) + 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) ------------------------------------------------------------------------------- Floating point matchers: float @@ -11668,9 +11648,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_default_constructible::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-copyable and non- @@ -11680,9 +11660,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_default_constructible::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-default-constructible @@ -11692,9 +11672,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_trivially_copyable::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside non-default-constructible @@ -11704,9 +11684,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_trivially_copyable::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 0 @@ -11715,9 +11695,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 1 @@ -11726,9 +11706,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic::value ) with expansion: - 1 > 0 + true ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 2 @@ -11737,9 +11717,9 @@ Misc.tests.cpp: ............................................................................... Misc.tests.cpp:: PASSED: - REQUIRE( sizeof(TestType) > 0 ) + REQUIRE( std::is_arithmetic::value ) with expansion: - 4 > 0 + true ------------------------------------------------------------------------------- TemplateTest: vectors can be sized and resized - float @@ -17298,6 +17278,42 @@ StringManip.tests.cpp:: PASSED: with expansion: "abcdefcg" == "abcdefcg" +------------------------------------------------------------------------------- +replaceInPlace + no replace in already-replaced string + lengthening +------------------------------------------------------------------------------- +StringManip.tests.cpp: +............................................................................... + +StringManip.tests.cpp:: PASSED: + CHECK( Catch::replaceInPlace(letters, "c", "cc") ) +with expansion: + true + +StringManip.tests.cpp:: PASSED: + CHECK( letters == "abccdefccg" ) +with expansion: + "abccdefccg" == "abccdefccg" + +------------------------------------------------------------------------------- +replaceInPlace + no replace in already-replaced string + shortening +------------------------------------------------------------------------------- +StringManip.tests.cpp: +............................................................................... + +StringManip.tests.cpp:: PASSED: + CHECK( Catch::replaceInPlace(s, "--", "-") ) +with expansion: + true + +StringManip.tests.cpp:: PASSED: + CHECK( s == "--" ) +with expansion: + "--" == "--" + ------------------------------------------------------------------------------- replaceInPlace escape ' diff --git a/third_party/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt index 48eccfc3..bd08461a 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1966,6 +1966,8 @@ at Message.tests.cpp: + + diff --git a/third_party/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt index d270c88f..052ffd9e 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/junit.sw.multi.approved.txt @@ -1965,6 +1965,8 @@ at Message.tests.cpp: + + diff --git a/third_party/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index 36b05e54..3db09ec0 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -262,6 +262,8 @@ at AssertionHandler.tests.cpp: + + diff --git a/third_party/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt index c9d3d205..f5305eb3 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt @@ -261,6 +261,8 @@ at AssertionHandler.tests.cpp: + + diff --git a/third_party/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt index a02dbd95..d9d34590 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -697,33 +697,25 @@ ok {test-number} - lt( "A", "b" ) for: true # CaseInsensitiveLess is case insensitive ok {test-number} - lt( "A", "B" ) for: true # Character pretty printing -ok {test-number} - tab == '\t' for: '\t' == '\t' +ok {test-number} - ::Catch::Detail::stringify('\t') == "'\\t'" for: "'\t'" == "'\t'" # Character pretty printing -ok {test-number} - newline == '\n' for: '\n' == '\n' +ok {test-number} - ::Catch::Detail::stringify('\n') == "'\\n'" for: "'\n'" == "'\n'" # Character pretty printing -ok {test-number} - carr_return == '\r' for: '\r' == '\r' +ok {test-number} - ::Catch::Detail::stringify('\r') == "'\\r'" for: "'\r'" == "'\r'" # Character pretty printing -ok {test-number} - form_feed == '\f' for: '\f' == '\f' +ok {test-number} - ::Catch::Detail::stringify('\f') == "'\\f'" for: "'\f'" == "'\f'" # Character pretty printing -ok {test-number} - space == ' ' for: ' ' == ' ' +ok {test-number} - ::Catch::Detail::stringify( ' ' ) == "' '" for: "' '" == "' '" # Character pretty printing -ok {test-number} - c == chars[i] for: 'a' == 'a' +ok {test-number} - ::Catch::Detail::stringify( 'A' ) == "'A'" for: "'A'" == "'A'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'z' == 'z' +ok {test-number} - ::Catch::Detail::stringify( 'z' ) == "'z'" for: "'z'" == "'z'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'A' == 'A' +ok {test-number} - ::Catch::Detail::stringify( '\0' ) == "0" for: "0" == "0" # Character pretty printing -ok {test-number} - c == chars[i] for: 'Z' == 'Z' +ok {test-number} - ::Catch::Detail::stringify( static_cast(2) ) == "2" for: "2" == "2" # Character pretty printing -ok {test-number} - null_terminator == '\0' for: 0 == 0 -# Character pretty printing -ok {test-number} - c == i for: 2 == 2 -# Character pretty printing -ok {test-number} - c == i for: 3 == 3 -# Character pretty printing -ok {test-number} - c == i for: 4 == 4 -# Character pretty printing -ok {test-number} - c == i for: 5 == 5 +ok {test-number} - ::Catch::Detail::stringify( static_cast(5) ) == "5" for: "5" == "5" # Clara::Arg supports single-arg parse the way Opt does ok {test-number} - name.empty() for: true # Clara::Arg supports single-arg parse the way Opt does @@ -1137,11 +1129,11 @@ ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% # Floating point matchers: double ok {test-number} - 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other # Floating point matchers: double -ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other +ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other # Floating point matchers: double -ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other +ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other # Floating point matchers: double -ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other +ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 0.0 are within 2.22045e-12% of each other # Floating point matchers: double ok {test-number} - 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0 # Floating point matchers: double @@ -1177,7 +1169,7 @@ ok {test-number} - 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is # Floating point matchers: double ok {test-number} - 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) # Floating point matchers: double -ok {test-number} - 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +ok {test-number} - 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) # Floating point matchers: double ok {test-number} - WithinAbs( 1., 0. ) # Floating point matchers: double @@ -1193,15 +1185,15 @@ ok {test-number} - WithinRel( 1., 1. ), std::domain_error # Floating point matchers: double ok {test-number} - 1., !IsNaN() for: 1.0 not is NaN # Floating point matchers: float -ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other +ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1000003815 are within 10% of each other # Floating point matchers: float -ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other +ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.1999998093 are within 10% of each other # Floating point matchers: float -ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other +ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.0 are within 99% of each other # Floating point matchers: float -ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other +ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other # Floating point matchers: float -ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other +ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 0.0 are within 0.00119209% of each other # Floating point matchers: float ok {test-number} - 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0 # Floating point matchers: float @@ -1241,7 +1233,7 @@ ok {test-number} - 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( # Floating point matchers: float ok {test-number} - 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) # Floating point matchers: float -ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) # Floating point matchers: float ok {test-number} - WithinAbs( 1.f, 0.f ) # Floating point matchers: float @@ -2812,19 +2804,19 @@ ok {test-number} - Template_Fixture::m_a == 1 for: 1 == 1 # Template test case method with test types specified inside std::tuple - MyTypes - 2 ok {test-number} - Template_Fixture::m_a == 1 for: 1.0 == 1 # Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_default_constructible::value for: true # Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_default_constructible::value for: true # Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_trivially_copyable::value for: true # Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_trivially_copyable::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_arithmetic::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_arithmetic::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 2 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_arithmetic::value for: true # TemplateTest: vectors can be sized and resized - float ok {test-number} - v.size() == 5 for: 5 == 5 # TemplateTest: vectors can be sized and resized - float @@ -4206,6 +4198,14 @@ ok {test-number} - !(Catch::replaceInPlace(letters, "x", "z")) for: !false # replaceInPlace ok {test-number} - letters == letters for: "abcdefcg" == "abcdefcg" # replaceInPlace +ok {test-number} - Catch::replaceInPlace(letters, "c", "cc") for: true +# replaceInPlace +ok {test-number} - letters == "abccdefccg" for: "abccdefccg" == "abccdefccg" +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(s, "--", "-") for: true +# replaceInPlace +ok {test-number} - s == "--" for: "--" == "--" +# replaceInPlace ok {test-number} - Catch::replaceInPlace(s, "'", "|'") for: true # replaceInPlace ok {test-number} - s == "didn|'t" for: "didn|'t" == "didn|'t" diff --git a/third_party/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index 13449bd4..a439fdef 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -695,33 +695,25 @@ ok {test-number} - lt( "A", "b" ) for: true # CaseInsensitiveLess is case insensitive ok {test-number} - lt( "A", "B" ) for: true # Character pretty printing -ok {test-number} - tab == '\t' for: '\t' == '\t' +ok {test-number} - ::Catch::Detail::stringify('\t') == "'\\t'" for: "'\t'" == "'\t'" # Character pretty printing -ok {test-number} - newline == '\n' for: '\n' == '\n' +ok {test-number} - ::Catch::Detail::stringify('\n') == "'\\n'" for: "'\n'" == "'\n'" # Character pretty printing -ok {test-number} - carr_return == '\r' for: '\r' == '\r' +ok {test-number} - ::Catch::Detail::stringify('\r') == "'\\r'" for: "'\r'" == "'\r'" # Character pretty printing -ok {test-number} - form_feed == '\f' for: '\f' == '\f' +ok {test-number} - ::Catch::Detail::stringify('\f') == "'\\f'" for: "'\f'" == "'\f'" # Character pretty printing -ok {test-number} - space == ' ' for: ' ' == ' ' +ok {test-number} - ::Catch::Detail::stringify( ' ' ) == "' '" for: "' '" == "' '" # Character pretty printing -ok {test-number} - c == chars[i] for: 'a' == 'a' +ok {test-number} - ::Catch::Detail::stringify( 'A' ) == "'A'" for: "'A'" == "'A'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'z' == 'z' +ok {test-number} - ::Catch::Detail::stringify( 'z' ) == "'z'" for: "'z'" == "'z'" # Character pretty printing -ok {test-number} - c == chars[i] for: 'A' == 'A' +ok {test-number} - ::Catch::Detail::stringify( '\0' ) == "0" for: "0" == "0" # Character pretty printing -ok {test-number} - c == chars[i] for: 'Z' == 'Z' +ok {test-number} - ::Catch::Detail::stringify( static_cast(2) ) == "2" for: "2" == "2" # Character pretty printing -ok {test-number} - null_terminator == '\0' for: 0 == 0 -# Character pretty printing -ok {test-number} - c == i for: 2 == 2 -# Character pretty printing -ok {test-number} - c == i for: 3 == 3 -# Character pretty printing -ok {test-number} - c == i for: 4 == 4 -# Character pretty printing -ok {test-number} - c == i for: 5 == 5 +ok {test-number} - ::Catch::Detail::stringify( static_cast(5) ) == "5" for: "5" == "5" # Clara::Arg supports single-arg parse the way Opt does ok {test-number} - name.empty() for: true # Clara::Arg supports single-arg parse the way Opt does @@ -1135,11 +1127,11 @@ ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% # Floating point matchers: double ok {test-number} - 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other # Floating point matchers: double -ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other +ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other # Floating point matchers: double -ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other +ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other # Floating point matchers: double -ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other +ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 0.0 are within 2.22045e-12% of each other # Floating point matchers: double ok {test-number} - 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0 # Floating point matchers: double @@ -1175,7 +1167,7 @@ ok {test-number} - 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is # Floating point matchers: double ok {test-number} - 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) # Floating point matchers: double -ok {test-number} - 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +ok {test-number} - 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) # Floating point matchers: double ok {test-number} - WithinAbs( 1., 0. ) # Floating point matchers: double @@ -1191,15 +1183,15 @@ ok {test-number} - WithinRel( 1., 1. ), std::domain_error # Floating point matchers: double ok {test-number} - 1., !IsNaN() for: 1.0 not is NaN # Floating point matchers: float -ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other +ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1000003815 are within 10% of each other # Floating point matchers: float -ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other +ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.1999998093 are within 10% of each other # Floating point matchers: float -ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other +ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.0 are within 99% of each other # Floating point matchers: float -ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other +ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other # Floating point matchers: float -ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other +ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 0.0 are within 0.00119209% of each other # Floating point matchers: float ok {test-number} - 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0 # Floating point matchers: float @@ -1239,7 +1231,7 @@ ok {test-number} - 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( # Floating point matchers: float ok {test-number} - 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) # Floating point matchers: float -ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) # Floating point matchers: float ok {test-number} - WithinAbs( 1.f, 0.f ) # Floating point matchers: float @@ -2805,19 +2797,19 @@ ok {test-number} - Template_Fixture::m_a == 1 for: 1 == 1 # Template test case method with test types specified inside std::tuple - MyTypes - 2 ok {test-number} - Template_Fixture::m_a == 1 for: 1.0 == 1 # Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_default_constructible::value for: true # Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_default_constructible::value for: true # Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_trivially_copyable::value for: true # Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_trivially_copyable::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 0 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_arithmetic::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 1 -ok {test-number} - sizeof(TestType) > 0 for: 1 > 0 +ok {test-number} - std::is_arithmetic::value for: true # Template test case with test types specified inside std::tuple - MyTypes - 2 -ok {test-number} - sizeof(TestType) > 0 for: 4 > 0 +ok {test-number} - std::is_arithmetic::value for: true # TemplateTest: vectors can be sized and resized - float ok {test-number} - v.size() == 5 for: 5 == 5 # TemplateTest: vectors can be sized and resized - float @@ -4195,6 +4187,14 @@ ok {test-number} - !(Catch::replaceInPlace(letters, "x", "z")) for: !false # replaceInPlace ok {test-number} - letters == letters for: "abcdefcg" == "abcdefcg" # replaceInPlace +ok {test-number} - Catch::replaceInPlace(letters, "c", "cc") for: true +# replaceInPlace +ok {test-number} - letters == "abccdefccg" for: "abccdefccg" == "abccdefccg" +# replaceInPlace +ok {test-number} - Catch::replaceInPlace(s, "--", "-") for: true +# replaceInPlace +ok {test-number} - s == "--" for: "--" == "--" +# replaceInPlace ok {test-number} - Catch::replaceInPlace(s, "'", "|'") for: true # replaceInPlace ok {test-number} - s == "didn|'t" for: "didn|'t" == "didn|'t" diff --git a/third_party/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt index be57798b..e3a6dc0f 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -3142,34 +3142,34 @@ Nor would this
- tab == '\t' + ::Catch::Detail::stringify('\t') == "'\\t'" - '\t' == '\t' + "'\t'" == "'\t'" - newline == '\n' + ::Catch::Detail::stringify('\n') == "'\\n'" - '\n' == '\n' + "'\n'" == "'\n'" - carr_return == '\r' + ::Catch::Detail::stringify('\r') == "'\\r'" - '\r' == '\r' + "'\r'" == "'\r'" - form_feed == '\f' + ::Catch::Detail::stringify('\f') == "'\\f'" - '\f' == '\f' + "'\f'" == "'\f'" @@ -3177,88 +3177,56 @@ Nor would this
- space == ' ' + ::Catch::Detail::stringify( ' ' ) == "' '" - ' ' == ' ' + "' '" == "' '" - - - c == chars[i] - - - 'a' == 'a' - - - - - c == chars[i] - - - 'z' == 'z' - - - + - c == chars[i] + ::Catch::Detail::stringify( 'A' ) == "'A'" - 'A' == 'A' + "'A'" == "'A'" - + - c == chars[i] + ::Catch::Detail::stringify( 'z' ) == "'z'" - 'Z' == 'Z' + "'z'" == "'z'" - +
- null_terminator == '\0' + ::Catch::Detail::stringify( '\0' ) == "0" - 0 == 0 + "0" == "0" - - - c == i - - - 2 == 2 - - - - - c == i - - - 3 == 3 - - - + - c == i + ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" - 4 == 4 + "2" == "2" - + - c == i + ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" - 5 == 5 + "5" == "5" - +
@@ -5054,7 +5022,7 @@ C 1., !WithinRel( 0., 0.99 ) - 1.0 not and 0 are within 99% of each other + 1.0 not and 0.0 are within 99% of each other @@ -5062,7 +5030,7 @@ C -0., WithinRel( 0. ) - -0.0 and 0 are within 2.22045e-12% of each other + -0.0 and 0.0 are within 2.22045e-12% of each other
@@ -5071,7 +5039,7 @@ C v1, WithinRel( v2 ) - 0.0 and 2.22507e-308 are within 2.22045e-12% of each other + 0.0 and 0.0 are within 2.22045e-12% of each other @@ -5226,7 +5194,7 @@ C 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) - 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) + 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) @@ -5302,7 +5270,7 @@ C 10.f, WithinRel( 11.1f, 0.1f ) - 10.0f and 11.1 are within 10% of each other + 10.0f and 11.1000003815 are within 10% of each other @@ -5310,7 +5278,7 @@ C 10.f, !WithinRel( 11.2f, 0.1f ) - 10.0f not and 11.2 are within 10% of each other + 10.0f not and 11.1999998093 are within 10% of each other @@ -5318,7 +5286,7 @@ C 1.f, !WithinRel( 0.f, 0.99f ) - 1.0f not and 0 are within 99% of each other + 1.0f not and 0.0 are within 99% of each other @@ -5326,7 +5294,7 @@ C -0.f, WithinRel( 0.f ) - -0.0f and 0 are within 0.00119209% of each other + -0.0f and 0.0 are within 0.00119209% of each other
@@ -5335,7 +5303,7 @@ C v1, WithinRel( v2 ) - 0.0f and 1.17549e-38 are within 0.00119209% of each other + 0.0f and 0.0 are within 0.00119209% of each other @@ -5506,7 +5474,7 @@ C 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) - 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) + 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) @@ -13592,10 +13560,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_default_constructible<TestType>::value - 1 > 0 + true @@ -13603,10 +13571,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_default_constructible<TestType>::value - 4 > 0 + true @@ -13614,10 +13582,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_trivially_copyable<TestType>::value - 1 > 0 + true @@ -13625,10 +13593,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_trivially_copyable<TestType>::value - 4 > 0 + true @@ -13636,10 +13604,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_arithmetic<TestType>::value - 4 > 0 + true @@ -13647,10 +13615,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_arithmetic<TestType>::value - 1 > 0 + true @@ -13658,10 +13626,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_arithmetic<TestType>::value - 4 > 0 + true @@ -20066,6 +20034,50 @@ b1!
+
+
+ + + Catch::replaceInPlace(letters, "c", "cc") + + + true + + + + + letters == "abccdefccg" + + + "abccdefccg" == "abccdefccg" + + + +
+ +
+
+
+ + + Catch::replaceInPlace(s, "--", "-") + + + true + + + + + s == "--" + + + "--" == "--" + + + +
+ +
diff --git a/third_party/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/third_party/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt index 08ff6c43..62a2740a 100644 --- a/third_party/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/third_party/Catch2/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -3142,34 +3142,34 @@ Nor would this
- tab == '\t' + ::Catch::Detail::stringify('\t') == "'\\t'" - '\t' == '\t' + "'\t'" == "'\t'" - newline == '\n' + ::Catch::Detail::stringify('\n') == "'\\n'" - '\n' == '\n' + "'\n'" == "'\n'" - carr_return == '\r' + ::Catch::Detail::stringify('\r') == "'\\r'" - '\r' == '\r' + "'\r'" == "'\r'" - form_feed == '\f' + ::Catch::Detail::stringify('\f') == "'\\f'" - '\f' == '\f' + "'\f'" == "'\f'" @@ -3177,88 +3177,56 @@ Nor would this
- space == ' ' + ::Catch::Detail::stringify( ' ' ) == "' '" - ' ' == ' ' + "' '" == "' '" - - - c == chars[i] - - - 'a' == 'a' - - - - - c == chars[i] - - - 'z' == 'z' - - - + - c == chars[i] + ::Catch::Detail::stringify( 'A' ) == "'A'" - 'A' == 'A' + "'A'" == "'A'" - + - c == chars[i] + ::Catch::Detail::stringify( 'z' ) == "'z'" - 'Z' == 'Z' + "'z'" == "'z'" - +
- null_terminator == '\0' + ::Catch::Detail::stringify( '\0' ) == "0" - 0 == 0 + "0" == "0" - - - c == i - - - 2 == 2 - - - - - c == i - - - 3 == 3 - - - + - c == i + ::Catch::Detail::stringify( static_cast<char>(2) ) == "2" - 4 == 4 + "2" == "2" - + - c == i + ::Catch::Detail::stringify( static_cast<char>(5) ) == "5" - 5 == 5 + "5" == "5" - +
@@ -5054,7 +5022,7 @@ C 1., !WithinRel( 0., 0.99 ) - 1.0 not and 0 are within 99% of each other + 1.0 not and 0.0 are within 99% of each other @@ -5062,7 +5030,7 @@ C -0., WithinRel( 0. ) - -0.0 and 0 are within 2.22045e-12% of each other + -0.0 and 0.0 are within 2.22045e-12% of each other
@@ -5071,7 +5039,7 @@ C v1, WithinRel( v2 ) - 0.0 and 2.22507e-308 are within 2.22045e-12% of each other + 0.0 and 0.0 are within 2.22045e-12% of each other @@ -5226,7 +5194,7 @@ C 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) - 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) + 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) @@ -5302,7 +5270,7 @@ C 10.f, WithinRel( 11.1f, 0.1f ) - 10.0f and 11.1 are within 10% of each other + 10.0f and 11.1000003815 are within 10% of each other @@ -5310,7 +5278,7 @@ C 10.f, !WithinRel( 11.2f, 0.1f ) - 10.0f not and 11.2 are within 10% of each other + 10.0f not and 11.1999998093 are within 10% of each other @@ -5318,7 +5286,7 @@ C 1.f, !WithinRel( 0.f, 0.99f ) - 1.0f not and 0 are within 99% of each other + 1.0f not and 0.0 are within 99% of each other @@ -5326,7 +5294,7 @@ C -0.f, WithinRel( 0.f ) - -0.0f and 0 are within 0.00119209% of each other + -0.0f and 0.0 are within 0.00119209% of each other
@@ -5335,7 +5303,7 @@ C v1, WithinRel( v2 ) - 0.0f and 1.17549e-38 are within 0.00119209% of each other + 0.0f and 0.0 are within 0.00119209% of each other @@ -5506,7 +5474,7 @@ C 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) - 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) + 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other ) @@ -13592,10 +13560,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_default_constructible<TestType>::value - 1 > 0 + true @@ -13603,10 +13571,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_default_constructible<TestType>::value - 4 > 0 + true @@ -13614,10 +13582,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_trivially_copyable<TestType>::value - 1 > 0 + true @@ -13625,10 +13593,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_trivially_copyable<TestType>::value - 4 > 0 + true @@ -13636,10 +13604,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_arithmetic<TestType>::value - 4 > 0 + true @@ -13647,10 +13615,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_arithmetic<TestType>::value - 1 > 0 + true @@ -13658,10 +13626,10 @@ Message from section two - sizeof(TestType) > 0 + std::is_arithmetic<TestType>::value - 4 > 0 + true @@ -20065,6 +20033,50 @@ b1!
+
+
+ + + Catch::replaceInPlace(letters, "c", "cc") + + + true + + + + + letters == "abccdefccg" + + + "abccdefccg" == "abccdefccg" + + + +
+ +
+
+
+ + + Catch::replaceInPlace(s, "--", "-") + + + true + + + + + s == "--" + + + "--" == "--" + + + +
+ +
diff --git a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp index d7175756..5566bb59 100644 --- a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Details.tests.cpp @@ -120,13 +120,13 @@ TEST_CASE( "Optional supports move ops", "[optional][approvals]" ) { } SECTION( "Move construction from optional" ) { Optional opt_B( CATCH_MOVE( opt_A ) ); - REQUIRE( opt_A->has_moved ); + REQUIRE( opt_A->has_moved ); // NOLINT(clang-analyzer-cplusplus.Move) } SECTION( "Move assignment from optional" ) { Optional opt_B( opt_A ); REQUIRE_FALSE( opt_A->has_moved ); opt_B = CATCH_MOVE( opt_A ); - REQUIRE( opt_A->has_moved ); + REQUIRE( opt_A->has_moved ); // NOLINT(clang-analyzer-cplusplus.Move) } } diff --git a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp index eaf22a44..d2181702 100644 --- a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp @@ -123,6 +123,12 @@ TEST_CASE( "count_equidistant_floats", CHECK( count_floats_with_scaled_ulp( 1., 1.5 ) == 1ull << 51 ); CHECK( count_floats_with_scaled_ulp( 1.25, 1.5 ) == 1ull << 50 ); CHECK( count_floats_with_scaled_ulp( 1.f, 1.5f ) == 1 << 22 ); + CHECK( count_floats_with_scaled_ulp( -std::numeric_limits::max(), + std::numeric_limits::max() ) == + 33554430 ); // (1 << 25) - 2 due to not including infinities + CHECK( count_floats_with_scaled_ulp( -std::numeric_limits::max(), + std::numeric_limits::max() ) == + 18014398509481982 ); // (1 << 54) - 2 due to not including infinities STATIC_REQUIRE( std::is_same #include #include -#include // Tests of generator implementation details TEST_CASE("Generators internals", "[generators][internals]") { diff --git a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Integer.tests.cpp b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Integer.tests.cpp index fd620ebb..8955f400 100644 --- a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Integer.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Integer.tests.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace { template @@ -20,6 +21,58 @@ namespace { CHECK( extendedMult( b, a ) == ExtendedMultResult{ upper_result, lower_result } ); } + + // Simple (and slow) implmentation of extended multiplication for tests + constexpr Catch::Detail::ExtendedMultResult + extendedMultNaive( std::uint64_t lhs, std::uint64_t rhs ) { + // This is a simple long multiplication, where we split lhs and rhs + // into two 32-bit "digits", so that we can do ops with carry in 64-bits. + // + // 32b 32b 32b 32b + // lhs L1 L2 + // * rhs R1 R2 + // ------------------------ + // | R2 * L2 | + // | R2 * L1 | + // | R1 * L2 | + // | R1 * L1 | + // ------------------------- + // | a | b | c | d | + +#define CarryBits( x ) ( x >> 32 ) +#define Digits( x ) ( x & 0xFF'FF'FF'FF ) + + auto r2l2 = Digits( rhs ) * Digits( lhs ); + auto r2l1 = Digits( rhs ) * CarryBits( lhs ); + auto r1l2 = CarryBits( rhs ) * Digits( lhs ); + auto r1l1 = CarryBits( rhs ) * CarryBits( lhs ); + + // Sum to columns first + auto d = Digits( r2l2 ); + auto c = CarryBits( r2l2 ) + Digits( r2l1 ) + Digits( r1l2 ); + auto b = CarryBits( r2l1 ) + CarryBits( r1l2 ) + Digits( r1l1 ); + auto a = CarryBits( r1l1 ); + + // Propagate carries between columns + c += CarryBits( d ); + b += CarryBits( c ); + a += CarryBits( b ); + + // Remove the used carries + c = Digits( c ); + b = Digits( b ); + a = Digits( a ); + +#undef CarryBits +#undef Digits + + return { + a << 32 | b, // upper 64 bits + c << 32 | d // lower 64 bits + }; + } + + } // namespace TEST_CASE( "extendedMult 64x64", "[Integer][approvals]" ) { @@ -62,6 +115,27 @@ TEST_CASE( "extendedMult 64x64", "[Integer][approvals]" ) { 0xdf44'2d22'ce48'59b9 ); } +TEST_CASE("extendedMult 64x64 - all implementations", "[integer][approvals]") { + using Catch::Detail::extendedMult; + using Catch::Detail::extendedMultPortable; + using Catch::Detail::fillBitsFrom; + + std::random_device rng; + for (size_t i = 0; i < 100; ++i) { + auto a = fillBitsFrom( rng ); + auto b = fillBitsFrom( rng ); + CAPTURE( a, b ); + + auto naive_ab = extendedMultNaive( a, b ); + + REQUIRE( naive_ab == extendedMultNaive( b, a ) ); + REQUIRE( naive_ab == extendedMultPortable( a, b ) ); + REQUIRE( naive_ab == extendedMultPortable( b, a ) ); + REQUIRE( naive_ab == extendedMult( a, b ) ); + REQUIRE( naive_ab == extendedMult( b, a ) ); + } +} + TEST_CASE( "SizedUnsignedType helpers", "[integer][approvals]" ) { using Catch::Detail::SizedUnsignedType_t; using Catch::Detail::DoubleWidthUnsignedType_t; diff --git a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp index 03be6c9c..89323215 100644 --- a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/RandomNumberGeneration.tests.cpp @@ -140,7 +140,9 @@ TEMPLATE_TEST_CASE( "uniform_integer_distribution can handle unit ranges", uint32_t, int32_t, uint64_t, - int64_t ) { + int64_t, + size_t, + ptrdiff_t) { // We want random seed to sample different parts of the rng state, // the output is predetermined anyway std::random_device rd; @@ -493,6 +495,21 @@ TEMPLATE_TEST_CASE( "uniform_integer_distribution is reproducible", REQUIRE_THAT(generated, Catch::Matchers::RangeEquals(uniform_integer_test_params::expected)); } +// The reproducibility tests assume that operations on `float`/`double` +// happen in the same precision as the operated-upon type. This is +// generally true, unless the code is compiled for 32 bit targets without +// SSE2 enabled, in which case the operations are done in the x87 FPU, +// which usually implies doing math in 80 bit floats, and then rounding +// into smaller type when the type is saved into memory. This obviously +// leads to a different answer, than doing the math in the correct precision. +#if ( defined( _MSC_VER ) && _M_IX86_FP < 2 ) || \ + ( defined( __GNUC__ ) && \ + ( ( defined( __i386__ ) || defined( __x86_64__ ) ) ) && \ + !defined( __SSE2_MATH__ ) ) +# define CATCH_TEST_CONFIG_DISABLE_FLOAT_REPRODUCIBILITY_TESTS +#endif + +#if !defined( CATCH_TEST_CONFIG_DISABLE_FLOAT_REPRODUCIBILITY_TESTS ) namespace { template @@ -570,6 +587,8 @@ TEMPLATE_TEST_CASE( "uniform_floating_point_distribution is reproducible", REQUIRE_THAT( generated, Catch::Matchers::RangeEquals( uniform_fp_test_params::expected ) ); } +#endif // ^^ float reproducibility tests are enabled + TEMPLATE_TEST_CASE( "uniform_floating_point_distribution can handle unitary ranges", "[rng][distribution][floating-point][approvals]", float, @@ -579,7 +598,7 @@ TEMPLATE_TEST_CASE( "uniform_floating_point_distribution can handle unitary rang CAPTURE( seed ); Catch::SimplePcg32 pcg( seed ); - const auto highest = uniform_fp_test_params::highest; + const auto highest = TestType(385.125); Catch::uniform_floating_point_distribution dist( highest, highest ); diff --git a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp index e5a65bda..86ba1175 100644 --- a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp @@ -107,7 +107,7 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { for (auto const& factory : factories) { INFO("Tested reporter: " << factory.first); auto sstream = Catch::Detail::make_unique(); - auto& sstreamRef = *sstream.get(); + auto& sstreamRef = *sstream; Catch::ConfigData cfg_data; cfg_data.rngSeed = 1234; diff --git a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp index 36554ddc..f30573cc 100644 --- a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp @@ -57,6 +57,17 @@ TEST_CASE("replaceInPlace", "[string-manip]") { CHECK_FALSE(Catch::replaceInPlace(letters, "x", "z")); CHECK(letters == letters); } + SECTION("no replace in already-replaced string") { + SECTION("lengthening") { + CHECK(Catch::replaceInPlace(letters, "c", "cc")); + CHECK(letters == "abccdefccg"); + } + SECTION("shortening") { + std::string s = "----"; + CHECK(Catch::replaceInPlace(s, "--", "-")); + CHECK(s == "--"); + } + } SECTION("escape '") { std::string s = "didn't"; CHECK(Catch::replaceInPlace(s, "'", "|'")); diff --git a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/TestSpec.tests.cpp b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/TestSpec.tests.cpp index 9c4eb03b..11a7a7a8 100644 --- a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/TestSpec.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/TestSpec.tests.cpp @@ -236,7 +236,7 @@ TEST_CASE( "Parse test names and tags", "[command-line][test-spec][approvals]" ) CHECK( spec.matches( *tcD ) == false ); } SECTION( "two wildcarded names" ) { - TestSpec spec = parseTestSpec( "\"longer*\"\"*spaces\"" ); + TestSpec spec = parseTestSpec( R"("longer*""*spaces")" ); CHECK( spec.hasFilters() == true ); CHECK( spec.matches( *tcA ) == false ); CHECK( spec.matches( *tcB ) == false ); diff --git a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp index 82de5a27..653f65ba 100644 --- a/third_party/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/IntrospectiveTests/TextFlow.tests.cpp @@ -152,7 +152,7 @@ TEST_CASE( "TextFlow::Column respects indentation for empty lines", std::string written = as_written(col); - REQUIRE(as_written(col) == " \n \n third line"); + REQUIRE(written == " \n \n third line"); } TEST_CASE( "TextFlow::Column leading/trailing whitespace", diff --git a/third_party/Catch2/tests/SelfTest/TestRegistrations.cpp b/third_party/Catch2/tests/SelfTest/TestRegistrations.cpp index 64767735..d7a6966f 100644 --- a/third_party/Catch2/tests/SelfTest/TestRegistrations.cpp +++ b/third_party/Catch2/tests/SelfTest/TestRegistrations.cpp @@ -20,7 +20,6 @@ CATCH_REGISTER_TAG_ALIAS("[@tricky]", "[tricky]~[.]") #ifdef __clang__ # pragma clang diagnostic ignored "-Wpadded" # pragma clang diagnostic ignored "-Wweak-vtables" -# pragma clang diagnostic ignored "-Wc++98-compat" #endif /** diff --git a/third_party/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp b/third_party/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp index 557b2131..c489eaa8 100644 --- a/third_party/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/UsageTests/Benchmark.tests.cpp @@ -90,14 +90,14 @@ TEST_CASE("Benchmark containers", "[!benchmark]") { }; REQUIRE(v.size() == size); - int array[size]; + int array[size] {}; BENCHMARK("A fixed size array that should require no allocations") { for (int i = 0; i < size; ++i) array[i] = i; }; int sum = 0; - for (int i = 0; i < size; ++i) - sum += array[i]; + for (int val : array) + sum += val; REQUIRE(sum > size); SECTION("XYZ") { @@ -121,8 +121,8 @@ TEST_CASE("Benchmark containers", "[!benchmark]") { runs = benchmarkIndex; }; - for (size_t i = 0; i < v.size(); ++i) { - REQUIRE(v[i] == runs); + for (int val : v) { + REQUIRE(val == runs); } } } @@ -135,8 +135,8 @@ TEST_CASE("Benchmark containers", "[!benchmark]") { for (int i = 0; i < size; ++i) v[i] = generated; }; - for (size_t i = 0; i < v.size(); ++i) { - REQUIRE(v[i] == generated); + for (int val : v) { + REQUIRE(val == generated); } } diff --git a/third_party/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp b/third_party/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp index bab7a684..682171da 100644 --- a/third_party/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp @@ -39,7 +39,7 @@ namespace { }; template struct Template_Fixture_2 { - Template_Fixture_2() {} + Template_Fixture_2() = default; T m_a; }; diff --git a/third_party/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp b/third_party/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp index 1cdcfb78..a7fbf08f 100644 --- a/third_party/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp @@ -313,11 +313,12 @@ TEST_CASE("ADL universal operators don't hijack expression deconstruction", "[co REQUIRE(0 ^ adl::always_true{}); } -TEST_CASE( "#2555 - types that can only be compared with 0 literal (not int/long) are supported", "[compilation][approvals]" ) { +TEST_CASE( "#2555 - types that can only be compared with 0 literal implemented as pointer conversion are supported", + "[compilation][approvals]" ) { REQUIRE( TypeWithLit0Comparisons{} < 0 ); REQUIRE_FALSE( 0 < TypeWithLit0Comparisons{} ); REQUIRE( TypeWithLit0Comparisons{} <= 0 ); - REQUIRE_FALSE( 0 > TypeWithLit0Comparisons{} ); + REQUIRE_FALSE( 0 <= TypeWithLit0Comparisons{} ); REQUIRE( TypeWithLit0Comparisons{} > 0 ); REQUIRE_FALSE( 0 > TypeWithLit0Comparisons{} ); @@ -330,6 +331,105 @@ TEST_CASE( "#2555 - types that can only be compared with 0 literal (not int/long REQUIRE_FALSE( 0 != TypeWithLit0Comparisons{} ); } +// These tests require `consteval` to propagate through `constexpr` calls +// which is a late DR against C++20. +#if defined( CATCH_CPP20_OR_GREATER ) && defined( __cpp_consteval ) && \ + __cpp_consteval >= 202211L +// Can't have internal linkage to avoid warnings +void ZeroLiteralErrorFunc(); +namespace { + struct ZeroLiteralConsteval { + template , int> = 0> + consteval ZeroLiteralConsteval( T zero ) noexcept { + if ( zero != 0 ) { ZeroLiteralErrorFunc(); } + } + }; + + // Should only be constructible from literal 0. Uses the propagating + // consteval constructor trick (currently used by MSVC, might be used + // by libc++ in the future as well). + struct TypeWithConstevalLit0Comparison { +# define DEFINE_COMP_OP( op ) \ + constexpr friend bool operator op( TypeWithConstevalLit0Comparison, \ + ZeroLiteralConsteval ) { \ + return true; \ + } \ + constexpr friend bool operator op( ZeroLiteralConsteval, \ + TypeWithConstevalLit0Comparison ) { \ + return false; \ + } \ + /* std::orderings only have these for ==, but we add them for all \ + operators so we can test all overloads for decomposer */ \ + constexpr friend bool operator op( TypeWithConstevalLit0Comparison, \ + TypeWithConstevalLit0Comparison ) { \ + return true; \ + } + + DEFINE_COMP_OP( < ) + DEFINE_COMP_OP( <= ) + DEFINE_COMP_OP( > ) + DEFINE_COMP_OP( >= ) + DEFINE_COMP_OP( == ) + DEFINE_COMP_OP( != ) + +#undef DEFINE_COMP_OP + }; + +} // namespace + +namespace Catch { + template <> + struct capture_by_value : std::true_type {}; +} + +TEST_CASE( "#2555 - types that can only be compared with 0 literal implemented as consteval check are supported", + "[compilation][approvals]" ) { + REQUIRE( TypeWithConstevalLit0Comparison{} < 0 ); + REQUIRE_FALSE( 0 < TypeWithConstevalLit0Comparison{} ); + REQUIRE( TypeWithConstevalLit0Comparison{} <= 0 ); + REQUIRE_FALSE( 0 <= TypeWithConstevalLit0Comparison{} ); + + REQUIRE( TypeWithConstevalLit0Comparison{} > 0 ); + REQUIRE_FALSE( 0 > TypeWithConstevalLit0Comparison{} ); + REQUIRE( TypeWithConstevalLit0Comparison{} >= 0 ); + REQUIRE_FALSE( 0 >= TypeWithConstevalLit0Comparison{} ); + + REQUIRE( TypeWithConstevalLit0Comparison{} == 0 ); + REQUIRE_FALSE( 0 == TypeWithConstevalLit0Comparison{} ); + REQUIRE( TypeWithConstevalLit0Comparison{} != 0 ); + REQUIRE_FALSE( 0 != TypeWithConstevalLit0Comparison{} ); +} + +// We check all comparison ops to test, even though orderings, the primary +// motivation for this functionality, only have self-comparison (and thus +// have the ambiguity issue) for `==` and `!=`. +TEST_CASE( "Comparing const instances of type registered with capture_by_value", + "[regression][approvals][compilation]" ) { + SECTION("Type with consteval-int constructor") { + auto const const_Lit0Type_1 = TypeWithConstevalLit0Comparison{}; + auto const const_Lit0Type_2 = TypeWithConstevalLit0Comparison{}; + REQUIRE( const_Lit0Type_1 == const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 <= const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 < const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 >= const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 > const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 != const_Lit0Type_2 ); + } + SECTION("Type with constexpr-int constructor") { + auto const const_Lit0Type_1 = TypeWithLit0Comparisons{}; + auto const const_Lit0Type_2 = TypeWithLit0Comparisons{}; + REQUIRE( const_Lit0Type_1 == const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 <= const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 < const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 >= const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 > const_Lit0Type_2 ); + REQUIRE( const_Lit0Type_1 != const_Lit0Type_2 ); + } +} + +#endif // C++20 consteval + + namespace { struct MultipleImplicitConstructors { MultipleImplicitConstructors( double ) {} @@ -353,3 +453,17 @@ TEST_CASE("#2571 - tests compile types that have multiple implicit constructors REQUIRE( mic1 > mic2 ); REQUIRE( mic1 >= mic2 ); } + +#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS ) +// This test does not test all the related codepaths, but it is the original +// reproducer +TEST_CASE( "Comparing const std::weak_ordering instances must compile", + "[compilation][approvals][regression]" ) { + auto const const_ordering_1 = std::weak_ordering::less; + auto const const_ordering_2 = std::weak_ordering::less; + auto plain_ordering_1 = std::weak_ordering::less; + REQUIRE( const_ordering_1 == plain_ordering_1 ); + REQUIRE( const_ordering_1 == const_ordering_2 ); + REQUIRE( plain_ordering_1 == const_ordering_1 ); +} +#endif diff --git a/third_party/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp b/third_party/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp index 4f91a30c..7c6b0c86 100644 --- a/third_party/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp @@ -119,7 +119,7 @@ TEST_CASE( "When unchecked exceptions are thrown, but caught, they do not affect try { throw std::domain_error( "unexpected exception" ); } - catch(...) {} + catch(...) {} // NOLINT(bugprone-empty-catch) } @@ -152,7 +152,7 @@ TEST_CASE( "Custom exceptions can be translated when testing for throwing as som } TEST_CASE( "Unexpected exceptions can be translated", "[.][failing][!throws]" ) { - throw double( 3.14 ); + throw double( 3.14 ); // NOLINT(readability-redundant-casting): the type is important here, so we want to be explicit } TEST_CASE("Thrown string literals are translated", "[.][failing][!throws]") { diff --git a/third_party/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp b/third_party/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp index 74bedf5e..7c4501c6 100644 --- a/third_party/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp @@ -1027,7 +1027,6 @@ TEST_CASE( "Combining MatchNotOfGeneric does not nest", } struct EvilAddressOfOperatorUsed : std::exception { - EvilAddressOfOperatorUsed() {} const char* what() const noexcept override { return "overloaded address-of operator of matcher was used instead of " "std::addressof"; @@ -1035,7 +1034,6 @@ struct EvilAddressOfOperatorUsed : std::exception { }; struct EvilCommaOperatorUsed : std::exception { - EvilCommaOperatorUsed() {} const char* what() const noexcept override { return "overloaded comma operator of matcher was used"; } @@ -1073,7 +1071,6 @@ struct ImmovableMatcher : Catch::Matchers::MatcherGenericBase { }; struct MatcherWasMovedOrCopied : std::exception { - MatcherWasMovedOrCopied() {} const char* what() const noexcept override { return "attempted to copy or move a matcher"; } @@ -1081,17 +1078,20 @@ struct MatcherWasMovedOrCopied : std::exception { struct ThrowOnCopyOrMoveMatcher : Catch::Matchers::MatcherGenericBase { ThrowOnCopyOrMoveMatcher() = default; - [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher const& ): - Catch::Matchers::MatcherGenericBase() { + + [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher const& other ): + Catch::Matchers::MatcherGenericBase( other ) { throw MatcherWasMovedOrCopied(); } - [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher&& ): - Catch::Matchers::MatcherGenericBase() { + // NOLINTNEXTLINE(performance-noexcept-move-constructor) + [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher&& other ): + Catch::Matchers::MatcherGenericBase( CATCH_MOVE(other) ) { throw MatcherWasMovedOrCopied(); } ThrowOnCopyOrMoveMatcher& operator=( ThrowOnCopyOrMoveMatcher const& ) { throw MatcherWasMovedOrCopied(); } + // NOLINTNEXTLINE(performance-noexcept-move-constructor) ThrowOnCopyOrMoveMatcher& operator=( ThrowOnCopyOrMoveMatcher&& ) { throw MatcherWasMovedOrCopied(); } diff --git a/third_party/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp b/third_party/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp index 6367bf59..7626e005 100644 --- a/third_party/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/UsageTests/Message.tests.cpp @@ -80,20 +80,20 @@ TEST_CASE( "Output from all sections is reported", "[failing][messages][.]" ) { TEST_CASE( "Standard output from all sections is reported", "[messages][.]" ) { SECTION( "one" ) { - std::cout << "Message from section one" << std::endl; + std::cout << "Message from section one\n"; } SECTION( "two" ) { - std::cout << "Message from section two" << std::endl; + std::cout << "Message from section two\n"; } } TEST_CASE( "Standard error is reported and redirected", "[messages][.][approvals]" ) { SECTION( "std::cerr" ) { - std::cerr << "Write to std::cerr" << std::endl; + std::cerr << "Write to std::cerr\n"; } SECTION( "std::clog" ) { - std::clog << "Write to std::clog" << std::endl; + std::clog << "Write to std::clog\n"; } SECTION( "Interleaved writes to cerr and clog" ) { std::cerr << "Inter"; @@ -101,7 +101,7 @@ TEST_CASE( "Standard error is reported and redirected", "[messages][.][approvals std::cerr << ' '; std::clog << "writes"; std::cerr << " to error"; - std::clog << " streams" << std::endl; + std::clog << " streams\n" << std::flush; } } diff --git a/third_party/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp b/third_party/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp index 7f06704b..3697f069 100644 --- a/third_party/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp @@ -11,11 +11,6 @@ #include #include -#ifdef __clang__ -# pragma clang diagnostic ignored "-Wc++98-compat" -# pragma clang diagnostic ignored "-Wc++98-compat-pedantic" -#endif - #include #include @@ -158,9 +153,9 @@ TEST_CASE( "looped tests", "[.][failing]" ) { } TEST_CASE( "Sends stuff to stdout and stderr", "[.]" ) { - std::cout << "A string sent directly to stdout" << std::endl; - std::cerr << "A string sent directly to stderr" << std::endl; - std::clog << "A string sent to stderr via clog" << std::endl; + std::cout << "A string sent directly to stdout\n" << std::flush; + std::cerr << "A string sent directly to stderr\n" << std::flush; + std::clog << "A string sent to stderr via clog\n" << std::flush; } TEST_CASE( "null strings" ) { @@ -396,7 +391,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product using MyTypes = std::tuple; TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes) { - REQUIRE(sizeof(TestType) > 0); + REQUIRE(std::is_arithmetic::value); } struct NonDefaultConstructibleType { @@ -406,7 +401,7 @@ struct NonDefaultConstructibleType { using MyNonDefaultConstructibleTypes = std::tuple; TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-default-constructible std::tuple", "[template][list]", MyNonDefaultConstructibleTypes) { - REQUIRE(sizeof(TestType) > 0); + REQUIRE(std::is_trivially_copyable::value); } struct NonCopyableAndNonMovableType { @@ -421,7 +416,7 @@ struct NonCopyableAndNonMovableType { using NonCopyableAndNonMovableTypes = std::tuple; TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-copyable and non-movable std::tuple", "[template][list]", NonCopyableAndNonMovableTypes) { - REQUIRE(sizeof(TestType) > 0); + REQUIRE(std::is_default_constructible::value); } // https://github.com/philsquared/Catch/issues/166 diff --git a/third_party/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp b/third_party/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp index 28d60196..e073a40a 100644 --- a/third_party/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp @@ -14,31 +14,20 @@ TEST_CASE( "Character pretty printing" ){ SECTION("Specifically escaped"){ - char tab = '\t'; - char newline = '\n'; - char carr_return = '\r'; - char form_feed = '\f'; - CHECK(tab == '\t'); - CHECK(newline == '\n'); - CHECK(carr_return == '\r'); - CHECK(form_feed == '\f'); + CHECK(::Catch::Detail::stringify('\t') == "'\\t'"); + CHECK(::Catch::Detail::stringify('\n') == "'\\n'"); + CHECK(::Catch::Detail::stringify('\r') == "'\\r'"); + CHECK(::Catch::Detail::stringify('\f') == "'\\f'"); } SECTION("General chars"){ - char space = ' '; - CHECK(space == ' '); - char chars[] = {'a', 'z', 'A', 'Z'}; - for (int i = 0; i < 4; ++i){ - char c = chars[i]; - REQUIRE(c == chars[i]); - } + CHECK(::Catch::Detail::stringify( ' ' ) == "' '" ); + CHECK(::Catch::Detail::stringify( 'A' ) == "'A'" ); + CHECK(::Catch::Detail::stringify( 'z' ) == "'z'" ); } SECTION("Low ASCII"){ - char null_terminator = '\0'; - CHECK(null_terminator == '\0'); - for (int i = 2; i < 6; ++i){ - char c = static_cast(i); - REQUIRE(c == i); - } + CHECK(::Catch::Detail::stringify( '\0' ) == "0" ); + CHECK(::Catch::Detail::stringify( static_cast(2) ) == "2" ); + CHECK(::Catch::Detail::stringify( static_cast(5) ) == "5" ); } } diff --git a/third_party/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp b/third_party/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp index 25770340..041d7867 100644 --- a/third_party/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp +++ b/third_party/Catch2/tests/SelfTest/UsageTests/Tricky.tests.cpp @@ -261,7 +261,7 @@ TEST_CASE( "non streamable - with conv. op", "[Tricky]" ) inline void foo() {} -typedef void (*fooptr_t)(); +using fooptr_t = void (*)(); TEST_CASE( "Comparing function pointers", "[Tricky][function pointer]" ) { @@ -281,7 +281,7 @@ struct S TEST_CASE( "Comparing member function pointers", "[Tricky][member function pointer][approvals]" ) { - typedef void (S::*MF)(); + using MF = void (S::*)(); MF m = &S::f; CHECK( m == &S::f ); diff --git a/third_party/Catch2/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp b/third_party/Catch2/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp index 202c3af4..a8e517c0 100644 --- a/third_party/Catch2/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp +++ b/third_party/Catch2/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp @@ -12,23 +12,34 @@ #include // Should only be constructible from literal 0. +// Based on the constructor from pointer trick, used by libstdc++ and libc++ +// (formerly also MSVC, but they've moved to consteval int constructor). // Used by `TypeWithLit0Comparisons` for testing comparison // ops that only work with literal zero, the way std::*orderings do -struct ZeroLiteralDetector { - constexpr ZeroLiteralDetector( ZeroLiteralDetector* ) noexcept {} +struct ZeroLiteralAsPointer { + constexpr ZeroLiteralAsPointer( ZeroLiteralAsPointer* ) noexcept {} template ::value>> - constexpr ZeroLiteralDetector( T ) = delete; + constexpr ZeroLiteralAsPointer( T ) = delete; }; + struct TypeWithLit0Comparisons { -#define DEFINE_COMP_OP( op ) \ - friend bool operator op( TypeWithLit0Comparisons, ZeroLiteralDetector ) { \ - return true; \ - } \ - friend bool operator op( ZeroLiteralDetector, TypeWithLit0Comparisons ) { \ - return false; \ +#define DEFINE_COMP_OP( op ) \ + constexpr friend bool operator op( TypeWithLit0Comparisons, \ + ZeroLiteralAsPointer ) { \ + return true; \ + } \ + constexpr friend bool operator op( ZeroLiteralAsPointer, \ + TypeWithLit0Comparisons ) { \ + return false; \ + } \ + /* std::orderings only have these for ==, but we add them for all \ + operators so we can test all overloads for decomposer */ \ + constexpr friend bool operator op( TypeWithLit0Comparisons, \ + TypeWithLit0Comparisons ) { \ + return true; \ } DEFINE_COMP_OP( < ) diff --git a/third_party/Catch2/tests/TestScripts/DiscoverTests/CMakeLists.txt b/third_party/Catch2/tests/TestScripts/DiscoverTests/CMakeLists.txt index d19f2f88..5105cddb 100644 --- a/third_party/Catch2/tests/TestScripts/DiscoverTests/CMakeLists.txt +++ b/third_party/Catch2/tests/TestScripts/DiscoverTests/CMakeLists.txt @@ -11,6 +11,12 @@ add_executable(tests add_subdirectory(${CATCH2_PATH} catch2-build) target_link_libraries(tests PRIVATE Catch2::Catch2WithMain) -include(CTest) +enable_testing() include(Catch) -catch_discover_tests(tests) +set(extra_args) +if (CMAKE_VERSION GREATER_EQUAL 3.27) + list(APPEND extra_args + DL_PATHS "${CMAKE_CURRENT_LIST_DIR};${CMAKE_CURRENT_LIST_DIR}/.." + ) +endif () +catch_discover_tests(tests ${extra_args}) diff --git a/third_party/Catch2/tests/TestScripts/DiscoverTests/VerifyRegistration.py b/third_party/Catch2/tests/TestScripts/DiscoverTests/VerifyRegistration.py index 9ec42f24..9800674f 100644 --- a/third_party/Catch2/tests/TestScripts/DiscoverTests/VerifyRegistration.py +++ b/third_party/Catch2/tests/TestScripts/DiscoverTests/VerifyRegistration.py @@ -10,7 +10,24 @@ import os import subprocess import sys +import re +import json +cmake_version_regex = re.compile('cmake version (\d+)\.(\d+)\.(\d+)') + +def get_cmake_version(): + result = subprocess.run(['cmake', '--version'], + capture_output = True, + check = True, + text = True) + version_match = cmake_version_regex.match(result.stdout) + if not version_match: + print('Could not find cmake version in output') + print(f"output: '{result.stdout}'") + exit(4) + return (int(version_match.group(1)), + int(version_match.group(2)), + int(version_match.group(3))) def build_project(sources_dir, output_base_path, catch2_path): build_dir = os.path.join(output_base_path, 'ctest-registration-test') @@ -62,8 +79,7 @@ def get_test_names(build_path): root = ET.fromstring(result.stdout) return [tc.text for tc in root.findall('TestCase/Name')] - -def list_ctest_tests(build_path): +def get_ctest_listing(build_path): old_path = os.getcwd() os.chdir(build_path) @@ -73,10 +89,10 @@ def list_ctest_tests(build_path): check = True, text = True) os.chdir(old_path) + return result.stdout - import json - - ctest_response = json.loads(result.stdout) +def extract_tests_from_ctest(ctest_output): + ctest_response = json.loads(ctest_output) tests = ctest_response['tests'] test_names = [] for test in tests: @@ -90,6 +106,15 @@ def list_ctest_tests(build_path): return test_names +def check_DL_PATHS(ctest_output): + ctest_response = json.loads(ctest_output) + tests = ctest_response['tests'] + for test in tests: + properties = test['properties'] + for property in properties: + if property['name'] == 'ENVIRONMENT_MODIFICATION': + assert len(property['value']) == 2, f"The test provides 2 arguments to DL_PATHS, but instead found {len(property['value'])}" + def escape_catch2_test_name(name): for char in ('\\', ',', '[', ']'): name = name.replace(char, f"\\{char}") @@ -106,7 +131,8 @@ def escape_catch2_test_name(name): build_path = build_project(sources_dir, output_base_path, catch2_path) catch_test_names = [escape_catch2_test_name(name) for name in get_test_names(build_path)] - ctest_test_names = list_ctest_tests(build_path) + ctest_output = get_ctest_listing(build_path) + ctest_test_names = extract_tests_from_ctest(ctest_output) mismatched = 0 for catch_test in catch_test_names: @@ -121,3 +147,7 @@ def escape_catch2_test_name(name): if mismatched: print(f"Found {mismatched} mismatched tests catch test names and ctest test commands!") exit(1) + + cmake_version = get_cmake_version() + if cmake_version >= (3, 27): + check_DL_PATHS(ctest_output) diff --git a/third_party/Catch2/tests/TestScripts/testConfigureDefaultReporter.py b/third_party/Catch2/tests/TestScripts/testConfigureDefaultReporter.py index 5bf97871..119e1ca2 100644 --- a/third_party/Catch2/tests/TestScripts/testConfigureDefaultReporter.py +++ b/third_party/Catch2/tests/TestScripts/testConfigureDefaultReporter.py @@ -28,14 +28,23 @@ catch2_source_path = os.path.abspath(sys.argv[1]) build_dir_path = os.path.join(os.path.abspath(sys.argv[2]), 'CMakeConfigTests', 'DefaultReporter') +output_file = f"{build_dir_path}/foo.xml" +# We need to escape backslashes in Windows paths, because otherwise they +# are interpreted as escape characters in strings, and cause compilation +# error. +escaped_output_file = output_file.replace('\\', '\\\\') configure_and_build(catch2_source_path, build_dir_path, - [("CATCH_CONFIG_DEFAULT_REPORTER", "xml")]) + [("CATCH_CONFIG_DEFAULT_REPORTER", f"xml::out={escaped_output_file}")]) stdout, _ = run_and_return_output(os.path.join(build_dir_path, 'tests'), 'SelfTest', ['[approx][custom]']) -xml_tag = '' -if xml_tag not in stdout: - print("Could not find '{}' in the stdout".format(xml_tag)) - print('stdout: "{}"'.format(stdout)) +if not os.path.exists(output_file): + print(f'Did not find the {output_file} file') exit(2) + +xml_tag = '' +with open(output_file, 'r', encoding='utf-8') as file: + if xml_tag not in file.read(): + print(f"Could not find '{xml_tag}' in the file") + exit(3) diff --git a/third_party/Catch2/tools/scripts/releaseCommon.py b/third_party/Catch2/tools/scripts/releaseCommon.py index 1ff4af29..81efa762 100644 --- a/third_party/Catch2/tools/scripts/releaseCommon.py +++ b/third_party/Catch2/tools/scripts/releaseCommon.py @@ -89,7 +89,7 @@ def updateCmakeFile(version): def updateMesonFile(version): with open(mesonPath, 'rb') as file: lines = file.readlines() - replacementRegex = re.compile(b'''version\s*:\s*'(\\d+.\\d+.\\d+)', # CML version placeholder, don't delete''') + replacementRegex = re.compile(b'''version\\s*:\\s*'(\\d+.\\d+.\\d+)', # CML version placeholder, don't delete''') replacement = '''version: '{0}', # CML version placeholder, don't delete'''.format(version.getVersionString()).encode('ascii') with open(mesonPath, 'wb') as file: for line in lines: diff --git a/third_party/Imath-3.1.9/.git-blame-ignore-revs b/third_party/Imath-3.1.9/.git-blame-ignore-revs deleted file mode 100644 index 01d2f635..00000000 --- a/third_party/Imath-3.1.9/.git-blame-ignore-revs +++ /dev/null @@ -1,6 +0,0 @@ -# Disable clang-format in half.cpp -344334aef268206ed1d46399ea85ab276f3f13e6 - -# Tune .clang-format to match existing style -c6014892de1acccca0deada8ab3353cd290e9fbc - diff --git a/third_party/Imath-3.1.9/.gitignore b/third_party/Imath-3.1.9/.gitignore deleted file mode 100644 index 0f0bab0c..00000000 --- a/third_party/Imath-3.1.9/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -build/ -_build/ -_install/ diff --git a/third_party/Imath-3.1.9/CONTRIBUTORS.md b/third_party/Imath-3.1.9/CONTRIBUTORS.md deleted file mode 100644 index 2298bf0e..00000000 --- a/third_party/Imath-3.1.9/CONTRIBUTORS.md +++ /dev/null @@ -1,38 +0,0 @@ - - - -This is a list of contributors to the Imath project, sorted -alphabetically by first name. - -If you know of missing, please email: info@openexr.com. - -* Andrew Kunz -* Antonio Rojas -* Cary Phillips -* Christina Tempelaar-Lietz -* Daniel Kaneider -* Ed Hanway -* Eric Wimmer -* Florian Kainz -* Gregorio Litenstein -* Harry Mallon -* Huibean Luo -* Jens Lindgren -* Ji Hun Yu -* Jonathan Stone -* Kimball Thurston -* Larry Gritz -* Liam Fernandez -* Mark Sisson -* Nicholas Yue -* Nick Porcino -* Nick Rasmussen -* Nicolas Chauvet -* Owen Thompson -* Peter Hillman -* Piotr Stanczyk -* Ralph Potter -* Simon Boorer -* Thanh Ha -* Thorsten Kaufmann -* Yujie Shu diff --git a/third_party/Imath-3.1.9/SECURITY.md b/third_party/Imath-3.1.9/SECURITY.md deleted file mode 100644 index 624c18f1..00000000 --- a/third_party/Imath-3.1.9/SECURITY.md +++ /dev/null @@ -1,18 +0,0 @@ - - - -# Security Policy - -## Reporting a Vulnerability - -If you think you've found a potential vulnerability in Imath, please -report it by emailing security@openexr.org. Only OpenEXR Technical -Steering Committee members and Academy Software Foundation project -management have access to these messages. Include detailed steps to -reproduce the issue, and any other information that could aid an -investigation. Our policy is to respond to vulernability reports -within 14 days. - -Our policy is to address critical security vulnerabilities rapidly and -post patches as quickly as possible. - diff --git a/third_party/Imath-3.1.9/docs/Makefile b/third_party/Imath-3.1.9/docs/Makefile deleted file mode 100644 index 9e86a0dc..00000000 --- a/third_party/Imath-3.1.9/docs/Makefile +++ /dev/null @@ -1,177 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ReadTheDocs-Breathe.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ReadTheDocs-Breathe.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/ReadTheDocs-Breathe" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ReadTheDocs-Breathe" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/third_party/Imath-3.1.9/docs/PortingGuide2-3.md b/third_party/Imath-3.1.9/docs/PortingGuide2-3.md deleted file mode 100644 index 851b64c2..00000000 --- a/third_party/Imath-3.1.9/docs/PortingGuide2-3.md +++ /dev/null @@ -1,547 +0,0 @@ -# OpenEXR/Imath 2.x to 3.x Porting Guide - -This porting guide outlines the several areas where switching from OpenEXR -2.x to OpenEXR 3.x + Imath 3.x will require source code or build changes of -downstream software. - -In each case, we will often explain both how to change if you are expecting -3.x only hereafter, or usually a more complex accommodation if you want to -keep compatibility with both 2.x and 3.x. - -## OpenEXR and Imath Are Different Packages - -If your use of OpenEXR was only for the sake of using the math classes and -utilities, maybe you were unhappy that you needed to download and build the -full OpenEXR dependency. You are in luck -- now Imath is a separate, very -lightweight open source package. You can use Imath functionality without -needing any of OpenEXR, which as of 3.x only includes the parts you need to -read and write OpenEXR image files. - -The parts of "IlmBase" that were `Imath` and `half` are now repackaged -as the `Imath` library. The `IlmThread` and `Iex` libraries have been -folded into the OpenEXR package, since they were were not necessary to -the rest of Imath. - -When building OpenEXR 3.x, note that if Imath 3.x library is not found -already installed at build time, it will be automatically downloaded and -built as part of the OpenEXR build. - -## Background - -Why is this happening? Here is the relevant history. - -The OpenEXR project has historically consisted of four separate subprojects: - -* OpenEXR - the Imf image format -* IlmBase - supporting utilities (Imath, Half, Iex, IlmThread) -* PyIlmBase - python bindings for the IlmBase libraries -* OpenEXR_Viewers - code for an example EXR image viewer - -Prior to the 2.4 release in 2019, OpenEXR relied primarily on the Gnu -autotools build system and was released as four separate tarballs -(ilmbase, pyilmbase, openexr, openexr_viewers) that were constructed -via the Gnu tools. This gave direct access to the "IlmBase" libraries -independent of the OpenEXR format library. The project also included -CMake files but CMake support was incomplete. - -With the adoption of OpenEXR by the Academy Software Foundation in -2019, the technical steering committee made several key changes: - -1. Drop support for autotools in favor of CMake. A significant portion - of the OpenEXR user base uses Windows, which the Gnu autotools does - not support. Supporting two build systems is a maintenance burden - that the TSC opted to avoid. We now assume that all modern users of - OpenEXR can reasonably be expected to rely on CMake. - -2. Rely on GitHub's automatic release packaging mechanism. This - packages the entire contents of package in a single - tarball. Separate tarballs are no longer generated by the Gnu - autotools setup. - -3. Deprecate the OpenEXR_Viewers code. It was impossibly out of date - and of little modern value. - -Thus, with the 2.4 release, the "IlmBase" libraries are no longer -distributed in a form that is readily separable from the rest of -OpenEXR. The build and installation process for the overall OpenEXR -project is complicated by the fact it consists of four separate -projects, which added signifcant complexity to the CMake setup. - -Because Imath is generally useful to the community, the TSC decided to -simplify the configuration by separating Imath into its own independent -project, maintained and released independently of OpenEXR, and -introducing it as a new external dependency of OpenEXR. - -To further simplify matters, the new Imath library includes the half -data type directly, rather than maintaining it in a separate -library. Also, the community at large has a strong desire for simple -vector/matrix utilities that are unencumbered by Iex, the IlmBase -library that provides higher-level exception classes, and even -further, a clear delineation between functionality that (1) relies on -exception handlings and (2) is free from exceptions. As a result, -support for Iex has been removed from Imath, and the Iex library is -now packaged as a component of OpenEXR. - -The Imath python bindings are a part of Imath as a configuration -option, although support is off by default to simplify the build process -for most users. - -## New Library Names and Repository Structures - -The new repositories place all source code under the `src` top-level -subdirectory. - -### Imath: - - src - ├── Imath - ├── ImathTest - └── python - ├── config - ├── PyImath - ├── PyImathNumpy - ├── PyImathTest - ├── PyImathNumpyTest - └── PyImathSpeedTest - - -### OpenEXR: - -The 'IlmImf' library has been renamed 'OpenEXR'. No header files have -changed names, only their locations in the repo have changes. - - src - ├── bin - │ ├── exr2aces - │ ├── exrbuild - │ ├── exrcheck - │ ├── exrenvmap - │ ├── exrheader - │ ├── exrmakepreview - │ ├── exrmaketiled - │ ├── exrmultipart - │ ├── exrmultiview - │ └── exrstdattr - ├── lib - │ ├── Iex - │ ├── IexMath - │ ├── IlmThread - │ ├── OpenEXR - │ └── OpenEXRUtil - ├── examples - └── test - ├── IexTest - ├── OpenEXRTest - ├── OpenEXRUtilTest - └── OpenEXRFuzzTest - - -## Finding and Using OpenEXR and Imath CMake Configs - -### OpenEXR/Imath 3.x only - -If you are *only* concerned with OpenEXR/Imath 3.x going forward, this is -the recommended way to find the libraries in a downstream project that uses -the CMake build system: - - find_package(Imath CONFIG) - find_package(OpenEXR CONFIG) - -Note that the second line may be omitted if you only need the Imath -portions. - -And then your project can reference the imported targets like this: - - target_link_libraries (my_target - PRIVATE - OpenEXR::OpenEXR - Imath::Imath - Imath::Half - ) - -You only need the parts you use, so for example, if you only need Half and -Imath, you can omit the OpenEXR target. Also note that in our example above, -we have used the `PRIVATE` label, but you should specify them as `PUBLIC` if -you are exposing those classes in your own package's public interface. - - -### Accommodating OpenEXR/Imath 3.x or OpenEXR 2.x - -On the other hand, to accommodate both 2.x and 3.x, it's admittedly -inconvenient because the packages and the import targets have changed their -names. We have found the following idioms to work: - -Finding either/both packages: - - # First, try to find just the right config files - find_package(Imath CONFIG) - if (NOT TARGET Imath::Imath) - # Couldn't find Imath::Imath, maybe it's older and has IlmBase? - find_package(IlmBase CONFIG) - endif () - find_package(OpenEXR CONFIG) - -To link against them, we use CMake generator expressions so that we can -reference *both* sets of targets, but it will only use the ones -corresponding to the package version that was found. - - target_link_libraries (my_target - PRIVATE - # For OpenEXR/Imath 3.x: - $<$:OpenEXR::OpenEXR> - $<$:Imath::Imath> - $<$:Imath::Half> - # For OpenEXR 2.4/2.5: - $<$:OpenEXR::IlmImf> - $<$:IlmBase::Imath> - $<$:IlmBase::Half> - $<$:IlmBase::IlmThread> - $<$:IlmBase::Iex> - ) - -Again, you can eliminate the references to any of the individual libaries -that you don't actually need for your application. - -### Simultaneous Static/Shared Build - -The OpenEXR 2.x CMake configuration had options to simultaneously -build both shared and statically linked libraries. This has been -deprecated. A CMake configuration setting specifies whether to build -static or shared, but if you want both, you will need to run cmake and -build twice. - -### Simultaneous Python 2/3 Build - -The PyIlmBase 2.x CMake configuration had options to simultaneously -build both python2 and python3 bindings. This has been deprecated. -A CMake configuration setting specifies whether to build for -python 2 or python 3, but if you want both, you will need to run -cmake and build twice. - -## Imath Include Files Are in a Different Subdirectory - -Imath 3.0 will copy its headers to some `include/Imath` subdirectory -instead of the old `include/OpenEXR`. - -### OpenEXR/Imath 3.x only - -If you know that you are only using Imath 3.x, then just change any -include directions, like this: - - #include - #include - -to the new locations: - - #include - #include - -### Accommodating OpenEXR/Imath 3.x or OpenEXR 2.x - -If you want your software to be able to build against either OpenEXR 2.x or -3.x (depending on which dependency is available at build time), we recommend -using a more complicated idiom: - - // The version can reliably be found in this header file from OpenEXR, - // for both 2.x and 3.x: - #include - #define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \ - (100*OPENEXR_VERSION_MINOR) + \ - OPENEXR_VERSION_PATCH) - - // There's just no easy way to have an `#include` that works in both - // cases, so we use the version to switch which set of include files we - // use. - #if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */ - # include - # include - #else - // OpenEXR 2.x, use the old locations - # include - # include - #endif - -## Include Files Include Fewer Other Headers - -Extraneous ``#include`` statements have been removed from some header -files, which can lead to compile failures in application code that -previously included certain headers indirectly. - -For example, the Imath header files no longer include ``float.h``, so -application code that references symbols such as ``FLT_MAX`` may need -to add an explicit ``#include `` or equivalent. - -If your application code reports compile errors due to undefined or -incompletely-defined Imath or OpenEXR data types, locate the Imath or -OpenEXR header file that defines the type and include it explicitly. - -## Symbols Are Hidden by Default - -To reduce library size and make linkage behavior similar across -platforms, Imath and OpenEXR now build with directives that make -symbol visibility hidden by default, with specific externally-visible -symbols explicitly marked for export. See the [Symbol -Visibility](https://github.com/AcademySoftwareFoundation/openexr/blob/main/docs/SymbolVisibility.md) -doc and the appropriate ``*Export.h`` header file for more details. - -## Imath Now Uses Standard C++ Exceptions and `noexcept` - -In OpenEXR 2.x, the Imath functions that threw exceptions used to throw -various Iex varieties. - -In Imath 3.x, these functions just throw `std::exception` varieties that -correspond to the failure (e.g., `std::invalid_argument`, -`std::domain_error`, etc.). For that reason, all of the Iex exceptions are -now only part of the OpenEXR library (where they are still used in the same -manner they were for OpenEXR 2.x). - -Imath 3.x has very few functions that throw exceptions. Each is clearly -marked as such, and each has a version that does not throw exceptions (so -that it may be used from code where exceptions are avoided). The functions -that do not throw exceptions are now marked `noexcept`. - -## Some Headers and Classes Have Been Removed from Imath 3.x - -* The `Math` class (and `ImathMath.h` header file) are - deprecated. All of the `Math` functionality is subsumed by C++11 - `std::` math functions. For example, calls to - `Imath::Math::abs(x)` should be replaced with `std::abs(x)`. - -* The `Limits` class (and the `ImathLimits.h` and - `ImathHalfLimits.h` headers) have been removed entirely. All uses of - `Limits<>` should be replaced with the appropriate - `std::numeric_limits<>` method call. The Imath-specific versions - predated C++11, and were not only redundant in a C++11 world, but - also potentially confusing because some of their functions behaved - quite differently than the `std::numeric_limits` method with the - same name. We are following the precept that if C++11 does something - in a standard way, we should not define our own equivalent function - (and especially not define it in a way that doesn't match the - standard behavior). - -* `Vec::normalize()` and `length()` methods, for integer `T` types, - have been removed. Also the standalone `project()` and - `orthogonal()` functions are no longer defined for vectors made of - integer elements. These all had behavior that was hard to understand - and probably useless. They still work as expected for vectors of - floating-point types. - -* The ``Int64`` and ``SInt64`` types are deprecated in favor of the - now-standard ``int64_t`` and ``uint64_t``. - -## File/Class-specific changes: - -### `half` in half.h - -* The half type is now in the `Imath` namespace, but a compile-time - option puts it in the global namespace, except when compiling for - CUDA, in which case the 'half' type refers to the CUDA type: - - #ifndef __CUDACC__ - using half = IMATH_INTERNAL_NAMESPACE::half; - #else - #include - #endif - - If you desire to use Imath::half inside a CUDA kernal, you can refer - to it via the namespace, or define `CUDA_NO_HALF` to avoid the CUDA - type altogether. - -* `HALF_MIN` has changed value. It is now the smallest **normalized** - positive value, returned by `std::numeric_limits::min()`. - -* New constructor from a bit pattern: - - enum FromBitsTag - { - FromBits - }; - - constexpr half(FromBitsTag, unsigned short bits) noexcept; - -### `Imath::Box` in ImathBox.h - -* `baseTypeMin()` is replaced with `baseTypeLowest()` - -### `Color3`, `Color4` in ImathColor.h - -* `baseTypeMin()` is replaced with `baseTypeLowest()` - -### `Imath::Frustum` in ImathFrustum.h - -Akin to the `Vec` classes, there are now seperate API calls for -throwing and non-throwing functions: - -These functions previously threw exceptions but now do not throw and -are marked `noexcept`: - -* `Frustum::projectionMatrix() noexcept` - -* `Frustum::aspect() noexcept` - -* `Frustum::set() noexcept` - -* `Frustum::projectPointToScreen() noexcept` - -* `Frustum::ZToDepth() noexcept` - -* `Frustum::DepthToZ() noexcept` - -* `Frustum::screenRadius() noexcept` - -* `Frustum::localToScreen() noexcept` - -These functions throw `std::domain_error` exceptions when the -associated frustum is degenerate: - -* `Frustum::projectionMatrixExc()` - -* `Frustum::aspectExc()` - -* `Frustum::setExc()` - -* `Frustum::projectPointToScreenExc()` - -* `Frustum::ZToDepthExc()` - -* `Frustum::DepthToZExc()` - -* `Frustum::screenRadiusExc()` - -* `Frustum::localToScreenExc()` - -### `Imath::Interval` in ImathInterval.h - -New methods/functions: - -* `Interval::operator !=` - -* `Interval::makeInfinite()` - -* `IntervalisInfinite()` - -* `operator<< (std::ostream& s, const Interval&)` - -### ImathMatrixAlgo.h - -* `checkForZeroScaleInRow()` and `extractAndRemoveScalingAndShear()` - throw `std::domain_error` exceptions instead of `Iex::ZeroScale` - -### `Matrix22`, `Matrix33`, `Matrix44` in ImathMatrix.h - -* `baseTypeMin()` is replaced with `baseTypeLowest()` - -* `invert(bool singExc = false)` is replace by: - - - `invert() noexcept` - - - `invert(bool)` which optionally throws an `std::invalid_argument` - exception. - -* `inverse(bool singExc = false)` is replace by: - - - `inverse() noexcept` - - - `inverse(bool)` which optionally throws an `std::invalid_argument` - exception. - -* `gjInvert(bool singExc = false)` is replace by: - - - `gjInvert()` noexcept - - - `gjInvert(bool)` which optionally throws an - `std::invalid_argument` exception. - -* `gJinverse(bool singExc = false)` is replace by: - - - `gjInverse()` noexcept - - - `gjInverse(bool)` which optionally throws an - `std::invalid_argument` exception. - -New functions: - -* `operator<< (std::ostream& s, const Matrix22&)` - -* `operator<< (std::ostream& s, const Matrix33&)` - -* `operator<< (std::ostream& s, const Matrix44&)` - -Other changes: - -* Initialization loops unrolled for efficiency - -* inline added where appropriate - -### ImathRoots.h - -* When compiling for CUDA, the `complex` type comes from `thrust` - rather than `std` - -### `Shear6` in ImathShear.h - -* `baseTypeMin()` is replaced with `baseTypeLowest()` - -### ImathVecAlgo.h - -The following functions are no longer defined for integer-based -vectors, because such behavior is not clearly defined: - -* `project (const Vec& s, const Vec& t)` - -* `orgthogonal (const Vec& s, const Vec& t)` - -* `reflect (const Vec& s, const Vec& t)` - -### `Vec2`, `Vec3`, `Vec4` in ImathVec.h - -* `baseTypeMin()` is replaced with `baseTypeLowest()` - -* The following methods are removed (via `= delete`) for integer-based - vectors because the behavior is not clearly defined and thus prone - to confusion: - - - `length()` - although the length is indeed defined, its proper value - is floating point and can thus not be represented by the 'T' - return type. - - - `normalize()` - - - `normalizeExc()` - - - `normalizeNonNull()` - - - `normalized()` - - - `normalizedExc()` - - - `normalizedNonNull()` - -* Interoperability Constructors: The Vec and Matrix classes now have - constructors that take as an argument any data object of similar - size and layout. - -## Python Changes: - -In general, the changes at the C++ level are reflected in the python -bindings. In particular: - -* The following methods are removed for integer-based - vector and matrix objects and arrays: - - - `length()` - - `normalize()` - - `normalizeExc()` - - `normalizeNonNull()` - - `normalized()` - - `normalizedExc()` - - `normalizedNonNull()` - -* `baseTypeMin()` is replaced with `baseTypeLowest()` for: - - - `Vec2`, `Vec3`, `Vec4` - - `Color3`, `Color4` - - `Matrix22`, `Matrix33`, `Matrix44` - - `Box` - - `Shear6` - diff --git a/third_party/Imath-3.1.9/docs/examples/Box.cpp b/third_party/Imath-3.1.9/docs/examples/Box.cpp deleted file mode 100644 index 8d2fa281..00000000 --- a/third_party/Imath-3.1.9/docs/examples/Box.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include - -void -box_example() -{ - Imath::V3f a (0, 0, 0); - Imath::V3f b (1, 1, 1); - Imath::V3f c (2, 9, 2); - - Imath::Box3f box (a); - - assert (box.isEmpty()); - assert (!box.isInfinite()); - assert (!box.hasVolume()); - - box.extendBy (c); - - assert (box.size() == (c-a)); - assert (box.intersects (b)); - assert (box.max[0] > box.min[0]); - assert (box.max[1] > box.min[1]); - assert (box.max[2] > box.min[2]); - assert (box.hasVolume()); - assert (box.majorAxis() == 1); -} diff --git a/third_party/Imath-3.1.9/docs/examples/Color3.cpp b/third_party/Imath-3.1.9/docs/examples/Color3.cpp deleted file mode 100644 index d2edcd15..00000000 --- a/third_party/Imath-3.1.9/docs/examples/Color3.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -void -color3_example() -{ - Imath::C3c r (255, 0, 0); - Imath::C3c g (0, 255, 0); - Imath::C3c b (0, 0, 255); - - Imath::C3c c = r + g + b; - - assert (c.x == 255); - assert (c.x == 255); - assert (c.x == 255); -} diff --git a/third_party/Imath-3.1.9/docs/examples/Color4.cpp b/third_party/Imath-3.1.9/docs/examples/Color4.cpp deleted file mode 100644 index 582aacd4..00000000 --- a/third_party/Imath-3.1.9/docs/examples/Color4.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -void -color4_example() -{ - Imath::C4f r (1.0f, 0.0f, 0.0f, 1.0f); - Imath::C4f g (0.0f, 1.0f, 0.0f, 1.0f); - Imath::C4f b (0.0f, 0.0f, 1.0f, 1.0f); - - Imath::C4f w = r + g + b; - - assert (w.r == 1.0f); - assert (w.g == 1.0f); - assert (w.b == 1.0f); - assert (w.a == 3.0f); -} diff --git a/third_party/Imath-3.1.9/docs/examples/Sphere3.cpp b/third_party/Imath-3.1.9/docs/examples/Sphere3.cpp deleted file mode 100644 index f0f1bea9..00000000 --- a/third_party/Imath-3.1.9/docs/examples/Sphere3.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include - -void -sphere3_example() -{ - Imath::V3f center (1.0f, 1.0f, 1.0f); - float radius = 2.0f; - Imath::Sphere3f s (center, radius); - - assert (s.center == center); - assert (s.radius == radius); - - Imath::Line3f line (Imath::V3f (0.0f, 0.0f, 0.0f), - Imath::V3f (1.0f, 1.0f, 1.0f)); - - Imath::V3f v; - assert (s.intersect (line, v)); - - assert (v.equalWithAbsError (Imath::V3f(2.1547f, 2.1547f, 2.1547f), 1e-6f)); -} diff --git a/third_party/Imath-3.1.9/docs/examples/Vec2.cpp b/third_party/Imath-3.1.9/docs/examples/Vec2.cpp deleted file mode 100644 index 551f4874..00000000 --- a/third_party/Imath-3.1.9/docs/examples/Vec2.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -void -vec2_example() -{ - Imath::V2f a (1.0f, 2.0f); - Imath::V2f b; // b is uninitialized - - b.x = a[0]; - b.y = a[1]; - - assert (a == b); - - assert (a.length() == sqrt (a ^ a)); - - a.normalize(); - assert (Imath::equalWithAbsError (a.length(), 1.0f, 1e-6f)); -} diff --git a/third_party/Imath-3.1.9/docs/examples/Vec3.cpp b/third_party/Imath-3.1.9/docs/examples/Vec3.cpp deleted file mode 100644 index 51f91ff0..00000000 --- a/third_party/Imath-3.1.9/docs/examples/Vec3.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -void -vec3_example() -{ - Imath::V3f a (1.0f, 2.0f, 3.0f); - Imath::V3f b; // b is uninitialized - - b.x = a[0]; - b.y = a[1]; - b.z = a[2]; - - assert (a == b); - - assert (a.length() == sqrt (a ^ a)); - - a.normalize(); - assert (Imath::equalWithAbsError (a.length(), 1.0f, 1e-6f)); -} diff --git a/third_party/Imath-3.1.9/docs/examples/Vec4.cpp b/third_party/Imath-3.1.9/docs/examples/Vec4.cpp deleted file mode 100644 index c63c9b99..00000000 --- a/third_party/Imath-3.1.9/docs/examples/Vec4.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include - -void -vec4_example() -{ - Imath::V4f a (1.0f, 2.0f, 3.0f, 4.0f); - Imath::V4f b; // b is uninitialized - - b.x = a[0]; - b.y = a[1]; - b.z = a[2]; - b.w = a[3]; - - assert (a == b); - - assert (a.length() == sqrt (a ^ a)); - - a.normalize(); - assert (Imath::equalWithAbsError (a.length(), 1.0f, 1e-6f)); -} diff --git a/third_party/Imath-3.1.9/docs/examples/main.cpp b/third_party/Imath-3.1.9/docs/examples/main.cpp deleted file mode 100644 index 05784414..00000000 --- a/third_party/Imath-3.1.9/docs/examples/main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. - -#include - -void color3_example(); -void color4_example(); -void euler_example(); -void frustum_example(); -void interval_example(); -void line3_example(); -void matrix22_example(); -void matrix33_example(); -void matrix44_example(); -void plane3_example(); -void quat_example(); -void shear6_example(); -void sphere3_example(); -void vec2_example(); -void vec3_example(); -void vec4_example(); -void half_example(); - -int -main (int argc, char* argv[]) -{ - std::cout << "imath examples..." << std::endl; - - color3_example(); - color4_example(); - euler_example(); - frustum_example(); - interval_example(); - line3_example(); - matrix22_example(); - matrix33_example(); - matrix44_example(); - plane3_example(); - quat_example(); - shear6_example(); - sphere3_example(); - vec2_example(); - vec3_example(); - vec4_example(); - half_example(); - - std::cout << "done." << std::endl; - - return 0; -} diff --git a/third_party/Imath-3.1.9/docs/requirements.txt b/third_party/Imath-3.1.9/docs/requirements.txt deleted file mode 100644 index d030b3b5..00000000 --- a/third_party/Imath-3.1.9/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -sphinx == 4.4.0 -breathe -sphinx-press-theme diff --git a/third_party/Imath-3.1.9/share/ci/scripts/windows/install_zlib.ps1 b/third_party/Imath-3.1.9/share/ci/scripts/windows/install_zlib.ps1 deleted file mode 100755 index c818c061..00000000 --- a/third_party/Imath-3.1.9/share/ci/scripts/windows/install_zlib.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -$homeDir = (pwd) - -$zlibVersion = $Args[0] -$zlibWorkingDir = $Args[1] - -$zlibMajorMinor = [io.path]::GetFileNameWithoutExtension("$zlibVersion") -$zlibVersionConcise = $zlibVersion -replace '[.]','' -$zlibArchive = "https://www.zlib.net/zlib${zlibVersionConcise}.zip" - -$zlibRoot = "${zlibWorkingDir}\_zlib" -$zlibBuildPath = "${zlibWorkingDir}\zlib-${zlibVersion}" -$zlibDllPath = "${zlibRoot}\bin" -$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" - -Write-Host "Retrieving ${zlibArchive}" -Invoke-WebRequest "${zlibArchive}" -OutFile "${zlibBuildPath}.zip" -Write-Host "Expanding archive ${zlibBuildPath}.zip" -Expand-Archive "${zlibBuildPath}.zip" -DestinationPath "${zlibWorkingDir}" - -if (-NOT (Test-Path $zlibRoot)) -{ - New-Item -ItemType Directory $zlibRoot -} - -cd $zlibBuildPath -mkdir _build -cd _build -cmake .. -G"Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX="${zlibRoot}" - -Write-Host "Building ${zlibBuildPath}\_build\INSTALL.vcxproj" -foregroundcolor green -& "${msbuild}" "${zlibBuildPath}\_build\INSTALL.vcxproj" /P:Configuration=Release - -cd $homeDir - -echo "::set-env name=ZLIB_ROOT::$zlibRoot" -echo "::add-path::$zlibDllPath" diff --git a/third_party/Imath-3.1.9/src/Imath/ImathFun.cpp b/third_party/Imath-3.1.9/src/Imath/ImathFun.cpp deleted file mode 100644 index 74799366..00000000 --- a/third_party/Imath-3.1.9/src/Imath/ImathFun.cpp +++ /dev/null @@ -1,162 +0,0 @@ -// -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. -// - -#include "ImathFun.h" - -IMATH_INTERNAL_NAMESPACE_SOURCE_ENTER - -float -succf (float f) IMATH_NOEXCEPT -{ - union - { - float f; - uint32_t i; - } u; - u.f = f; - - if (isinf(f) || isnan (f)) - { - // Nan or infinity; don't change value. - } - else if (u.i == 0x00000000 || u.i == 0x80000000) - { - // Plus or minus zero. - - u.i = 0x00000001; - } - else if (u.f > 0) - { - // Positive float, normalized or denormalized. - // Incrementing the largest positive float - // produces +infinity. - - ++u.i; - } - else - { - // Negative normalized or denormalized float. - - --u.i; - } - - return u.f; -} - -float -predf (float f) IMATH_NOEXCEPT -{ - union - { - float f; - uint32_t i; - } u; - u.f = f; - - if (isinf(f) || isnan (f)) - { - // Nan or infinity; don't change value. - } - else if (u.i == 0x00000000 || u.i == 0x80000000) - { - // Plus or minus zero. - - u.i = 0x80000001; - } - else if (u.f > 0) - { - // Positive float, normalized or denormalized. - - --u.i; - } - else - { - // Negative normalized or denormalized float. - // Decrementing the largest negative float - // produces -infinity. - - ++u.i; - } - - return u.f; -} - -double -succd (double d) IMATH_NOEXCEPT -{ - union - { - double d; - uint64_t i; - } u; - u.d = d; - - if (isinf(d) || isnan (d)) - { - // Nan or infinity; don't change value. - } - else if (u.i == 0x0000000000000000LL || u.i == 0x8000000000000000LL) - { - // Plus or minus zero. - - u.i = 0x0000000000000001LL; - } - else if (u.d > 0) - { - // Positive double, normalized or denormalized. - // Incrementing the largest positive double - // produces +infinity. - - ++u.i; - } - else - { - // Negative normalized or denormalized double. - - --u.i; - } - - return u.d; -} - -double -predd (double d) IMATH_NOEXCEPT -{ - union - { - double d; - uint64_t i; - } u; - u.d = d; - - if ((u.i & 0x7ff0000000000000LL) == 0x7ff0000000000000LL) - { - // Nan or infinity; don't change value. - } - else if (u.i == 0x0000000000000000LL || u.i == 0x8000000000000000LL) - { - // Plus or minus zero. - - u.i = 0x8000000000000001LL; - } - else if (u.d > 0) - { - // Positive double, normalized or denormalized. - - --u.i; - } - else - { - // Negative normalized or denormalized double. - // Decrementing the largest negative double - // produces -infinity. - - ++u.i; - } - - return u.d; -} - -IMATH_INTERNAL_NAMESPACE_SOURCE_EXIT diff --git a/third_party/Imath-3.1.9/src/ImathTest/testBitPatterns.cpp b/third_party/Imath-3.1.9/src/ImathTest/testBitPatterns.cpp deleted file mode 100644 index d3418104..00000000 --- a/third_party/Imath-3.1.9/src/ImathTest/testBitPatterns.cpp +++ /dev/null @@ -1,433 +0,0 @@ -// -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. -// - -#ifdef NDEBUG -# undef NDEBUG -#endif - -#include -#include -#include -#include -#include -#include "testBitPatterns.h" - -using namespace std; - -namespace -{ - -bool -equalBitPatterns (const char* b1, const char* b2) -{ - // - // Returns true if the characters in zero-terminated string b1 - // are the same as the charaters in string b2, except for places - // where b1 or b2 contains an 'X'. For example: - // - // equalBitPatterns ("100", "100") returns true - // equalBitPatterns ("100", "101") returns false - // equalBitPatterns ("10X", "101") returns true - // equalBitPatterns ("10X", "100") returns true - // - - while (*b1 && *b2) - { - if (*b1 != *b2 && *b1 != 'X' && *b2 != 'X') - return false; - - ++b1; - ++b2; - } - - return !(*b1 || *b2); -} - -void -testBits (float f, const char bh[19], const char bg[35]) -{ - half h (f); - float g (h); - - cout.width (15); - cout.precision (8); - cout << f << " "; - printBits (cout, f); - cout << " "; - printBits (cout, h); - cout << '\n'; - cout.width (15); - cout << g << " "; - printBits (cout, g); - cout << "\n\n"; - - if (bh || bg) - { - char ch[19], cg[35]; - - printBits (ch, h); - printBits (cg, g); - - if (!equalBitPatterns (ch, bh)) - { - cout << "error: expected " << bh << ", got " << ch << endl; - assert (false); - } - - if (!equalBitPatterns (cg, bg)) - { - cout << "error: expected " << bg << ", got " << cg << endl; - assert (false); - } - } -} - -float -floatPosInfinity() -{ - half::uif x; - x.i = 0x7f800000; - return x.f; -} - -float -floatNegInfinity() -{ - half::uif x; - x.i = 0xff800000; - return x.f; -} - -float -floatPosQNan1() -{ - half::uif x; - x.i = 0x7fffffff; - return x.f; -} - -float -floatNegQNan1() -{ - half::uif x; - x.i = 0xffffffff; - return x.f; -} - -float -floatPosQNan2() -{ - half::uif x; - x.i = 0x7fd55555; - return x.f; -} - -float -floatNegQNan2() -{ - half::uif x; - x.i = 0xffd55555; - return x.f; -} - -} // namespace - -void -testBitPatterns() -{ - cout << "specific bit patterns\n\n"; - - // - // Numbers close to 1.0 - // - - testBits (1.0f, "0 01111 0000000000", "0 01111111 00000000000000000000000"); - testBits (1.0f + HALF_EPSILON, "0 01111 0000000001", "0 01111111 00000000010000000000000"); - testBits (1.0f + HALF_EPSILON * 0.5f, - "0 01111 0000000000", - "0 01111111 00000000000000000000000"); - testBits (1.0f + HALF_EPSILON * 0.4999f, - "0 01111 0000000000", - "0 01111111 00000000000000000000000"); - testBits (1.0f + HALF_EPSILON * 0.5001f, - "0 01111 0000000001", - "0 01111111 00000000010000000000000"); - testBits (1.0f + HALF_EPSILON + HALF_EPSILON, - "0 01111 0000000010", - "0 01111111 00000000100000000000000"); - testBits (1.0f + HALF_EPSILON + HALF_EPSILON * 0.5f, - "0 01111 0000000010", - "0 01111111 00000000100000000000000"); - testBits (1.0f + HALF_EPSILON + HALF_EPSILON * 0.4999f, - "0 01111 0000000001", - "0 01111111 00000000010000000000000"); - testBits (1.0f + HALF_EPSILON + HALF_EPSILON * 0.5001f, - "0 01111 0000000010", - "0 01111111 00000000100000000000000"); - testBits (1.0f - HALF_EPSILON * 0.5f, - "0 01110 1111111111", - "0 01111110 11111111110000000000000"); - testBits (1.0f - HALF_EPSILON * 0.5f * 0.5f, - "0 01111 0000000000", - "0 01111111 00000000000000000000000"); - testBits (1.0f - HALF_EPSILON * 0.5f * 0.4999f, - "0 01111 0000000000", - "0 01111111 00000000000000000000000"); - testBits (1.0f - HALF_EPSILON * 0.5f * 0.5001f, - "0 01110 1111111111", - "0 01111110 11111111110000000000000"); - - // - // Numbers close to HALF_DENORM_MIN - // - - testBits (HALF_DENORM_MIN, "0 00000 0000000001", "0 01100111 00000000000000000000000"); - testBits (HALF_DENORM_MIN + HALF_DENORM_MIN, "0 00000 0000000010", "0 01101000 00000000000000000000000"); - testBits (HALF_DENORM_MIN + HALF_DENORM_MIN * 0.5f, - "0 00000 0000000010", - "0 01101000 00000000000000000000000"); - testBits (HALF_DENORM_MIN + HALF_DENORM_MIN * 0.4999f, - "0 00000 0000000001", - "0 01100111 00000000000000000000000"); - testBits (HALF_DENORM_MIN + HALF_DENORM_MIN * 0.5001f, - "0 00000 0000000010", - "0 01101000 00000000000000000000000"); - testBits (HALF_DENORM_MIN - HALF_DENORM_MIN, // NOSONAR - suppress SonarCloud bug report. - "0 00000 0000000000", - "0 00000000 00000000000000000000000"); - testBits (HALF_DENORM_MIN - HALF_DENORM_MIN * 0.5f, - "0 00000 0000000000", - "0 00000000 00000000000000000000000"); - testBits (HALF_DENORM_MIN - HALF_DENORM_MIN * 0.4999f, - "0 00000 0000000001", - "0 01100111 00000000000000000000000"); - testBits (HALF_DENORM_MIN - HALF_DENORM_MIN * 0.5001f, - "0 00000 0000000000", - "0 00000000 00000000000000000000000"); - - // - // Numbers close to HALF_NRM_MIN - // - - testBits (HALF_NRM_MIN, "0 00001 0000000000", "0 01110001 00000000000000000000000"); - testBits (HALF_NRM_MIN + HALF_DENORM_MIN, "0 00001 0000000001", "0 01110001 00000000010000000000000"); - testBits (HALF_NRM_MIN + HALF_DENORM_MIN * 0.5f, - "0 00001 0000000000", - "0 01110001 00000000000000000000000"); - testBits (HALF_NRM_MIN + HALF_DENORM_MIN * 0.4999f, - "0 00001 0000000000", - "0 01110001 00000000000000000000000"); - testBits (HALF_NRM_MIN + HALF_DENORM_MIN * 0.5001f, - "0 00001 0000000001", - "0 01110001 00000000010000000000000"); - testBits (HALF_NRM_MIN - HALF_DENORM_MIN, "0 00000 1111111111", "0 01110000 11111111100000000000000"); - testBits (HALF_NRM_MIN - HALF_DENORM_MIN * 0.5f, - "0 00001 0000000000", - "0 01110001 00000000000000000000000"); - testBits (HALF_NRM_MIN - HALF_DENORM_MIN * 0.49995f, - "0 00001 0000000000", - "0 01110001 00000000000000000000000"); - testBits (HALF_NRM_MIN - HALF_DENORM_MIN * 0.50005f, - "0 00000 1111111111", - "0 01110000 11111111100000000000000"); - - // - // Small positive integers and simple decimal fractions - // - - testBits (2, "0 10000 0000000000", "0 10000000 00000000000000000000000"); - testBits (3, "0 10000 1000000000", "0 10000000 10000000000000000000000"); - testBits (10, "0 10010 0100000000", "0 10000010 01000000000000000000000"); - testBits (0.1f, "0 01011 1001100110", "0 01111011 10011001100000000000000"); - testBits (0.2f, "0 01100 1001100110", "0 01111100 10011001100000000000000"); - testBits (0.3f, "0 01101 0011001101", "0 01111101 00110011010000000000000"); - - // - // Numbers close to HALF_MAX - // - - testBits (HALF_MAX, "0 11110 1111111111", "0 10001110 11111111110000000000000"); - testBits ((1 << HALF_MAX_EXP) * 1.0, - "0 11111 0000000000", // +infinity - "0 11111111 00000000000000000000000"); // +infinity - testBits ((1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.25f), - "0 11111 0000000000", // +infinity - "0 11111111 00000000000000000000000"); // +infinity - testBits ((1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.25005f), - "0 11110 1111111111", - "0 10001110 11111111110000000000000"); - testBits ((1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.24995f), - "0 11111 0000000000", // +infinity - "0 11111111 00000000000000000000000"); // +infinity - - // - // Large positive numbers, positive infinity and NANs - // - - testBits (HALF_MAX * HALF_MAX, - "0 11111 0000000000", // +infinity - "0 11111111 00000000000000000000000"); // +infinity - testBits (FLT_MAX, - "0 11111 0000000000", // +infinity - "0 11111111 00000000000000000000000"); // +infinity - testBits (floatPosInfinity(), - "0 11111 0000000000", // +infinity - "0 11111111 00000000000000000000000"); // +infinity - testBits (floatPosQNan1(), - "0 11111 1111111111", // nan - "0 11111111 11111111110000000000000"); // nan - testBits (floatPosQNan2(), - "0 11111 1010101010", // nan - "0 11111111 10101010100000000000000"); // nan - - // - // Numbers close to -1.0 - // - - testBits (-1.0, "1 01111 0000000000", "1 01111111 00000000000000000000000"); - testBits (-(1.0f + HALF_EPSILON), "1 01111 0000000001", "1 01111111 00000000010000000000000"); - testBits (-(1.0f + HALF_EPSILON * 0.5f), - "1 01111 0000000000", - "1 01111111 00000000000000000000000"); - testBits (-(1.0f + HALF_EPSILON * 0.4999f), - "1 01111 0000000000", - "1 01111111 00000000000000000000000"); - testBits (-(1.0f + HALF_EPSILON * 0.5001f), - "1 01111 0000000001", - "1 01111111 00000000010000000000000"); - testBits (-(1.0f + HALF_EPSILON + HALF_EPSILON), - "1 01111 0000000010", - "1 01111111 00000000100000000000000"); - testBits (-(1.0f + HALF_EPSILON + HALF_EPSILON * 0.5f), - "1 01111 0000000010", - "1 01111111 00000000100000000000000"); - testBits (-(1.0f + HALF_EPSILON + HALF_EPSILON * 0.4999f), - "1 01111 0000000001", - "1 01111111 00000000010000000000000"); - testBits (-(1.0f + HALF_EPSILON + HALF_EPSILON * 0.5001f), - "1 01111 0000000010", - "1 01111111 00000000100000000000000"); - testBits (-(1.0f - HALF_EPSILON * 0.5f), - "1 01110 1111111111", - "1 01111110 11111111110000000000000"); - testBits (-(1.0f - HALF_EPSILON * 0.5f * 0.5f), - "1 01111 0000000000", - "1 01111111 00000000000000000000000"); - testBits (-(1.0f - HALF_EPSILON * 0.5f * 0.4999f), - "1 01111 0000000000", - "1 01111111 00000000000000000000000"); - testBits (-(1.0f - HALF_EPSILON * 0.5f * 0.5001f), - "1 01110 1111111111", - "1 01111110 11111111110000000000000"); - - // - // Numbers close to -HALF_DENORM_MIN - // - - testBits (-HALF_DENORM_MIN, "1 00000 0000000001", "1 01100111 00000000000000000000000"); - testBits (-(HALF_DENORM_MIN + HALF_DENORM_MIN), "1 00000 0000000010", "1 01101000 00000000000000000000000"); - testBits (-(HALF_DENORM_MIN + HALF_DENORM_MIN * 0.5f), - "1 00000 0000000010", - "1 01101000 00000000000000000000000"); - testBits (-(HALF_DENORM_MIN + HALF_DENORM_MIN * 0.4999f), - "1 00000 0000000001", - "1 01100111 00000000000000000000000"); - testBits (-(HALF_DENORM_MIN + HALF_DENORM_MIN * 0.5001f), - "1 00000 0000000010", - "1 01101000 00000000000000000000000"); - testBits (-(HALF_DENORM_MIN - HALF_DENORM_MIN), // NOSONAR - suppress SonarCloud bug report. - "X 00000 0000000000", - "X 00000000 00000000000000000000000"); - testBits (-(HALF_DENORM_MIN - HALF_DENORM_MIN * 0.5f), - "1 00000 0000000000", - "1 00000000 00000000000000000000000"); - testBits (-(HALF_DENORM_MIN - HALF_DENORM_MIN * 0.4999f), - "1 00000 0000000001", - "1 01100111 00000000000000000000000"); - testBits (-(HALF_DENORM_MIN - HALF_DENORM_MIN * 0.5001f), - "1 00000 0000000000", - "1 00000000 00000000000000000000000"); - - // - // Numbers close to -HALF_NRM_MIN - // - - testBits (-HALF_NRM_MIN, "1 00001 0000000000", "1 01110001 00000000000000000000000"); - testBits (-(HALF_NRM_MIN + HALF_DENORM_MIN), - "1 00001 0000000001", - "1 01110001 00000000010000000000000"); - testBits (-(HALF_NRM_MIN + HALF_DENORM_MIN * 0.5f), - "1 00001 0000000000", - "1 01110001 00000000000000000000000"); - testBits (-(HALF_NRM_MIN + HALF_DENORM_MIN * 0.4999f), - "1 00001 0000000000", - "1 01110001 00000000000000000000000"); - testBits (-(HALF_NRM_MIN + HALF_DENORM_MIN * 0.5001f), - "1 00001 0000000001", - "1 01110001 00000000010000000000000"); - testBits (-(HALF_NRM_MIN - HALF_DENORM_MIN), - "1 00000 1111111111", - "1 01110000 11111111100000000000000"); - testBits (-(HALF_NRM_MIN - HALF_DENORM_MIN * 0.5f), - "1 00001 0000000000", - "1 01110001 00000000000000000000000"); - testBits (-(HALF_NRM_MIN - HALF_DENORM_MIN * 0.49995f), - "1 00001 0000000000", - "1 01110001 00000000000000000000000"); - testBits (-(HALF_NRM_MIN - HALF_DENORM_MIN * 0.50005f), - "1 00000 1111111111", - "1 01110000 11111111100000000000000"); - - // - // Small negative integers and simple decimal fractions - // - - testBits (-2, "1 10000 0000000000", "1 10000000 00000000000000000000000"); - testBits (-3, "1 10000 1000000000", "1 10000000 10000000000000000000000"); - testBits (-10, "1 10010 0100000000", "1 10000010 01000000000000000000000"); - testBits (-0.1f, "1 01011 1001100110", "1 01111011 10011001100000000000000"); - testBits (-0.2f, "1 01100 1001100110", "1 01111100 10011001100000000000000"); - testBits (-0.3f, "1 01101 0011001101", "1 01111101 00110011010000000000000"); - - // - // Numbers close to -HALF_MAX - // - - testBits (-HALF_MAX, "1 11110 1111111111", "1 10001110 11111111110000000000000"); - testBits (-(1 << HALF_MAX_EXP) * 1.0f, - "1 11111 0000000000", // +infinity - "1 11111111 00000000000000000000000"); // +infinity - testBits (-(1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.25f), - "1 11111 0000000000", // +infinity - "1 11111111 00000000000000000000000"); // +infinity - testBits (-(1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.25005f), - "1 11110 1111111111", - "1 10001110 11111111110000000000000"); - testBits (-(1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.24995f), - "1 11111 0000000000", // +infinity - "1 11111111 00000000000000000000000"); // +infinity - - // - // Large negative numbers, negative infinity and NANs - // - - testBits (-HALF_MAX * HALF_MAX, - "1 11111 0000000000", // +infinity - "1 11111111 00000000000000000000000"); // +infinity - testBits (-FLT_MAX, - "1 11111 0000000000", // +infinity - "1 11111111 00000000000000000000000"); // +infinity - testBits (floatNegInfinity(), - "1 11111 0000000000", // +infinity - "1 11111111 00000000000000000000000"); // +infinity - testBits (floatNegQNan1(), - "1 11111 1111111111", // nan - "1 11111111 11111111110000000000000"); // nan - testBits (floatNegQNan2(), - "1 11111 1010101010", // nan - "1 11111111 10101010100000000000000"); // nan - - cout << "ok\n\n" << flush; -} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testError.h b/third_party/Imath-3.1.9/src/ImathTest/testError.h deleted file mode 100644 index 675c8a9d..00000000 --- a/third_party/Imath-3.1.9/src/ImathTest/testError.h +++ /dev/null @@ -1,8 +0,0 @@ -// -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. -// - -void testNormalizedConversionError(); -void testDenormalizedConversionError(); -void testRoundingError(); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testFun.cpp b/third_party/Imath-3.1.9/src/ImathTest/testFun.cpp deleted file mode 100644 index 483b6ac3..00000000 --- a/third_party/Imath-3.1.9/src/ImathTest/testFun.cpp +++ /dev/null @@ -1,295 +0,0 @@ -// -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. -// - -#ifdef NDEBUG -# undef NDEBUG -#endif - -#include -#if __cplusplus >= 202002L -# include -#endif -#include -#include -#include -#include -#include -#include - -using namespace std; - -#if __cplusplus < 202002L - template - static inline To - bit_cast (From from) - { - static_assert (sizeof (From) == sizeof (To), "Type sizes do not match"); - union - { - From f; - To t; - } u; - u.f = from; - return u.t; - } -#endif - -void -testf (float f, bool changeExpected = true) -{ - printf ("\n"); - - float sf = IMATH_INTERNAL_NAMESPACE::succf (f); - float pf = IMATH_INTERNAL_NAMESPACE::predf (f); - float spf = IMATH_INTERNAL_NAMESPACE::succf (IMATH_INTERNAL_NAMESPACE::predf (f)); - float psf = IMATH_INTERNAL_NAMESPACE::predf (IMATH_INTERNAL_NAMESPACE::succf (f)); - - printf ("f %.9g %" PRIx32 "\n", f, bit_cast (f)); - printf ("sf %.9g %" PRIx32 "\n", sf, bit_cast (sf)); - printf ("pf %.9g %" PRIx32 "\n", pf, bit_cast (pf)); - printf ("spf %.9g %" PRIx32 "\n", spf, bit_cast (spf)); - printf ("psf %.9g %" PRIx32 "\n", psf, bit_cast (psf)); - - fflush (stdout); - - if (changeExpected) - { - assert (pf < f); - assert (f < sf); - } - else - { - if (isnan(f)) - { - // If f is nan, pf and sf may be converted from signaling - // to quiet nan, but they'll still be nan's. - assert (isnan(pf)); - assert (isnan(sf)); - } - else - { - // No bit change expected if input was inf. - assert (bit_cast (pf) == bit_cast (f)); - assert (bit_cast (sf) == bit_cast (f)); - } - } -} - -void -testd (double d, bool changeExpected = true) -{ - printf ("\n"); - - double sd = IMATH_INTERNAL_NAMESPACE::succd (d); - double pd = IMATH_INTERNAL_NAMESPACE::predd (d); - double spd = IMATH_INTERNAL_NAMESPACE::succd (IMATH_INTERNAL_NAMESPACE::predd (d)); - double psd = IMATH_INTERNAL_NAMESPACE::predd (IMATH_INTERNAL_NAMESPACE::succd (d)); - - printf ("d %0.18lg %" PRIx64 "\n", d, bit_cast (d)); - printf ("sd %0.18lg %" PRIx64 "\n", sd, bit_cast (sd)); - printf ("pd %0.18lg %" PRIx64 "\n", pd, bit_cast (pd)); - printf ("spd %0.18lg %" PRIx64 "\n", spd, bit_cast (spd)); - printf ("psd %0.18lg %" PRIx64 "\n", psd, bit_cast (psd)); - - fflush (stdout); - - if (changeExpected) - { - assert (pd < d); - assert (d < sd); - } - else - { - if (isnan(d)) - { - // If f is nan, pf and sf may be converted from signaling - // to quiet nan, but they'll still be nan's. - assert (isnan(pd)); - assert (isnan(sd)); - } - else - { - // No bit change expected if input was inf. - assert (bit_cast (pd) == bit_cast (d)); - assert (bit_cast (sd) == bit_cast (d)); - } - } -} - -void -testFun() -{ - cout << "Testing functions in ImathFun.h" << endl; - - cout << "floor" << endl; - - assert (IMATH_INTERNAL_NAMESPACE::floor (0.0f) == 0); - assert (IMATH_INTERNAL_NAMESPACE::floor (0.5f) == 0); - assert (IMATH_INTERNAL_NAMESPACE::floor (-0.5f) == -1); - assert (IMATH_INTERNAL_NAMESPACE::floor (1.0f) == 1); - assert (IMATH_INTERNAL_NAMESPACE::floor (-1.0f) == -1); - assert (IMATH_INTERNAL_NAMESPACE::floor (1.5f) == 1); - assert (IMATH_INTERNAL_NAMESPACE::floor (-1.5f) == -2); - - cout << "ceil" << endl; - - assert (IMATH_INTERNAL_NAMESPACE::ceil (0.0f) == 0); - assert (IMATH_INTERNAL_NAMESPACE::ceil (0.5f) == 1); - assert (IMATH_INTERNAL_NAMESPACE::ceil (-0.5f) == 0); - assert (IMATH_INTERNAL_NAMESPACE::ceil (1.0f) == 1); - assert (IMATH_INTERNAL_NAMESPACE::ceil (-1.0f) == -1); - assert (IMATH_INTERNAL_NAMESPACE::ceil (1.5f) == 2); - assert (IMATH_INTERNAL_NAMESPACE::ceil (-1.5f) == -1); - - cout << "trunc" << endl; - - assert (IMATH_INTERNAL_NAMESPACE::trunc (0.0f) == 0); - assert (IMATH_INTERNAL_NAMESPACE::trunc (0.5f) == 0); - assert (IMATH_INTERNAL_NAMESPACE::trunc (-0.5f) == 0); - assert (IMATH_INTERNAL_NAMESPACE::trunc (1.0f) == 1); - assert (IMATH_INTERNAL_NAMESPACE::trunc (-1.0f) == -1); - assert (IMATH_INTERNAL_NAMESPACE::trunc (1.5f) == 1); - assert (IMATH_INTERNAL_NAMESPACE::trunc (-1.5f) == -1); - - cout << "divs / mods" << endl; - - assert (IMATH_INTERNAL_NAMESPACE::divs (5, 2) == 2 && - IMATH_INTERNAL_NAMESPACE::mods (5, 2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divs (4, 2) == 2 && - IMATH_INTERNAL_NAMESPACE::mods (4, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (3, 2) == 1 && - IMATH_INTERNAL_NAMESPACE::mods (3, 2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divs (2, 2) == 1 && - IMATH_INTERNAL_NAMESPACE::mods (2, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (1, 2) == 0 && - IMATH_INTERNAL_NAMESPACE::mods (1, 2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divs (0, 2) == 0 && - IMATH_INTERNAL_NAMESPACE::mods (0, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (-1, 2) == 0 && - IMATH_INTERNAL_NAMESPACE::mods (-1, 2) == -1); - assert (IMATH_INTERNAL_NAMESPACE::divs (-2, 2) == -1 && - IMATH_INTERNAL_NAMESPACE::mods (-2, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (-3, 2) == -1 && - IMATH_INTERNAL_NAMESPACE::mods (-3, 2) == -1); - assert (IMATH_INTERNAL_NAMESPACE::divs (-4, 2) == -2 && - IMATH_INTERNAL_NAMESPACE::mods (-4, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (-5, 2) == -2 && - IMATH_INTERNAL_NAMESPACE::mods (-5, 2) == -1); - - assert (IMATH_INTERNAL_NAMESPACE::divs (5, -2) == -2 && - IMATH_INTERNAL_NAMESPACE::mods (5, -2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divs (4, -2) == -2 && - IMATH_INTERNAL_NAMESPACE::mods (4, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (3, -2) == -1 && - IMATH_INTERNAL_NAMESPACE::mods (3, -2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divs (2, -2) == -1 && - IMATH_INTERNAL_NAMESPACE::mods (2, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (1, -2) == 0 && - IMATH_INTERNAL_NAMESPACE::mods (1, -2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divs (0, -2) == 0 && - IMATH_INTERNAL_NAMESPACE::mods (0, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (-1, -2) == 0 && - IMATH_INTERNAL_NAMESPACE::mods (-1, -2) == -1); - assert (IMATH_INTERNAL_NAMESPACE::divs (-2, -2) == 1 && - IMATH_INTERNAL_NAMESPACE::mods (-2, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (-3, -2) == 1 && - IMATH_INTERNAL_NAMESPACE::mods (-3, -2) == -1); - assert (IMATH_INTERNAL_NAMESPACE::divs (-4, -2) == 2 && - IMATH_INTERNAL_NAMESPACE::mods (-4, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divs (-5, -2) == 2 && - IMATH_INTERNAL_NAMESPACE::mods (-5, -2) == -1); - - cout << "divp / modp" << endl; - - assert (IMATH_INTERNAL_NAMESPACE::divp (5, 2) == 2 && - IMATH_INTERNAL_NAMESPACE::modp (5, 2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (4, 2) == 2 && - IMATH_INTERNAL_NAMESPACE::modp (4, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (3, 2) == 1 && - IMATH_INTERNAL_NAMESPACE::modp (3, 2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (2, 2) == 1 && - IMATH_INTERNAL_NAMESPACE::modp (2, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (1, 2) == 0 && - IMATH_INTERNAL_NAMESPACE::modp (1, 2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (0, 2) == 0 && - IMATH_INTERNAL_NAMESPACE::modp (0, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (-1, 2) == -1 && - IMATH_INTERNAL_NAMESPACE::modp (-1, 2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (-2, 2) == -1 && - IMATH_INTERNAL_NAMESPACE::modp (-2, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (-3, 2) == -2 && - IMATH_INTERNAL_NAMESPACE::modp (-3, 2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (-4, 2) == -2 && - IMATH_INTERNAL_NAMESPACE::modp (-4, 2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (-5, 2) == -3 && - IMATH_INTERNAL_NAMESPACE::modp (-5, 2) == 1); - - assert (IMATH_INTERNAL_NAMESPACE::divp (5, -2) == -2 && - IMATH_INTERNAL_NAMESPACE::modp (5, -2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (4, -2) == -2 && - IMATH_INTERNAL_NAMESPACE::modp (4, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (3, -2) == -1 && - IMATH_INTERNAL_NAMESPACE::modp (3, -2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (2, -2) == -1 && - IMATH_INTERNAL_NAMESPACE::modp (2, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (1, -2) == 0 && - IMATH_INTERNAL_NAMESPACE::modp (1, -2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (0, -2) == 0 && - IMATH_INTERNAL_NAMESPACE::modp (0, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (-1, -2) == 1 && - IMATH_INTERNAL_NAMESPACE::modp (-1, -2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (-2, -2) == 1 && - IMATH_INTERNAL_NAMESPACE::modp (-2, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (-3, -2) == 2 && - IMATH_INTERNAL_NAMESPACE::modp (-3, -2) == 1); - assert (IMATH_INTERNAL_NAMESPACE::divp (-4, -2) == 2 && - IMATH_INTERNAL_NAMESPACE::modp (-4, -2) == 0); - assert (IMATH_INTERNAL_NAMESPACE::divp (-5, -2) == 3 && - IMATH_INTERNAL_NAMESPACE::modp (-5, -2) == 1); - - cout << "successor, predecessor" << endl; - - testf (0); - testf (0.0f * -1.0f); - testf (1); - testf (-1); - testf (16); - testf (7); - testf (0.7f); - - union {float f; uint32_t i;} u; - u.i = 0x7f800000; // inf - testf (u.f, false); - u.i = 0xff800000; // -inf - testf (u.f, false); - u.i = 0x7f800001; // nan - testf (u.f, false); - u.i = 0x7f7fffff; // FLT_MAX - testf (u.f); - u.i = 0xff7fffff; // -FLT_MAX - testf (u.f); - - testd (0); - testd (0.0 * -1.0); - testd (1); - testd (-1); - testd (16); - testd (7); - testd (0.7); - - union {double d; uint64_t i;} v; - v.i = 0x7ff0000000000000ULL; // inf - testd (v.d, false); - v.i = 0xfff0000000000000ULL; // -inf - testd (v.d, false); - v.i = 0x7ff0000000000001ULL; // NAN - testd (v.d, false); - v.i = 0x7fefffffffffffffULL; // FLT_MAX - testd (v.d); - v.i = 0xffefffffffffffffULL; // -FLT_MAX - testd (v.d); - - cout << "ok\n" << endl; -} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testLimits.cpp b/third_party/Imath-3.1.9/src/ImathTest/testLimits.cpp deleted file mode 100644 index 87ac8d1b..00000000 --- a/third_party/Imath-3.1.9/src/ImathTest/testLimits.cpp +++ /dev/null @@ -1,153 +0,0 @@ -// -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. -// - -#ifdef NDEBUG -# undef NDEBUG -#endif - -#include "testLimits.h" -#include "half.h" -#include -#include -#include -#include "testLimits.h" - -using namespace std; - -namespace -{ - -float -mypow (int x, int y) -{ - bool negative = false; - - if (y < 0) - { - negative = true; - y = -y; - } - - float z = 1; - - while (y > 0) - { - z *= x; - y -= 1; - } - - if (negative) - z = 1 / z; - - return z; -} - -} // namespace - -void -testLimits() -{ - cout << "values in std::numeric_limits\n"; - - cout << "min_exponent\n"; - - { - half h (mypow (2, numeric_limits::min_exponent - 1)); - assert (h.isNormalized()); - } - - { - half h (mypow (2, numeric_limits::min_exponent - 2)); - assert (h.isDenormalized()); - } - - cout << "max_exponent\n"; - - { - half h (mypow (2, numeric_limits::max_exponent - 1)); - assert (h.isNormalized()); - } - - { - half h (mypow (2, numeric_limits::max_exponent)); - assert (h.isInfinity()); - } - - cout << "min_exponent10\n"; - - { - half h (mypow (10, numeric_limits::min_exponent10)); - assert (h.isNormalized()); - } - - { - half h (mypow (10, numeric_limits::min_exponent10 - 1)); - assert (h.isDenormalized()); - } - - cout << "max_exponent10\n"; - - { - half h (mypow (10, numeric_limits::max_exponent10)); - assert (h.isNormalized()); - } - - { - half h (mypow (10, numeric_limits::max_exponent10 + 1)); - assert (h.isInfinity()); - } - -#if __cplusplus >= 201103L - - cout << "max_digits10\n"; - assert (numeric_limits::max_digits10 == - std::ceil (numeric_limits::digits * std::log10 (2) + 1)); - - cout << "lowest\n"; - assert (numeric_limits::lowest() == -HALF_MAX); - -#endif - - cout << "ok\n\n" << flush; -} - -void -testHalfLimits() -{ - cout << "values in std::numeric_limits\n"; - - // For reference: - printf("HALF_DENORM_MIN %g -> 0x%04x\n", (float)HALF_DENORM_MIN, half(HALF_DENORM_MIN).bits()); - printf("HALF_NRM_MIN %g -> 0x%04x\n", (float)HALF_NRM_MIN, half(HALF_NRM_MIN).bits()); - printf("HALF_MIN %g -> 0x%04x\n", (float)HALF_MIN, half(HALF_MIN).bits()); - printf("HALF_MAX %g -> 0x%04x\n", (float)HALF_MAX, half(HALF_MAX).bits()); - printf("HALF_LOWEST %g -> 0x%04x\n", (float)-HALF_MAX, half(-HALF_MAX).bits()); - printf("HALF_EPSILON %g -> 0x%04x\n", (float)HALF_EPSILON, half(HALF_EPSILON).bits()); - printf("half posInf %g -> 0x%04x\n", (float)half::posInf(), half::posInf().bits()); - printf("half negInf %g -> 0x%04x\n", (float)half::negInf(), half::negInf().bits()); - printf("half qNan %g -> 0x%04x\n", (float)half::qNan(), half::qNan().bits()); - printf("half sNan %g -> 0x%04x\n", (float)half::sNan(), half::sNan().bits()); - printf("numeric_limits min %g -> 0x%04x\n", (float)std::numeric_limits::min(), std::numeric_limits::min().bits()); - printf("numeric_limits max %g -> 0x%04x\n", (float)std::numeric_limits::max(), std::numeric_limits::max().bits()); - printf("numeric_limits lowest %g -> 0x%04x\n", (float)std::numeric_limits::lowest(), std::numeric_limits::lowest().bits()); - printf("numeric_limits epsilon %g -> 0x%04x\n", (float)std::numeric_limits::epsilon(), std::numeric_limits::epsilon().bits()); - printf("numeric_limits round_error %g -> 0x%04x\n", (float)std::numeric_limits::round_error(), std::numeric_limits::round_error().bits()); - printf("numeric_limits infinity %g -> 0x%04x\n", (float)std::numeric_limits::infinity(), std::numeric_limits::infinity().bits()); - printf("numeric_limits quiet_NaN %g -> 0x%04x\n", (float)std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN().bits()); - printf("numeric_limits signaling_NaN %g -> 0x%04x\n", (float)std::numeric_limits::signaling_NaN(), std::numeric_limits::signaling_NaN().bits()); - printf("numeric_limits denorm_min %g -> 0x%04x\n", (float)std::numeric_limits::denorm_min(), std::numeric_limits::denorm_min().bits()); - - assert (std::numeric_limits::max() == half(HALF_MAX)); - assert (std::numeric_limits::min() == half(HALF_NRM_MIN)); - assert (std::numeric_limits::denorm_min() == half(HALF_DENORM_MIN)); - assert (std::numeric_limits::lowest() == half(-HALF_MAX)); - assert (std::numeric_limits::epsilon() == half(HALF_EPSILON)); - assert (std::numeric_limits::infinity() == half::posInf()); - assert (std::numeric_limits::quiet_NaN().bits() == half::qNan().bits()); - assert (std::numeric_limits::signaling_NaN().bits() == half::sNan().bits()); - assert (std::numeric_limits::infinity() == half::posInf()); - - cout << "ok\n\n" << flush; -} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testLineAlgo.cpp b/third_party/Imath-3.1.9/src/ImathTest/testLineAlgo.cpp deleted file mode 100644 index 36b3bae0..00000000 --- a/third_party/Imath-3.1.9/src/ImathTest/testLineAlgo.cpp +++ /dev/null @@ -1,427 +0,0 @@ -// -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. -// - -#ifdef NDEBUG -# undef NDEBUG -#endif - -#include -#include -#include -#include -#include "testLineAlgo.h" - -// Include ImathForward *after* other headers to validate forward declarations -#include - -using namespace std; -using namespace IMATH_INTERNAL_NAMESPACE; - -namespace -{ - -void -testClosestPoints (const Line3f& line1, - const Line3f& line2, - bool returnValue, - const V3f& point1, - const V3f& point2) -{ - V3f p1; - V3f p2; - bool rv = closestPoints (line1, line2, p1, p2); - - assert (rv == returnValue); - - if (rv) - { - float e = 10 * std::numeric_limits::epsilon(); - assert (point1.equalWithAbsError (p1, e)); - assert (point2.equalWithAbsError (p2, e)); - } -} - -void -testClosestPoints() -{ - cout << "closest points on two lines" << endl; - - cout << " non-intersecting, non-parallel lines" << endl; - - testClosestPoints (Line3f (V3f (0, -1, -1), V3f (0, 1, -1)), - Line3f (V3f (-1, 0, 1), V3f (1, 0, 1)), - true, - V3f (0, 0, -1), - V3f (0, 0, 1)); - - testClosestPoints (Line3f (V3f (2, -1, -1), V3f (2, 1, -1)), - Line3f (V3f (-1, 3, 1), V3f (1, 3, 1)), - true, - V3f (2, 3, -1), - V3f (2, 3, 1)); - - cout << " intersecting, non-parallel lines" << endl; - - testClosestPoints (Line3f (V3f (2, -1, 0), V3f (2, 1, 0)), - Line3f (V3f (-1, 3, 0), V3f (1, 3, 0)), - true, - V3f (2, 3, 0), - V3f (2, 3, 0)); - - cout << " parallel lines" << endl; - - testClosestPoints (Line3f (V3f (2, -1, 0), V3f (2, 1, 0)), - Line3f (V3f (2, -1, 1), V3f (2, 1, 1)), - false, - V3f (0, 0, 0), - V3f (0, 0, 0)); - - testClosestPoints (Line3f (V3f (2, -1, 0), V3f (2, 1, 0)), - Line3f (V3f (2, 1, 1), V3f (2, -1, 1)), - false, - V3f (0, 0, 0), - V3f (0, 0, 0)); - - cout << " coincident lines" << endl; - - testClosestPoints (Line3f (V3f (2, -1, 0), V3f (2, -1, 1)), - Line3f (V3f (2, -1, 0), V3f (2, -1, 1)), - false, - V3f (0, 0, 0), - V3f (0, 0, 0)); - - cout << " random lines" << endl; - - Rand48 rand (7); - - for (int i = 0; i < 10000; ++i) - { - Line3f line1 (solidSphereRand (rand) * 100.f, solidSphereRand (rand) * 100.f); - - Line3f line2 (solidSphereRand (rand) * 100.f, solidSphereRand (rand) * 100.f); - - V3f point1; - V3f point2; - bool rv = closestPoints (line1, line2, point1, point2); - - if (rv) - { - // - // We test if the line that connects point1 and point2 - // is perpendicular to line1 and line2. The numerical - // accuracy of point1 and point2 depends strongly on - // the relative directions of line1 and line2; accuracy - // degrades rather quickly if line1 and line2 become - // close to parallel. - // - - float e = 2000 * std::numeric_limits::epsilon(); - float d = 1 - (line1.dir ^ line2.dir) * (line1.dir ^ line2.dir); - V3f n = point1 - point2; - - assert (equalWithAbsError (0.0f, (line1.dir ^ n) * d, e)); - assert (equalWithAbsError (0.0f, (line2.dir ^ n) * d, e)); - } - } -} - -void -testIntersect (const Line3f& line, - const V3f& v0, - const V3f& v1, - const V3f& v2, - const V3f& point, - bool front, - bool returnValue) -{ - V3f pt; - V3f bary; - bool fr; - - bool rv = intersect (line, v0, v1, v2, pt, bary, fr); - - assert (rv == returnValue); - - float e = 10 * std::numeric_limits::epsilon(); - - if (rv) - { - assert (front == fr); - assert (pt.equalWithAbsError (point, e)); - V3f pt2 = v0 * bary.x + v1 * bary.y + v2 * bary.z; - assert (pt.equalWithAbsError (pt2, e)); - } -} - -void -testIntersect() -{ - cout << "line-triangle intersection" << endl; - - cout << " line-plane intersection inside triangle" << endl; - - testIntersect (Line3f (V3f (0, 0, -1), V3f (0, 0, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 7), - true, - true); - - testIntersect (Line3f (V3f (0, 0, -1), V3f (-1, -2, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (-1, -2, 7), - true, - true); - - testIntersect (Line3f (V3f (0, 0, -1), V3f (-1, 1, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (-1, 1, 7), - true, - true); - - testIntersect (Line3f (V3f (0, 0, -1), V3f (-1, 1, 7)), - V3f (4, -4, 7), - V3f (-4, -4, 7), - V3f (0, 6, 7), - V3f (-1, 1, 7), - false, - true); - - testIntersect (Line3f (V3f (1, 1, 2), V3f (0, 0, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 7), - true, - true); - - testIntersect (Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (-1, -2, 7), - true, - true); - - testIntersect (Line3f (V3f (2, 8, -10), V3f (-1, 1, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (-1, 1, 7), - true, - true); - - testIntersect (Line3f (V3f (-10, 2, -1), V3f (-1, 1, 7)), - V3f (4, -4, 7), - V3f (-4, -4, 7), - V3f (0, 6, 7), - V3f (-1, 1, 7), - false, - true); - - cout << " line-plane intersection outside triangle" << endl; - - testIntersect (Line3f (V3f (0, 0, -1), V3f (4, 0, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 0), - false, - false); - - testIntersect (Line3f (V3f (0, 0, -1), V3f (-4, 1, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 0), - false, - false); - - testIntersect (Line3f (V3f (0, 0, -1), V3f (0, -5, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 0), - false, - false); - - testIntersect (Line3f (V3f (0, 0, -1), V3f (0, -7, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 0), - false, - false); - - cout << " line parallel to triangle" << endl; - - testIntersect (Line3f (V3f (0, 0, -1), V3f (4, 0, -1)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 0), - false, - false); - - testIntersect (Line3f (V3f (0, 4, 7), V3f (4, 0, 7)), - V3f (-4, -4, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 0), - false, - false); - - cout << " zero-area triangle" << endl; - - testIntersect (Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), - V3f (0, 6, 7), - V3f (4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 0), - false, - false); - - testIntersect (Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), - V3f (-4, -4, 7), - V3f (-4, -4, 7), - V3f (0, 6, 7), - V3f (0, 0, 0), - false, - false); - - testIntersect (Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), - V3f (-4, -4, 7), - V3f (0, 6, 7), - V3f (0, 6, 7), - V3f (0, 0, 0), - false, - false); - - testIntersect (Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), - V3f (-4, -4, 7), - V3f (-4, -4, 7), - V3f (-4, -4, 7), - V3f (0, 0, 0), - false, - false); - - cout << " random lines and triangles" << endl; - - Rand48 rand (8); - - for (int i = 0; i < 10000; ++i) - { - // - // Generate a random triangle with non-zero area - // - - V3f v0, v1, v2; - V3f normal; - - do - { - v0 = solidSphereRand (rand); - v1 = solidSphereRand (rand); - v2 = solidSphereRand (rand); - normal = (v2 - v1) % (v1 - v0); - } while (normal.length() < 0.01); - - { - // - // Generate a line that intersects inside the triangle - // - - V3f b; - - do - { - b.x = float(rand.nextf (0.001, 0.999)); - b.y = float(rand.nextf (0.001, 0.999)); - b.z = 1 - b.x - b.y; - } while (b.x + b.y > 0.999); - - V3f p1 = v0 * b.x + v1 * b.y + v2 * b.z; - - V3f p0; - - do - { - p0 = solidSphereRand (rand); - } while (abs (normal.normalized() ^ (p1 - p0).normalized()) < 0.1); - - // - // Test for intersection - // - - V3f point; - V3f bary; - bool front; - - bool rv = intersect (Line3f (p0, p1), v0, v1, v2, point, bary, front); - - assert (rv == true); - - float nd = abs (normal.normalized() ^ (p1 - p0).normalized()); - float ep = 20 * std::numeric_limits::epsilon() / nd; - - assert (point.equalWithAbsError (p1, ep)); - } - - { - // - // Generate a line that intersects the triangle's plane - // but outside the triangle - // - - V3f b; - - do - { - b.x = float(rand.nextf (-3, 3)); - b.y = float(rand.nextf (-3, 3)); - b.z = 1 - b.x - b.y; - } while (b.x > -0.001 && b.y > -0.001 && b.z > -0.001); - - V3f p1 = v0 * b.x + v1 * b.y + v2 * b.z; - - V3f p0; - - do - { - p0 = solidSphereRand (rand) * 10; - } while (abs (normal.normalized() ^ (p1 - p0).normalized()) < 0.1); - - // - // Test for intersection - // - - V3f point; - V3f bary; - bool front; - - bool rv = intersect (Line3f (p0, p1), v0, v1, v2, point, bary, front); - - assert (rv == false); - } - } -} - -} // namespace - -void -testLineAlgo() -{ - cout << "Testing line algorithms" << endl; - - testClosestPoints(); - testIntersect(); - - cout << "ok\n" << endl; -} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testShear.cpp b/third_party/Imath-3.1.9/src/ImathTest/testShear.cpp deleted file mode 100644 index 21b9e9bf..00000000 --- a/third_party/Imath-3.1.9/src/ImathTest/testShear.cpp +++ /dev/null @@ -1,176 +0,0 @@ -// -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. -// - -#ifdef NDEBUG -# undef NDEBUG -#endif - -#include -#include -#include -#include -#include "testShear.h" - -// Include ImathForward *after* other headers to validate forward declarations -#include - -using namespace std; - -void -testShear() -{ - cout << "Testing functions in ImathShear.h" << endl; - - cout << "Imath::Shear6 constructors" << endl; - - const float epsilon = std::numeric_limits::epsilon(); - - IMATH_INTERNAL_NAMESPACE::Shear6f testConstructor1; - IMATH_INTERNAL_NAMESPACE::Shear6f testConstructor2 (testConstructor1); - - testConstructor1 = testConstructor2; - - IMATH_INTERNAL_NAMESPACE::Shear6f testConstructor3 (52, 128, 254, 127, 12, -20); - IMATH_INTERNAL_NAMESPACE::Shear6f A (testConstructor3); - IMATH_INTERNAL_NAMESPACE::Shear6f B = A; - IMATH_INTERNAL_NAMESPACE::Shear6f X, Y, tmp; - - assert (A == B); - - cout << "Imath::Shear6 * f" << endl; - - assert ((IMATH_INTERNAL_NAMESPACE::Shear6f (0.330f, 0.710f, 0.010f, 0.999f, -0.531f, -0.012f) * - 0.999f) == IMATH_INTERNAL_NAMESPACE::Shear6f (0.330f * 0.999f, - 0.710f * 0.999f, - 0.010f * 0.999f, - 0.999f * 0.999f, - -0.531f * 0.999f, - -0.012f * 0.999f)); - - cout << "Imath::Shear6 / f" << endl; - - assert ((IMATH_INTERNAL_NAMESPACE::Shear6f (0.330f, 0.710f, 0.010f, 0.999f, -0.531f, -0.012f) / - 0.999f) == IMATH_INTERNAL_NAMESPACE::Shear6f (0.330f / 0.999f, - 0.710f / 0.999f, - 0.010f / 0.999f, - 0.999f / 0.999f, - -0.531f / 0.999f, - -0.012f / 0.999f)); - - cout << "Assignment and comparison" << endl; - - B = A; - assert (B == A); - assert (!(B != A)); - - X = Y = IMATH_INTERNAL_NAMESPACE::Shear6f (0.123f, -0.420f, 0.501f, 0.998f, -0.231f, -0.034f); - - X *= 0.001f; - - assert (std::fabs ((Y.xy * 0.001f) - X.xy) <= epsilon && - std::fabs ((Y.xz * 0.001f) - X.xz) <= epsilon && - std::fabs ((Y.yz * 0.001f) - X.yz) <= epsilon && - std::fabs ((Y.yx * 0.001f) - X.yx) <= epsilon && - std::fabs ((Y.zx * 0.001f) - X.zx) <= epsilon && - std::fabs ((Y.zy * 0.001f) - X.zy) <= epsilon); - - X = Y = IMATH_INTERNAL_NAMESPACE::Shear6f (0.123f, -0.420f, 0.501f, 0.998f, -0.231f, -0.034f); - - X /= -1.001f; - - assert (std::fabs ((Y.xy / -1.001f) - X.xy) <= epsilon && - std::fabs ((Y.xz / -1.001f) - X.xz) <= epsilon && - std::fabs ((Y.yz / -1.001f) - X.yz) <= epsilon && - std::fabs ((Y.yx / -1.001f) - X.yx) <= epsilon && - std::fabs ((Y.zx / -1.001f) - X.zx) <= epsilon && - std::fabs ((Y.zy / -1.001f) - X.zy) <= epsilon); - - Y = IMATH_INTERNAL_NAMESPACE::Shear6f (0.998f, -0.001f, 0.501f, 1.001f, -0.231f, -0.034f); - X = IMATH_INTERNAL_NAMESPACE::Shear6f (0.011f, -0.420f, -0.501f, 0.998f, -0.231f, -0.034f); - - tmp = X + Y; - - assert (std::fabs ((X.xy + Y.xy) - tmp.xy) <= epsilon && - std::fabs ((X.xz + Y.xz) - tmp.xz) <= epsilon && - std::fabs ((X.yz + Y.yz) - tmp.yz) <= epsilon && - std::fabs ((X.yx + Y.yx) - tmp.yx) <= epsilon && - std::fabs ((X.zx + Y.zx) - tmp.zx) <= epsilon && - std::fabs ((X.zy + Y.zy) - tmp.zy) <= epsilon); - - tmp = X - Y; - - assert (std::fabs ((X.xy - Y.xy) - tmp.xy) <= epsilon && - std::fabs ((X.xz - Y.xz) - tmp.xz) <= epsilon && - std::fabs ((X.yz - Y.yz) - tmp.yz) <= epsilon && - std::fabs ((X.yx - Y.yx) - tmp.yx) <= epsilon && - std::fabs ((X.zx - Y.zx) - tmp.zx) <= epsilon && - std::fabs ((X.zy - Y.zy) - tmp.zy) <= epsilon); - - tmp = X * Y; - - assert (std::fabs ((X.xy * Y.xy) - tmp.xy) <= epsilon && - std::fabs ((X.xz * Y.xz) - tmp.xz) <= epsilon && - std::fabs ((X.yz * Y.yz) - tmp.yz) <= epsilon && - std::fabs ((X.yx * Y.yx) - tmp.yx) <= epsilon && - std::fabs ((X.zx * Y.zx) - tmp.zx) <= epsilon && - std::fabs ((X.zy * Y.zy) - tmp.zy) <= epsilon); - - tmp = X / Y; - - // - // epsilon doesn't work here. - // - assert (std::fabs ((X.xy / Y.xy) - tmp.xy) <= 1e-5f && - std::fabs ((X.xz / Y.xz) - tmp.xz) <= 1e-5f && - std::fabs ((X.yz / Y.yz) - tmp.yz) <= 1e-5f && - std::fabs ((X.yx / Y.yx) - tmp.yx) <= 1e-5f && - std::fabs ((X.zx / Y.zx) - tmp.zx) <= 1e-5f && - std::fabs ((X.zy / Y.zy) - tmp.zy) <= 1e-5f); - - tmp = X; - tmp += Y; - - assert (std::fabs ((X.xy + Y.xy) - tmp.xy) <= epsilon && - std::fabs ((X.xz + Y.xz) - tmp.xz) <= epsilon && - std::fabs ((X.yz + Y.yz) - tmp.yz) <= epsilon && - std::fabs ((X.yx + Y.yx) - tmp.yx) <= epsilon && - std::fabs ((X.zx + Y.zx) - tmp.zx) <= epsilon && - std::fabs ((X.zy + Y.zy) - tmp.zy) <= epsilon); - - tmp = X; - tmp -= Y; - - assert (std::fabs ((X.xy - Y.xy) - tmp.xy) <= epsilon && - std::fabs ((X.xz - Y.xz) - tmp.xz) <= epsilon && - std::fabs ((X.yz - Y.yz) - tmp.yz) <= epsilon && - std::fabs ((X.yx - Y.yx) - tmp.yx) <= epsilon && - std::fabs ((X.xz - Y.xz) - tmp.xz) <= epsilon && - std::fabs ((X.yz - Y.yz) - tmp.yz) <= epsilon); - - tmp = X; - tmp *= Y; - - assert (std::fabs ((X.xy * Y.xy) - tmp.xy) <= epsilon && - std::fabs ((X.xz * Y.xz) - tmp.xz) <= epsilon && - std::fabs ((X.yz * Y.yz) - tmp.yz) <= epsilon && - std::fabs ((X.yx * Y.yx) - tmp.yx) <= epsilon && - std::fabs ((X.zx * Y.zx) - tmp.zx) <= epsilon && - std::fabs ((X.zy * Y.zy) - tmp.zy) <= epsilon); - - tmp = X; - tmp /= Y; - - // - // epsilon doesn't work here. - // - assert (std::fabs ((X.xy / Y.xy) - tmp.xy) <= 1e-5f && - std::fabs ((X.xz / Y.xz) - tmp.xz) <= 1e-5f && - std::fabs ((X.yz / Y.yz) - tmp.yz) <= 1e-5f && - std::fabs ((X.yx / Y.yx) - tmp.yx) <= 1e-5f && - std::fabs ((X.zx / Y.zx) - tmp.zx) <= 1e-5f && - std::fabs ((X.zy / Y.zy) - tmp.zy) <= 1e-5f); - - cout << "ok\n" << endl; -} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testVec.cpp b/third_party/Imath-3.1.9/src/ImathTest/testVec.cpp deleted file mode 100644 index 5bcab006..00000000 --- a/third_party/Imath-3.1.9/src/ImathTest/testVec.cpp +++ /dev/null @@ -1,258 +0,0 @@ -// -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. -// - -#ifdef NDEBUG -# undef NDEBUG -#endif - -#include -#include -#include -#include -#include -#include "testVec.h" - -// Include ImathForward *after* other headers to validate forward declarations -#include - -using namespace std; -using namespace IMATH_INTERNAL_NAMESPACE; - -namespace -{ - -template -void -testLength2T() -{ - const T s = std::sqrt (std::numeric_limits::min()); - const T e = 4 * std::numeric_limits::epsilon(); - - Vec2 v; - - v = Vec2 (0, 0); - assert (v.length() == 0); - assert (v.normalized().length() == 0); - - v = Vec2 (3, 4); - assert (v.length() == 5); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - v = Vec2 (3000, 4000); - assert (v.length() == 5000); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - T t = s * (1 << 4); - - v = Vec2 (t, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec2 (0, t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec2 (-t, -t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t * std::sqrt (2), t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - t = s / (1 << 4); - - v = Vec2 (t, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec2 (0, t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec2 (-t, -t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t * std::sqrt (2), t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - t = s / (1 << 20); - - v = Vec2 (t, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec2 (0, t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec2 (-t, -t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t * std::sqrt (2), t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); -} - -template -void -testLength3T() -{ - const T s = std::sqrt (std::numeric_limits::min()); - const T e = 4 * std::numeric_limits::epsilon(); - - Vec3 v; - - v = Vec3 (0, 0, 0); - assert (v.length() == 0); - assert (v.normalized().length() == 0); - - v = Vec3 (3, 4, 0); - assert (v.length() == 5); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - v = Vec3 (3000, 4000, 0); - assert (v.length() == 5000); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - v = Vec3 (1, -1, 1); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), 1 * std::sqrt (3), e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - v = Vec3 (1000, -1000, 1000); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), 1000 * std::sqrt (3), 1000 * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - T t = s * (1 << 4); - - v = Vec3 (t, 0, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec3 (0, t, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec3 (0, 0, t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec3 (-t, -t, -t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t * std::sqrt (3), t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - t = s / (1 << 4); - - v = Vec3 (t, 0, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec3 (0, t, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec3 (0, 0, t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec3 (-t, -t, -t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t * std::sqrt (3), t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - t = s / (1 << 20); - - v = Vec3 (t, 0, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec3 (0, t, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec3 (0, 0, t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec3 (-t, -t, -t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t * std::sqrt (3), t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); -} - -template -void -testLength4T() -{ - const T s = std::sqrt (std::numeric_limits::min()); - const T e = 4 * std::numeric_limits::epsilon(); - - Vec4 v; - - v = Vec4 (0, 0, 0, 0); - assert (v.length() == 0); - assert (v.normalized().length() == 0); - - v = Vec4 (3, 4, 0, 0); - assert (v.length() == 5); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - v = Vec4 (3000, 4000, 0, 0); - assert (v.length() == 5000); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - v = Vec4 (1, -1, 1, 1); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), 2, e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - v = Vec4 (1000, -1000, 1000, 1000); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), 2000, 1000 * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - T t = s * (1 << 4); - - v = Vec4 (t, 0, 0, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (0, t, 0, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (0, 0, t, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (0, 0, 0, t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (-t, -t, -t, -t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t * 2, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - t = s / (1 << 4); - - v = Vec4 (t, 0, 0, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (0, t, 0, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (0, 0, t, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (0, 0, 0, t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (-t, -t, -t, -t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t * 2, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - - t = s / (1 << 20); - - v = Vec4 (t, 0, 0, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (0, t, 0, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (0, 0, t, 0); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (0, 0, 0, t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); - v = Vec4 (-t, -t, -t, -t); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.length(), t * 2, t * e)); - assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized().length(), 1, e)); -} - -} // namespace - -void -testVec() -{ - cout << "Testing some basic vector operations" << endl; - - testLength2T(); - testLength2T(); - testLength3T(); - testLength3T(); - testLength4T(); - testLength4T(); - - cout << "ok\n" << endl; -} diff --git a/third_party/Imath-3.1.9/src/python/PyImathTest/testStringTable.h b/third_party/Imath-3.1.9/src/python/PyImathTest/testStringTable.h deleted file mode 100644 index 1ef13a53..00000000 --- a/third_party/Imath-3.1.9/src/python/PyImathTest/testStringTable.h +++ /dev/null @@ -1,2 +0,0 @@ -void testStringTable(); - diff --git a/third_party/Imath-3.1.9/.clang-format b/third_party/Imath/.clang-format similarity index 75% rename from third_party/Imath-3.1.9/.clang-format rename to third_party/Imath/.clang-format index 1f6f5854..7c1a7d76 100644 --- a/third_party/Imath-3.1.9/.clang-format +++ b/third_party/Imath/.clang-format @@ -1,21 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. --- Language: Cpp -BasedOnStyle: LLVM -AccessModifierOffset: -2 -AlignAfterOpenBracket: Align +# BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignAfterOpenBracket: AlwaysBreak AlignConsecutiveAssignments: true -AlignConsecutiveDeclarations: false +AlignConsecutiveDeclarations: true AlignEscapedNewlines: Right AlignOperands: true AlignTrailingComments: true -AllowAllArgumentsOnNextLine: false -AllowAllConstructorInitializersOnNextLine: true -AllowAllParametersOfDeclarationOnNextLine: false -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false +# AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +# AllowAllConstructorInitializersOnNextLine: true +AllowShortBlocksOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: true AllowShortFunctionsOnASingleLine: InlineOnly -AllowShortIfStatementsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: true AllowShortLoopsOnASingleLine: false +# AllowShortLambdasOnASingleLine: true +# ArrayInitializerAlignmentStyle: Left AlwaysBreakAfterDefinitionReturnType: TopLevel AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false @@ -23,7 +27,6 @@ AlwaysBreakTemplateDeclarations: MultiLine BinPackArguments: false BinPackParameters: false BraceWrapping: - AfterCaseLabel: true AfterClass: true AfterControlStatement: true AfterEnum: true @@ -44,16 +47,17 @@ BreakBeforeBraces: Custom BreakBeforeInheritanceComma: false BreakInheritanceList: BeforeColon BreakBeforeTernaryOperators: true -BreakConstructorInitializers: BeforeColon +BreakConstructorInitializersBeforeComma: true +BreakConstructorInitializers: BeforeComma BreakAfterJavaFieldAnnotations: false BreakStringLiterals: false -ColumnLimit: 100 +ColumnLimit: 80 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 -Cpp11BracedListStyle: false +Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false FixNamespaceComments: true @@ -70,7 +74,7 @@ IncludeCategories: - Regex: '.*' Priority: 1 IncludeIsMainRegex: '(Test|_test)?$' -IndentCaseLabels: false +IndentCaseLabels: true IndentPPDirectives: AfterHash IndentWidth: 4 IndentWrappedFunctionNames: false @@ -85,7 +89,7 @@ ObjCBinPackProtocolList: Auto ObjCBlockIndentWidth: 4 ObjCSpaceAfterProperty: true ObjCSpaceBeforeProtocolList: true -PenaltyBreakAssignment: 8 +PenaltyBreakAssignment: 4 PenaltyBreakBeforeFirstCallParameter: 8 PenaltyBreakComment: 1000 PenaltyBreakFirstLessLess: 120 @@ -95,17 +99,16 @@ PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 20 PointerAlignment: Left ReflowComments: false -SortIncludes: true +SortIncludes: false SortUsingDeclarations: true SpaceAfterCStyleCast: true SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true -SpaceBeforeCpp11BracedList: true +SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true -SpaceBeforeParens: NonEmptyParentheses -SpaceBeforeRangeBasedForLoopColon: true -SpaceInEmptyBlock: false +SpaceBeforeParens: Always +SpaceBeforeRangeBasedForLoopColon: false SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false @@ -113,8 +116,8 @@ SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false -SpacesInConditionalStatement: false Standard: Cpp11 -TabWidth: 4 +TabWidth: 8 +#UseTab: ForIndentation UseTab: Never ... diff --git a/third_party/Imath/.git-blame-ignore-revs b/third_party/Imath/.git-blame-ignore-revs new file mode 100644 index 00000000..8a625f5d --- /dev/null +++ b/third_party/Imath/.git-blame-ignore-revs @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + +# if you have git newer than 2.23, you can either +# specify this on the command line +# git blame foo.cpp --ignore-revs-file path/to/this/file +# or add this file to your config (use global to change your global user pref) +# git config [--global] blame.ignoreRevsFile .git-blame-ignore-revs + +# initial clang-format run +338c9a051c5b7569bbb06f200618feaba59a14c6 diff --git a/third_party/Imath/.github/dependabot.yml b/third_party/Imath/.github/dependabot.yml new file mode 100644 index 00000000..054cb50e --- /dev/null +++ b/third_party/Imath/.github/dependabot.yml @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + day: "monday" + interval: "weekly" + + - package-ecosystem: "gitsubmodule" + directory: "/" + schedule: + day: "monday" + interval: "weekly" diff --git a/third_party/Imath-3.1.9/.github/workflows/analysis_workflow.yml b/third_party/Imath/.github/workflows/analysis_workflow.yml similarity index 93% rename from third_party/Imath-3.1.9/.github/workflows/analysis_workflow.yml rename to third_party/Imath/.github/workflows/analysis_workflow.yml index 3df49517..aab7d3bc 100644 --- a/third_party/Imath-3.1.9/.github/workflows/analysis_workflow.yml +++ b/third_party/Imath/.github/workflows/analysis_workflow.yml @@ -12,6 +12,9 @@ on: - cron: "0 0 * * 0" workflow_dispatch: +permissions: + contents: read + jobs: # --------------------------------------------------------------------------- @@ -19,13 +22,13 @@ jobs: # --------------------------------------------------------------------------- linux_sonarcloud: - name: 'SonarCloud Linux CentOS 7 VFX CY2022 ' + name: 'SonarCloud Linux CentOS 7 VFX CY2024 ' # GH-hosted VM. The build runs in CentOS 7 'container' defined below. runs-on: ubuntu-latest container: # DockerHub: https://hub.docker.com/u/aswf # Source: https://github.com/AcademySoftwareFoundation/aswf-docker - image: aswf/ci-openexr:2022 + image: aswf/ci-openexr:2024 env: CXX: g++ CC: gcc @@ -47,7 +50,7 @@ jobs: cmake .. \ -DCMAKE_INSTALL_PREFIX=../_install \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \ -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \ -DCMAKE_C_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \ @@ -77,19 +80,19 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: sonar-scanner -X -Dsonar.login=$SONAR_TOKEN + run: sonar-scanner -X # ------------------------------------------------------------------------------ # Valgrind memcheck test # ------------------------------------------------------------------------------ linux_valgrind: - name: 'Valgrind Linux CentOS 7 VFX CY2022 ' + name: 'Valgrind Linux CentOS 7 VFX CY2024 ' # GH-hosted VM. The build runs in CentOS 7 'container' defined below. runs-on: ubuntu-latest container: # DockerHub: https://hub.docker.com/u/aswf # Source: https://github.com/AcademySoftwareFoundation/aswf-docker - image: aswf/ci-openexr:2022 + image: aswf/ci-openexr:2024 env: CXX: g++ CC: gcc @@ -116,7 +119,7 @@ jobs: cmake .. \ -DCMAKE_INSTALL_PREFIX=../_install \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ -DBUILD_SHARED_LIBS='OFF' \ -DPYTHON='ON' diff --git a/third_party/Imath-3.1.9/.github/workflows/ci_workflow.yml b/third_party/Imath/.github/workflows/ci_workflow.yml similarity index 81% rename from third_party/Imath-3.1.9/.github/workflows/ci_workflow.yml rename to third_party/Imath/.github/workflows/ci_workflow.yml index 18d59eba..6bb2c7f5 100644 --- a/third_party/Imath-3.1.9/.github/workflows/ci_workflow.yml +++ b/third_party/Imath/.github/workflows/ci_workflow.yml @@ -1,19 +1,34 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright Contributors to the OpenEXR Project. +# Copyright (c) Contributors to the OpenEXR Project. # # GitHub Actions workflow file # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions name: CI +# Run on all changes except: +# - doc file changes +# - changes to the website, since yhe website has a separate workflow +# - changes to workflows other than this one + on: push: - # Jobs are skipped when ONLY Markdown (*.md) files are changed - paths-ignore: - - '**.md' + paths: + - '**' + - '!**.md' + - '!website/**' + - '!.github/workflows/**' + - '.github/workflows/ci_workflow.yml' pull_request: - paths-ignore: - - '**.md' + paths: + - '**' + - '!**.md' + - '!website/**' + - '!.github/workflows/**' + - '.github/workflows/ci_workflow.yml' + +permissions: + contents: read jobs: # Linux jobs run in Docker containers, so the latest OS version is OK. macOS @@ -45,214 +60,134 @@ jobs: image: aswf/ci-openexr:${{ matrix.vfx-cy }} strategy: matrix: - build: [1, 2, 3, 4, 9, 10, 11, 12, 13, 14, 15, 20, 21, 22] + build: [1, 2, 3, 4, 5, 6, 7, 8, 9] include: # ------------------------------------------------------------------- - # GCC, VFX CY2022 + # GCC, VFX CY2023 # ------------------------------------------------------------------- - # C++17, Python 3.9 + # C++17, Python 3.10.9 - build: 1 build-type: Release build-shared: 'ON' cxx-standard: 17 cxx-compiler: g++ cc-compiler: gcc - compiler-desc: gcc9.3.1 + compiler-desc: gcc11.2.1 python: 'ON' - python-desc: python3.9.7 - vfx-cy: 2022 + python-desc: python3.10.9 + vfx-cy: 2023 - # C++17, Python 3.9.7, Debug + # C++17, Python 3.10.9, Debug - build: 2 build-type: Debug build-shared: 'ON' cxx-standard: 17 cxx-compiler: g++ cc-compiler: gcc - compiler-desc: gcc9.3.1 + compiler-desc: gcc11.2.1 python: 'ON' - python-desc: python3.9.7 - vfx-cy: 2022 + python-desc: python3.10.9 + vfx-cy: 2023 - # C++17, Python 3.9.7, Static + # C++17, Python 3.10.9, Static - build: 3 build-type: Release build-shared: 'OFF' cxx-standard: 17 cxx-compiler: g++ cc-compiler: gcc - compiler-desc: gcc9.3.1 + compiler-desc: gcc11.2.1 python: 'ON' - python-desc: python3.9.7 - vfx-cy: 2022 + python-desc: python3.10.9 + vfx-cy: 2023 - # C++14, Python 3.9.7, Static + # C++14, Python 3.10.9 - build: 4 build-type: Release build-shared: 'ON' cxx-standard: 14 cxx-compiler: g++ cc-compiler: gcc - compiler-desc: gcc9.3.1 + compiler-desc: gcc11.2.1 python: 'ON' - python-desc: python3.9.7 - vfx-cy: 2022 - - # C++17, no Python - # - build: 5 - # build-type: Release - # build-shared: 'ON' - # cxx-standard: 17 - # cxx-compiler: g++ - # cc-compiler: gcc - # compiler-desc: gcc9.3.1 - # python: 'OFF' - # python-desc: no python - # vfx-cy: 2022 + python-desc: python3.10.9 + vfx-cy: 2023 # ------------------------------------------------------------------- - # GCC, VFX CY2021 + # Clang 15.0, VFX CY2023 # ------------------------------------------------------------------- - # C++17, Python 3.7.9 - - build: 9 + # C++17, Python 3.10.9 + - build: 5 build-type: Release build-shared: 'ON' cxx-standard: 17 - cxx-compiler: g++ - cc-compiler: gcc - compiler-desc: gcc9.3.1 - python: 'ON' - python-desc: python3.7.9 - vfx-cy: 2021 - - # ------------------------------------------------------------------- - # GCC, VFX CY2020 - # ------------------------------------------------------------------- - # C++14, Python 3.7 - - build: 10 - build-type: Release - build-shared: 'ON' - cxx-standard: 14 - cxx-compiler: g++ - cc-compiler: gcc - compiler-desc: gcc6.3.1 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: clang15.0 python: 'ON' - python-desc: python3.7.3 - vfx-cy: 2020 + python-desc: python3.10.9 + vfx-cy: 2023 # ------------------------------------------------------------------- - # GCC, VFX CY2019 + # Clang 14.0, VFX CY2023 # ------------------------------------------------------------------- - # C++11, Python 2.7 - - build: 11 + # C++17, Python 3.10.9 + - build: 6 build-type: Release build-shared: 'ON' - use-python2: 'ON' - cxx-standard: 11 - cxx-compiler: g++ - cc-compiler: gcc - compiler-desc: gcc6.3.1 + cxx-standard: 17 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: clang14.0 python: 'ON' - python-desc: python2.7.15 - vfx-cy: 2019 + python-desc: python3.10.9 + vfx-cy: 2023 # ------------------------------------------------------------------- - # Clang, VFX CY2022 + # GCC, VFX CY2022 # ------------------------------------------------------------------- # C++17, Python 3.9 - - build: 12 + - build: 7 build-type: Release build-shared: 'ON' cxx-standard: 17 - cxx-compiler: clang++ - cc-compiler: clang - compiler-desc: clang10.4 - python: 'ON' - python-desc: python3.9.7 - vfx-cy: 2022 - - # C++17, Python 3.9.7, Debug - - build: 13 - build-type: Debug - build-shared: 'ON' - cxx-standard: 17 - cxx-compiler: clang++ - cc-compiler: clang - compiler-desc: clang10.4 - python: 'ON' - python-desc: python3.9.7 - vfx-cy: 2022 - - # C++17, Python 3.9.7, Static - - build: 14 - build-type: Release - build-shared: 'OFF' - cxx-standard: 17 - cxx-compiler: clang++ - cc-compiler: clang - compiler-desc: clang10.4 - python: 'ON' - python-desc: python3.9.7 - vfx-cy: 2022 - - # C++14, Python 3.9.7, Static - - build: 15 - build-type: Release - build-shared: 'ON' - cxx-standard: 14 - cxx-compiler: clang++ - cc-compiler: clang - compiler-desc: clang10.4 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc9.3.1 python: 'ON' python-desc: python3.9.7 vfx-cy: 2022 # ------------------------------------------------------------------- - # Clang, VFX CY2021 + # GCC, VFX CY2021 # ------------------------------------------------------------------- # C++17, Python 3.7.9 - - build: 20 + - build: 8 build-type: Release build-shared: 'ON' cxx-standard: 17 - cxx-compiler: clang++ - cc-compiler: clang - compiler-desc: clang10.4 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc9.3.1 python: 'ON' python-desc: python3.7.9 vfx-cy: 2021 # ------------------------------------------------------------------- - # Clang, VFX CY2020 + # GCC, VFX CY2020 # ------------------------------------------------------------------- # C++14, Python 3.7 - - build: 21 + - build: 9 build-type: Release build-shared: 'ON' cxx-standard: 14 - cxx-compiler: clang++ - cc-compiler: clang - compiler-desc: clang7.8 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc6.3.1 python: 'ON' python-desc: python3.7.3 vfx-cy: 2020 - # ------------------------------------------------------------------- - # Clang, VFX CY2019 - # ------------------------------------------------------------------- - # C++11, Python 2.7 - - build: 22 - build-type: Release - build-shared: 'ON' - use-python2: 'ON' - cxx-standard: 11 - cxx-compiler: clang++ - cc-compiler: clang - compiler-desc: clang7.8 - python: 'ON' - python-desc: python2.7.15 - vfx-cy: 2019 - env: CXX: ${{ matrix.cxx-compiler }} CC: ${{ matrix.cc-compiler }} @@ -301,7 +236,7 @@ jobs: ./bin/ImathTest # Confirm the examples compile and execute rm -rf bin CMakeCache.txt CMakeFiles cmake_install.cmake Makefile - cmake ../docs/examples \ + cmake ../website/examples \ -DCMAKE_PREFIX_PATH=../../_install \ -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ @@ -571,7 +506,6 @@ jobs: # run: | # share/ci/scripts/windows/install_python.ps1 ${{ matrix.python-version }} $HOME # share/ci/scripts/windows/install_boost.ps1 ${{ matrix.boost-version }} $HOME 3.8 - # share/ci/scripts/windows/install_zlib.ps1 ${{ matrix.zlib-version }} $HOME # shell: powershell - name: Configure run: | @@ -584,8 +518,6 @@ jobs: -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} # NB: removed trailing slash from these lines # -DBOOST_ROOT:FILEPATH=$BOOST_ROOT - # -DZLIB_ROOT:FILEPATH="$ZLIB_ROOT" - # -DZLIB_LIBRARY:FILEPATH="$ZLIB_ROOT/lib/${{ matrix.zlib-lib }}" # -DPYTHON='ON' # -DPython_EXECUTABLE:FILEPATH="$PYTHON_ROOT" # -DPython_INCLUDE_DIR:FILEPATH="$PYTHON_ROOT/include" @@ -609,14 +541,14 @@ jobs: shell: bash working-directory: _build - Docs: + Website: # Build the documentation, using a process that mimics the readthedoc build. # # Note that this job does not actually build Imath libraries, # it just runs doxygen and sphinx. - name: 'Docs' + name: 'Website' runs-on: ubuntu-latest steps: @@ -628,14 +560,14 @@ jobs: # Need help2man for tool manpages run: sudo apt-get install -y doxygen help2man - name: Install sphinx requirements - run: pip3 install -r docs/requirements.txt + run: pip3 install -r website/requirements.txt - name: Configure - run: cmake .. -DBUILD_DOCS='ON' + run: cmake .. -DBUILD_WEBSITE='ON' working-directory: _build - name: Build run: | cmake --build . \ - --target docs \ + --target website \ --config Release working-directory: _build diff --git a/third_party/Imath/.github/workflows/release-notice.yml b/third_party/Imath/.github/workflows/release-notice.yml new file mode 100644 index 00000000..adc8adea --- /dev/null +++ b/third_party/Imath/.github/workflows/release-notice.yml @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + +name: Publish Release Notice to ASWF Slack + +on: + release: + types: + - published + # published should cover both 'released' and 'prereleased' + +permissions: + contents: read + +jobs: + publish: + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: 'Notify Slack #release-announcements' + id: slack1 + with: + project_name: "Imath" + slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }} + slack_channel: "#release-announcements" + project_logo: "https://artwork.aswf.io/projects/openexr/icon/color/openexr-icon-color.png" + uses: jmertic/slack-release-notifier@main + + - name: 'Notify Slack #openexr' + id: slack2 + with: + project_name: "Imath" + slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }} + slack_channel: "#openexr" + project_logo: "https://artwork.aswf.io/projects/openexr/icon/color/openexr-icon-color.png" + uses: jmertic/slack-release-notifier@main + diff --git a/third_party/Imath/.github/workflows/release-sign.yml b/third_party/Imath/.github/workflows/release-sign.yml new file mode 100644 index 00000000..bf6ab58b --- /dev/null +++ b/third_party/Imath/.github/workflows/release-sign.yml @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + +# +# Releases are signed via https://github.com/sigstore/sigstore-python. +# See https://docs.sigstore.dev for information about sigstore. +# +# This action creates a .tar.gz of the complete Imath source tree at +# the given release tag, signs it via sigstore, and uploads the +# .tar.gz and the associated .tar.gz.sigstore credential bundle. +# +# To verify a downloaded release at a given tag: +# +# % pip install sigstore +# % sigstore verify github --cert-identity https://github.com/AcademySoftwareFoundation/Imath/.github/workflows/release-sign.yml@refs/tags/ Imath-.tar.gz +# + +name: Sign Release + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + release: + name: Sign & upload release artifacts + runs-on: ubuntu-latest + + env: + TAG: ${{ github.ref_name }} + permissions: + contents: write + id-token: write + repository-projects: write + + steps: + - name: Set Prefix + # The tag name begins with a 'v', e.g. "v3.2.4", but the prefix + # should omit the 'v', so the tarball "Imath-3.2.4.tar.gz" + # extracts files into "Imath-v3.2.4/...". This matches + # the GitHub release page autogenerated artifact conventions. + run: | + echo IMATH_PREFIX=Imath-${TAG//v}/ >> $GITHUB_ENV + echo IMATH_TARBALL=Imath-${TAG//v}.tar.gz >> $GITHUB_ENV + shell: bash + + - name: Checkout + uses: actions/checkout@v2 + + - name: Create archive + run: git archive --format=tar.gz -o ${IMATH_TARBALL} --prefix ${IMATH_PREFIX} ${TAG} + + - name: Sign archive with Sigstore + uses: sigstore/gh-action-sigstore-python@v2.1.1 + with: + inputs: ${{ env.IMATH_TARBALL }} + + - name: Upload release archive + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload ${{ github.ref_name }} ${IMATH_TARBALL} ${IMATH_TARBALL}.sigstore + diff --git a/third_party/Imath/.github/workflows/scorecard.yml b/third_party/Imath/.github/workflows/scorecard.yml new file mode 100644 index 00000000..f12ff879 --- /dev/null +++ b/third_party/Imath/.github/workflows/scorecard.yml @@ -0,0 +1,56 @@ +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '32 3 * * 1' + push: + branches: [ "main" ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + + steps: + - name: "Checkout code" + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + with: + results_file: results.sarif + results_format: sarif + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + publish_results: true + + # Upload the results as artifacts (optional) + - name: "Upload artifact" + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3.24.10 + with: + sarif_file: results.sarif diff --git a/third_party/Imath/.github/workflows/website_preview_link.yml b/third_party/Imath/.github/workflows/website_preview_link.yml new file mode 100644 index 00000000..b7592c3e --- /dev/null +++ b/third_party/Imath/.github/workflows/website_preview_link.yml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. +# +# GitHub Actions workflow file +# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions + +# +# This action adds a link to the PR description pointing to the +# readthedocs build of the website, for PRs that modify the website. +# +# Note that the link is also available in the PR checks, but it gets +# buried among the output of the checks and isn't obvious. +# + +name: Website preview link +on: + pull_request_target: + types: + - opened + paths: + - 'website/**' + +permissions: + contents: read + +jobs: + + pull-request-links: + + runs-on: ubuntu-latest + + permissions: + pull-requests: write + + steps: + - uses: readthedocs/actions/preview@v1 + with: + project-slug: "imath" + message-template: "Website preview: {docs-pr-index-url}" + + diff --git a/third_party/openexr/.github/workflows/website_workflow.yml b/third_party/Imath/.github/workflows/website_workflow.yml similarity index 67% rename from third_party/openexr/.github/workflows/website_workflow.yml rename to third_party/Imath/.github/workflows/website_workflow.yml index afd69e38..9939a6f3 100644 --- a/third_party/openexr/.github/workflows/website_workflow.yml +++ b/third_party/Imath/.github/workflows/website_workflow.yml @@ -6,23 +6,24 @@ name: Website -# Run only on changes in the "website" directory. +# Run only on changes in the "website" directory or workflow file. # Skip the release branches, since the website is built from main. on: + push: branches:-ignore: - - RB-2.* - - RB-3.* + - RB-* paths: - 'website/**' + - '.github/workflows/website_workflow.yml' pull_request: branches:-ignore: - - RB-2.* - - RB-3.* + - RB-* paths: - 'website/**' + - '.github/workflows/website_workflow.yml' permissions: contents: read @@ -32,11 +33,6 @@ jobs: Website: # Build the website, using a process that mimics the readthedoc build. - # - # Note that this job does not actually build OpenEXR libraries or - # programs, it just runs doxygen, sphinx, and the - # website/script/test_images.py script to generate the "Test Images" - # page. name: 'Website' runs-on: ubuntu-latest @@ -46,10 +42,8 @@ jobs: uses: actions/checkout@v3 - name: Create build directory run: mkdir _build - - name: Install doxygen & imagemagick - # Need imagemagick for convert, to convert "Test Image" exrs to jpgs - # Need openexr for exrheader - run: sudo apt-get install -y doxygen imagemagick openexr + - name: Install doxygen + run: sudo apt-get install -y doxygen - name: Install sphinx requirements run: pip3 install -r website/requirements.txt - name: Configure diff --git a/third_party/Imath/.gitignore b/third_party/Imath/.gitignore new file mode 100644 index 00000000..a36992cf --- /dev/null +++ b/third_party/Imath/.gitignore @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + +build/ +_build/ +_install/ diff --git a/third_party/Imath/.mailmap b/third_party/Imath/.mailmap new file mode 100644 index 00000000..5154491d --- /dev/null +++ b/third_party/Imath/.mailmap @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. +# +# This file establishes email equivalences so we can resolve what look like +# multiple authors, but actually are the same author who has used multiple +# emails over the course of their involvement with the project. +# +# The format is any of the following: +# +# CANONICAL-NAME +# CANONICAL-NAME alternate-name +# +# You can check for duplicates with this command: +# git shortlog -sne --all +# That command (and others) will use this file to collapse the duplicates. +# +# If you see any duplicates we don't account for here, or if you look at your +# own entry here and want a different name or email to be your canonical one +# (we may not have guessed correctly and matched your preferences), please +# file a PR with the edits to this file. + +Andrew Kunz +Antonio Rojas +Bernd +Brecht Van Lommel +CAHEK7 +Cary Phillips +Christina Tempelaar-Lietz +Christopher Kulla +Daniel Kaneider +Dirk Lemstra +Ed Hanway Ed Hanway +Eric Wimmer +Florian Kainz +Gregorio Litenstein +Harry Mallon +Huibean Luo +Jean-Marie Aubry +Jens Lindgren +Ji Hun Yu +Jonathan Stone +Jules Maselbas <54854023+jmaselbas@users.noreply.github.com> +Kazuki Sakamoto +Kimball Thurston +Larry Gritz +Liam Fernandez +Lucas Miller Lucas Miller +Mark Sisson <5761292+marksisson@users.noreply.github.com> +Mathieu Malaterre +Mathieu Westphal +Matthäus G. Chajdas +Matthias C. M. Troffaes +Nicholas Yue +Nick Porcino meshula +Nick Porcino nporcino-pixar <78001580+nporcino-pixar@users.noreply.github.com> +Nick Rasmussen Nick Rasmussen +Nick Rasmussen Nick Rasmussen +Nicolas Chauvet +Nigel Stewart +OgreTransporter +Owen Thompson owdt <33289901+oxt3479@users.noreply.github.com> +Owen Thompson +Peter Hillman +Phyrexian +Piotr Barejko +Piotr Stanczyk +Ralph Potter +Richard Hobbes +Simon Boorer +Thanh Ha +Thorsten Kaufmann +Transporter +Vertexwahn +Xiao Zhai <7610945+zhai-xiao@users.noreply.github.com> +Yujie Shu +Yuya Asano <64895419+sukeya@users.noreply.github.com> +Zachary Klein +ã™ã‘ã‚„ <64895419+sukeya@users.noreply.github.com> diff --git a/third_party/Imath/.readthedocs.yml b/third_party/Imath/.readthedocs.yml new file mode 100644 index 00000000..b450ec53 --- /dev/null +++ b/third_party/Imath/.readthedocs.yml @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright Contributors to the OpenEXR Project. +# +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +build: + os: "ubuntu-22.04" + tools: + python: "3.9" + +sphinx: + configuration: website/conf.py + +python: + install: + - requirements: website/requirements.txt diff --git a/third_party/openexr/bazel/third_party/Imath.BUILD b/third_party/Imath/BUILD.bazel similarity index 90% rename from third_party/openexr/bazel/third_party/Imath.BUILD rename to third_party/Imath/BUILD.bazel index 52b1853b..625abfde 100644 --- a/third_party/openexr/bazel/third_party/Imath.BUILD +++ b/third_party/Imath/BUILD.bazel @@ -8,14 +8,14 @@ expand_template( out = "src/Imath/ImathConfig.h", substitutions = { "@IMATH_INTERNAL_NAMESPACE@": "Imath_3_1", - "@IMATH_LIB_VERSION@": "3.1.9", + "@IMATH_LIB_VERSION@": "3.1.11", "@IMATH_NAMESPACE_CUSTOM@": "0", "@IMATH_NAMESPACE@": "Imath", - "@IMATH_PACKAGE_NAME@": "Imath 3.1.9", + "@IMATH_PACKAGE_NAME@": "Imath 3.1.11", "@Imath_VERSION_MAJOR@": "3", "@Imath_VERSION_MINOR@": "1", - "@Imath_VERSION_PATCH@": "9", - "@IMATH_VERSION@": "3.1.9", + "@Imath_VERSION_PATCH@": "11", + "@IMATH_VERSION@": "3.1.11", "#cmakedefine IMATH_HALF_USE_LOOKUP_TABLE": "#define IMATH_HALF_USE_LOOKUP_TABLE", "#cmakedefine IMATH_ENABLE_API_VISIBILITY": "#define IMATH_ENABLE_API_VISIBILITY", "#cmakedefine IMATH_HAVE_LARGE_STACK": "/* #undef IMATH_HAVE_LARGE_STACK */", @@ -74,3 +74,9 @@ cc_library( includes = ["src/Imath"], visibility = ["//visibility:public"], ) + +alias( + name = "imath", + actual = ":Imath", + visibility = ["//visibility:public"], +) diff --git a/third_party/Imath-3.1.9/CHANGES.md b/third_party/Imath/CHANGES.md similarity index 99% rename from third_party/Imath-3.1.9/CHANGES.md rename to third_party/Imath/CHANGES.md index fc47b69c..91d1803a 100644 --- a/third_party/Imath-3.1.9/CHANGES.md +++ b/third_party/Imath/CHANGES.md @@ -1,3 +1,6 @@ + + + # Imath Release Notes * [Version 3.1.9](#version-319-May-31-2023) May 31, 2023 diff --git a/third_party/Imath-3.1.9/CMakeLists.txt b/third_party/Imath/CMakeLists.txt similarity index 61% rename from third_party/Imath-3.1.9/CMakeLists.txt rename to third_party/Imath/CMakeLists.txt index 1ffdccbb..282242dc 100644 --- a/third_party/Imath-3.1.9/CMakeLists.txt +++ b/third_party/Imath/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright Contributors to the OpenEXR Project. -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.14) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) @@ -14,35 +14,24 @@ endif() # Imath version -project(Imath VERSION 3.1.9 LANGUAGES C CXX) +project(Imath VERSION 3.2.0 LANGUAGES C CXX) -set(IMATH_VERSION_RELEASE_TYPE "" CACHE STRING "Extra version tag string for Imath build, such as -dev, -beta1, etc.") +set(IMATH_VERSION_RELEASE_TYPE "-dev" CACHE STRING "Extra version tag string for Imath build, such as -dev, -beta1, etc.") set(IMATH_VERSION ${Imath_VERSION}) set(IMATH_VERSION_API "${Imath_VERSION_MAJOR}_${Imath_VERSION_MINOR}") -# Library/shared-object version using libtool versioning policy. -# See https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +# The SOVERSION (i.e. numerical component of SONAME) tracks the ABI +# version. Increment this number whenever, and only when, the ABI changes in +# non-backwards-compatible ways. # -# Library API version (CMake's library VERSION attribute) is of the -# form CURRENT.REVISION.AGE; the CMake SOVERSION attribute corresonds -# to just CURRENT. These produce a .so and a symlink symlink, e.g.: -# libImath-3_1.so.29 -> libImath-3_1.so.29.0.0 -# ^ ^ ^ ^ -# | | | | -# CURRENT | | AGE -# | REVISION -# CURRENT -# When updating: -# 1. no API change: CURRENT.REVISION+1.AGE -# 2. API added: CURRENT+1.0.AGE+1 -# 3. API changed: CURRENT+1.0.0 -# -set(IMATH_LIBTOOL_CURRENT 29) -set(IMATH_LIBTOOL_REVISION 8) -set(IMATH_LIBTOOL_AGE 0) -set(IMATH_LIB_VERSION "${IMATH_LIBTOOL_CURRENT}.${IMATH_LIBTOOL_REVISION}.${IMATH_LIBTOOL_AGE}") -set(IMATH_LIB_SOVERSION ${IMATH_LIBTOOL_CURRENT}) +# The OpenEXR project policy is to append the library version +# "major.minor.patch" to the SONAME to form the real shared library name. +# For example, in "libImath.so.31.3.2.0", "libImath.so.31" is the SONAME +# and ".3.2.0" identifies the corresponding library release. + +set(IMATH_LIB_SOVERSION 30) +set(IMATH_LIB_VERSION "${IMATH_LIB_SOVERSION}.${IMATH_VERSION}") # e.g. "30.3.2.0" # ImathSetup.cmake declares all the configuration variables visible # in cmake-gui or similar and the rest of the global @@ -51,12 +40,25 @@ include(config/ImathSetup.cmake) message(STATUS "Configure ${IMATH_PACKAGE_NAME}, library API version: ${IMATH_LIB_VERSION}") +option(IMATH_INSTALL "Install Imath library" ON) + # Config headers and package config files add_subdirectory(config) # Utility function for the repeated boilerplate of defining the libraries include(config/LibraryDefine.cmake) +# uninstall target +if(NOT TARGET uninstall) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +endif() + # Source code is in src/Imath add_subdirectory(src/Imath) @@ -68,22 +70,27 @@ set(Imath_DIR "${CMAKE_CURRENT_BINARY_DIR}/config" CACHE PATH "" FORCE) # be empty since we already defined the targets in add_subdirectory(). file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/config/ImathTargets.cmake" "# Dummy file") -option(PYTHON "Set ON to compile PyImath bindings") -if (PYTHON) +option(PYTHON "Set ON to compile boost PyImath bindings") +option(PYBIND11 "Set ON to compile pybind11 PyImath bindings") + +if (PYTHON AND PYBIND11) + message(FATAL_ERROR "Compiling both the boost and pybind11 python bindings at the same time is not currently supported") +endif() + +if (PYTHON OR PYBIND11) add_subdirectory(src/python) endif() -option(BUILD_DOCS "Set ON to build readthedocs documentation") -if (BUILD_DOCS AND NOT IMATH_IS_SUBPROJECT) - option(INSTALL_DOCS "Set ON to install html documentation" ON) - add_subdirectory(docs) +option(BUILD_WEBSITE "Set ON to build the readthedocs website source") +if (BUILD_WEBSITE AND NOT IMATH_IS_SUBPROJECT) + add_subdirectory(website) endif() # If you want to use ctest to configure, build and # upload the results, cmake has builtin support for # submitting to CDash, or any server who speaks the # same protocol -# +# # These settings will need to be set for your environment, # and then a script such as the example in # @@ -94,7 +101,7 @@ endif() # cmake -S cmake/SampleCTestScript.cmake # # [or whatever you name the file you edit] -# +# #set(CTEST_PROJECT_NAME "Imath") #set(CTEST_NIGHTLY_START_TIME "01:01:01 UTC") #set(CTEST_DROP_METHOD "http") # there are others... diff --git a/third_party/Imath-3.1.9/CODE_OF_CONDUCT.md b/third_party/Imath/CODE_OF_CONDUCT.md similarity index 95% rename from third_party/Imath-3.1.9/CODE_OF_CONDUCT.md rename to third_party/Imath/CODE_OF_CONDUCT.md index 3501232b..ff561298 100644 --- a/third_party/Imath-3.1.9/CODE_OF_CONDUCT.md +++ b/third_party/Imath/CODE_OF_CONDUCT.md @@ -1,3 +1,6 @@ + + + # Code of Conduct Imath is a sub-project of the OpenEXR project, which abides by Linux diff --git a/third_party/Imath-3.1.9/CONTRIBUTING.md b/third_party/Imath/CONTRIBUTING.md similarity index 94% rename from third_party/Imath-3.1.9/CONTRIBUTING.md rename to third_party/Imath/CONTRIBUTING.md index fb5bf998..84acbb02 100644 --- a/third_party/Imath-3.1.9/CONTRIBUTING.md +++ b/third_party/Imath/CONTRIBUTING.md @@ -10,8 +10,7 @@ explains our contribution process and procedures: * [Legal Requirements](#Legal-Requirements) * [Development Workflow](#Development-Workflow) * [Coding Style](#Coding-Style) -* [Versioning Policy](#Versioning-Policy) -* [Creating a Release](#Creating-a-Release) +* [Versioning Policy and Release Process](#Versioning-Policy-and-Release-Process) Imath is a sub-project of [OpenEXR](https://github.com/AcademySoftwareFoundation/openexr) and @@ -316,7 +315,7 @@ library. The test should should be run, via: - make test + % make test before submitting a pull request. @@ -422,28 +421,9 @@ For public APIs, use Doxygen-style comments (start with `///`), such as: float foo; ///< Doxygen comments on same line look like this } -## Versioning Policy +## Versioning Policy and Release Process -Imath uses [semantic versioning](https://semver.org), which labels -each version with three numbers: ``major.minor.patch``, where: - -* ``major`` - indicates incompatible API changes -* ``minor`` - indicates functionality added in a backwards-compatible manner -* ``patch`` - indicates backwards-compatible bug fixes - -## Creating a Release - -To create a new release from the ``main`` branch: - -1. Update the release notes in ``CHANGES.md``. - - Write a high-level summary of the features and - improvements. Include the summary in ``CHANGES.md`` and also in the - Release comments. - - Include the log of all PR's included beyond the previous release. - -2. Create a new release on the GitHub Releases page. - -3. Tag the release with name beginning with ``v``', e.g. ``v2.3.0``. +Imath follows the same policy and release process at OpenEXR. See the +OpenEXR +[CONTRIBUTING.md](https://github.com/AcademySoftwareFoundation/openexr/CONTRIBUTING.md) for the details. diff --git a/third_party/Imath/CONTRIBUTORS.md b/third_party/Imath/CONTRIBUTORS.md new file mode 100644 index 00000000..972af849 --- /dev/null +++ b/third_party/Imath/CONTRIBUTORS.md @@ -0,0 +1,55 @@ + + + +This is a list of contributors to the Imath project, sorted +alphabetically by first name. + +If you know of missing, please email info@openexr.com ro submit a PR. + +* Andrew Kunz +* Antonio Rojas +* Brecht Van Lommel +* Cary Phillips +* Christina Tempelaar-Lietz +* Christopher Kulla +* Daniel Kaneider +* Dirk Lemstra +* Ed Hanway +* Eric Wimmer +* Florian Kainz +* Gregorio Litenstein +* Harry Mallon +* Huibean Luo +* Jean-Marie Aubry +* Jens Lindgren +* Ji Hun Yu +* Jonathan Stone +* Jules Maselbas +* Kazuki Sakamoto +* Kimball Thurston +* Larry Gritz +* Liam Fernandez +* Lucas Miller +* Mark Sisson +* Mathieu Malaterre +* Mathieu Westphal +* Matthäus G. Chajdas +* Matthias C. M. Troffaes +* Nicholas Yue +* Nick Porcino +* Nick Rasmussen +* Nicolas Chauvet +* Nigel Stewart +* Owen Thompson +* Peter Hillman +* Piotr Barejko +* Piotr Stanczyk +* Ralph Potter +* Richard Hobbes +* Simon Boorer +* Thanh Ha +* Thorsten Kaufmann +* Xiao Zhai +* Yujie Shu +* Yuya Asano +* Zachary Klein diff --git a/third_party/Imath-3.1.9/GOVERNANCE.md b/third_party/Imath/GOVERNANCE.md similarity index 100% rename from third_party/Imath-3.1.9/GOVERNANCE.md rename to third_party/Imath/GOVERNANCE.md diff --git a/third_party/Imath-3.1.9/LICENSE.md b/third_party/Imath/LICENSE.md similarity index 100% rename from third_party/Imath-3.1.9/LICENSE.md rename to third_party/Imath/LICENSE.md diff --git a/third_party/Imath/MODULE.bazel b/third_party/Imath/MODULE.bazel new file mode 100644 index 00000000..d6a86f96 --- /dev/null +++ b/third_party/Imath/MODULE.bazel @@ -0,0 +1,7 @@ +module( + name = "imath", + version = "head", + compatibility_level = 1, +) + +bazel_dep(name = "bazel_skylib", version = "1.5.0") diff --git a/third_party/Imath-3.1.9/README.md b/third_party/Imath/README.md similarity index 87% rename from third_party/Imath-3.1.9/README.md rename to third_party/Imath/README.md index 92b4319c..02cd542c 100644 --- a/third_party/Imath-3.1.9/README.md +++ b/third_party/Imath/README.md @@ -3,7 +3,9 @@ [![License](https://img.shields.io/github/license/AcademySoftwareFoundation/Imath)](LICENSE.md) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2799/badge)](https://bestpractices.coreinfrastructure.org/projects/2799) -[![Build Status](https://dev.azure.com/academysoftwarefoundation/Academy%20Software%20Foundation/_apis/build/status/academysoftwarefoundation.Imath)](https://dev.azure.com/academysoftwarefoundation/Academy%20Software%20Foundation/_build?definitionId=4&_a=summary) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/AcademySoftwareFoundation/Imath/badge)](https://securityscorecards.dev/viewer/?uri=github.com/AcademySoftwareFoundation/Imath) +[![Build Status](https://github.com/AcademySoftwareFoundation/Imath/workflows/CI/badge.svg)](https://github.com/AcademySoftwareFoundation/Imath/actions?query=workflow%3ACI) +[![Analysis Status](https://github.com/AcademySoftwareFoundation/Imath/workflows/Analysis/badge.svg)](https://github.com/AcademySoftwareFoundation/Imath/actions?query=workflow%3AAnalysis) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=AcademySoftwareFoundation_Imath&metric=alert_status)](https://sonarcloud.io/dashboard?id=AcademySoftwareFoundation_Imath) # Imath diff --git a/third_party/Imath/SECURITY.md b/third_party/Imath/SECURITY.md new file mode 100644 index 00000000..aeb9ca01 --- /dev/null +++ b/third_party/Imath/SECURITY.md @@ -0,0 +1,81 @@ + + + +# Security Policy + +## Reporting a Vulnerability + +If you think you've found a potential vulnerability in Imath, please +report it by filing a GitHub [security +advisory](https://github.com/AcademySoftwareFoundation/Imath/security/advisories/new). Alternatively, +email security@openexr.com and provide your contact info for further +private/secure discussion. If your email does not receive a prompt +acknowledgement, your address may be blocked. + +Our policy is to acknowledge the receipt of vulnerability reports +within 48 hours. Our policy is to address critical security vulnerabilities +rapidly and post patches within 14 days if possible. + +## Supported Versions + +This gives guidance about which branches are supported with patches to +security vulnerabilities. + +| Version / branch | Supported | +| --------- | ---------------------------------------------------- | +| main | :white_check_mark: :construction: ALL fixes immediately, but this is a branch under development with a frequently unstable ABI and occasionally unstable API. | +| 3.1.x | :white_check_mark: All fixes that can be backported without breaking ABI compatibility. | +| 3.0.x | :warning: Only the most critical fixes, only if they can be easily backported. | + +## Signed Releases + +Releases artifacts are signed via +[sigstore](https://www.sigstore.dev). See +[release-sign.yml](.github/workflows/release-sign.yml) for details. + +To verify a downloaded release at a given tag: + + % pip install sigstore + % sigstore verify github --cert-identity https://github.com/AcademySoftwareFoundation/Imath/.github/workflows/release-sign.yml@refs/tags/ Imath-.tar.gz + +## Security Expectations + +### Software Features + +- The Imath project implements basic vector, matrix, and math + operations, and is used throughout the motion picture industry and + beyond, on Linux, macOS, and Windows. + +- The project consists of a software run-time library, implemented in + C/C++ and built via cmake. The project also distributes python + wrappings for the C/C++ I/O API. + +- The library provides no external input/output. + +- Other than the website and online technical documentation, the + project implements no web/online services or network communication + protocols. The library never requests any security or + authentication credentials or login information from users. + + The website implements no interactive features and requires no login + credentials. + +### Software Dependencies + +Imath has no external dependencies. + +The Imath python bindings depend on python and boost. + +### Development Cycle and Distribution + +Imath is downloadable and buildable by C/C++ source via GitHub. Only +members of the project's Technical Steering Committee, all veteran +software engineers at major motion picture studios or vendors, have +write permissions on the source code repository. All critical software +changes are reviewed by multiple TSC members. + +The library is distributed in binary form via many common package +managers across all platforms. + + + diff --git a/third_party/Imath/WORKSPACE.bazel b/third_party/Imath/WORKSPACE.bazel new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/third_party/Imath/WORKSPACE.bazel @@ -0,0 +1 @@ + diff --git a/third_party/Imath-3.1.9/cmake/FindPythonPackage.cmake b/third_party/Imath/cmake/FindPythonPackage.cmake similarity index 100% rename from third_party/Imath-3.1.9/cmake/FindPythonPackage.cmake rename to third_party/Imath/cmake/FindPythonPackage.cmake diff --git a/third_party/Imath-3.1.9/cmake/FindSphinx.cmake b/third_party/Imath/cmake/FindSphinx.cmake similarity index 100% rename from third_party/Imath-3.1.9/cmake/FindSphinx.cmake rename to third_party/Imath/cmake/FindSphinx.cmake diff --git a/third_party/Imath-3.1.9/cmake/SampleCTestScript.cmake b/third_party/Imath/cmake/SampleCTestScript.cmake similarity index 100% rename from third_party/Imath-3.1.9/cmake/SampleCTestScript.cmake rename to third_party/Imath/cmake/SampleCTestScript.cmake diff --git a/third_party/Imath-3.1.9/cmake/Toolchain-Linux-VFX_Platform21.cmake b/third_party/Imath/cmake/Toolchain-Linux-VFX_Platform21.cmake similarity index 100% rename from third_party/Imath-3.1.9/cmake/Toolchain-Linux-VFX_Platform21.cmake rename to third_party/Imath/cmake/Toolchain-Linux-VFX_Platform21.cmake diff --git a/third_party/Imath-3.1.9/cmake/Toolchain-mingw.cmake b/third_party/Imath/cmake/Toolchain-mingw.cmake similarity index 100% rename from third_party/Imath-3.1.9/cmake/Toolchain-mingw.cmake rename to third_party/Imath/cmake/Toolchain-mingw.cmake diff --git a/third_party/Imath-3.1.9/cmake/clang-format.cmake b/third_party/Imath/cmake/clang-format.cmake similarity index 100% rename from third_party/Imath-3.1.9/cmake/clang-format.cmake rename to third_party/Imath/cmake/clang-format.cmake diff --git a/third_party/Imath/cmake/cmake_uninstall.cmake.in b/third_party/Imath/cmake/cmake_uninstall.cmake.in new file mode 100644 index 00000000..2942ab21 --- /dev/null +++ b/third_party/Imath/cmake/cmake_uninstall.cmake.in @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2000-2024 Kitware, Inc. and Contributors +# Source: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake + +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") +endif() + +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS + "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif() + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif() +endforeach() diff --git a/third_party/Imath-3.1.9/config/CMakeLists.txt b/third_party/Imath/config/CMakeLists.txt similarity index 67% rename from third_party/Imath-3.1.9/config/CMakeLists.txt rename to third_party/Imath/config/CMakeLists.txt index 32fb7af8..218226b3 100644 --- a/third_party/Imath-3.1.9/config/CMakeLists.txt +++ b/third_party/Imath/config/CMakeLists.txt @@ -19,14 +19,16 @@ target_include_directories(ImathConfig INTERFACE $ $) -install( - FILES - ${CMAKE_CURRENT_BINARY_DIR}/ImathConfig.h - DESTINATION - ${CMAKE_INSTALL_INCLUDEDIR}/${IMATH_OUTPUT_SUBDIR} -) - -install(TARGETS ImathConfig EXPORT ${PROJECT_NAME}) +if (IMATH_INSTALL) + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/ImathConfig.h + DESTINATION + ${CMAKE_INSTALL_INCLUDEDIR}/${IMATH_OUTPUT_SUBDIR} + ) + + install(TARGETS ImathConfig EXPORT ${PROJECT_NAME}) +endif() add_library(Imath::Config ALIAS ImathConfig) @@ -58,8 +60,9 @@ if(IMATH_INSTALL_PKG_CONFIG) ) endfunction() imath_pkg_config_help(Imath.pc.in) + message(STATUS "Imath pkg-config generation enabled") else() - message(STATUS "pkg-config generation disabled") + message(STATUS "Imath pkg-config generation disabled") endif() # @@ -69,24 +72,31 @@ endif() include(CMakePackageConfigHelpers) -configure_package_config_file(ImathConfig.cmake.in +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/ImathConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) -write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" +write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" VERSION ${IMATH_VERSION} COMPATIBILITY SameMajorVersion ) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) - -install(EXPORT ${PROJECT_NAME} - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} - FILE ${PROJECT_NAME}Targets.cmake - NAMESPACE ${PROJECT_NAME}:: - EXPORT_LINK_INTERFACE_LIBRARIES -) +if (IMATH_INSTALL) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} + ) + + install(EXPORT ${PROJECT_NAME} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} + FILE ${PROJECT_NAME}Targets.cmake + NAMESPACE ${PROJECT_NAME}:: + EXPORT_LINK_INTERFACE_LIBRARIES + ) + + export(EXPORT ${PROJECT_NAME} + FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake" + NAMESPACE ${PROJECT_NAME}:: + ) +endif() diff --git a/third_party/Imath-3.1.9/config/Imath.pc.in b/third_party/Imath/config/Imath.pc.in similarity index 100% rename from third_party/Imath-3.1.9/config/Imath.pc.in rename to third_party/Imath/config/Imath.pc.in diff --git a/third_party/Imath-3.1.9/config/ImathConfig.cmake.in b/third_party/Imath/config/ImathConfig.cmake.in similarity index 100% rename from third_party/Imath-3.1.9/config/ImathConfig.cmake.in rename to third_party/Imath/config/ImathConfig.cmake.in diff --git a/third_party/Imath-3.1.9/config/ImathConfig.h.in b/third_party/Imath/config/ImathConfig.h.in similarity index 69% rename from third_party/Imath-3.1.9/config/ImathConfig.h.in rename to third_party/Imath/config/ImathConfig.h.in index ec29c7fd..132f6235 100644 --- a/third_party/Imath-3.1.9/config/ImathConfig.h.in +++ b/third_party/Imath/config/ImathConfig.h.in @@ -12,6 +12,9 @@ // Options / configuration based on O.S. / compiler // +// automated formatting does not handle the cmake tags well +// clang-format off + // // Define whether the half-to-float conversion should use the lookup // table method. Note that this is overriden by F16C compiler @@ -51,13 +54,16 @@ #define IMATH_VERSION_PATCH @Imath_VERSION_PATCH@ #define IMATH_VERSION_RELEASE_TYPE "@IMATH_VERSION_RELEASE_TYPE@" -#define IMATH_VERSION_HEX ((uint32_t(IMATH_VERSION_MAJOR) << 24) | \ - (uint32_t(IMATH_VERSION_MINOR) << 16) | \ - (uint32_t(IMATH_VERSION_PATCH) << 8)) +#define IMATH_VERSION_HEX \ + ((uint32_t (IMATH_VERSION_MAJOR) << 24) | \ + (uint32_t (IMATH_VERSION_MINOR) << 16) | \ + (uint32_t (IMATH_VERSION_PATCH) << 8)) // IMATH_LIB_VERSION is the library API version: SOCURRENT.SOAGE.SOREVISION #define IMATH_LIB_VERSION_STRING "@IMATH_LIB_VERSION@" +// clang-format on + // // Code that depends on the v2 ExcMath mechanism of signal handlers // that throw exceptions is incompatible with noexcept, since @@ -69,9 +75,9 @@ #cmakedefine01 IMATH_USE_NOEXCEPT #if IMATH_USE_NOEXCEPT -#define IMATH_NOEXCEPT noexcept +# define IMATH_NOEXCEPT noexcept #else -#define IMATH_NOEXCEPT +# define IMATH_NOEXCEPT #endif // @@ -84,25 +90,23 @@ // templates from compiling correctly. // #ifndef IMATH_FOREIGN_VECTOR_INTEROP -# if defined(__GNUC__) && __GNUC__ == 4 && !defined(__clang__) -# define IMATH_FOREIGN_VECTOR_INTEROP 0 -# else -# define IMATH_FOREIGN_VECTOR_INTEROP 1 -# endif +# if defined(__GNUC__) && __GNUC__ == 4 && !defined(__clang__) +# define IMATH_FOREIGN_VECTOR_INTEROP 0 +# else +# define IMATH_FOREIGN_VECTOR_INTEROP 1 +# endif #endif - // // Decorator that makes a function available for both CPU and GPU, when // compiling for Cuda. // #ifdef __CUDACC__ - #define IMATH_HOSTDEVICE __host__ __device__ +# define IMATH_HOSTDEVICE __host__ __device__ #else - #define IMATH_HOSTDEVICE +# define IMATH_HOSTDEVICE #endif - // // Some compilers define a special intrinsic to use in conditionals that can // speed up extremely performance-critical spots if the conditional is @@ -118,38 +122,37 @@ // #if defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER) # ifdef __cplusplus -# define IMATH_LIKELY(x) (__builtin_expect(static_cast(x), true)) -# define IMATH_UNLIKELY(x) (__builtin_expect(static_cast(x), false)) +# define IMATH_LIKELY(x) (__builtin_expect (static_cast (x), true)) +# define IMATH_UNLIKELY(x) \ + (__builtin_expect (static_cast (x), false)) # else -# define IMATH_LIKELY(x) (__builtin_expect((x), 1)) -# define IMATH_UNLIKELY(x) (__builtin_expect((x), 0)) +# define IMATH_LIKELY(x) (__builtin_expect ((x), 1)) +# define IMATH_UNLIKELY(x) (__builtin_expect ((x), 0)) # endif #else # define IMATH_LIKELY(x) (x) # define IMATH_UNLIKELY(x) (x) #endif - // On modern versions of gcc & clang, __has_attribute can test support for // __attribute__((attr)). Make sure it's safe for other compilers. #ifndef __has_attribute # define __has_attribute(x) 0 #endif - // // Simple way to mark things as deprecated. // When we are sure that C++14 is our true minimum, then we can just // directly use [[deprecated(msg)]]. // #if defined(_MSC_VER) -# define IMATH_DEPRECATED(msg) __declspec(deprecated(msg)) +# define IMATH_DEPRECATED(msg) __declspec(deprecated (msg)) #elif defined(__cplusplus) && __cplusplus >= 201402L -# define IMATH_DEPRECATED(msg) [[deprecated(msg)]] +# define IMATH_DEPRECATED(msg) [[deprecated (msg)]] #elif defined(__GNUC__) || defined(__clang__) -# define IMATH_DEPRECATED(msg) __attribute__((deprecated(msg))) +# define IMATH_DEPRECATED(msg) __attribute__ ((deprecated (msg))) #else -# define IMATH_DEPRECATED(msg) /* unsupported on this platform */ +# define IMATH_DEPRECATED(msg) /* unsupported on this platform */ #endif // Whether the user configured the library to have symbol visibility @@ -159,13 +162,16 @@ // MSVC does not do the same visibility attributes, and when we are // compiling a static library we won't be in DLL mode, but just don't // define these and the export headers will work out -#if ! defined(_MSC_VER) && defined(IMATH_ENABLE_API_VISIBILITY) -# define IMATH_PUBLIC_SYMBOL_ATTRIBUTE __attribute__ ((__visibility__ ("default"))) -# define IMATH_PRIVATE_SYMBOL_ATTRIBUTE __attribute__ ((__visibility__ ("hidden"))) +#if !defined(_MSC_VER) && defined(IMATH_ENABLE_API_VISIBILITY) +# define IMATH_PUBLIC_SYMBOL_ATTRIBUTE \ + __attribute__ ((__visibility__ ("default"))) +# define IMATH_PRIVATE_SYMBOL_ATTRIBUTE \ + __attribute__ ((__visibility__ ("hidden"))) // clang differs from gcc and has type visibility which is needed for enums and templates -# if __has_attribute(__type_visibility__) -# define IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE __attribute__ ((__type_visibility__ ("default"))) -# endif +# if __has_attribute(__type_visibility__) +# define IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE \ + __attribute__ ((__type_visibility__ ("default"))) +# endif #endif #endif // INCLUDED_IMATH_CONFIG_H diff --git a/third_party/Imath-3.1.9/config/ImathSetup.cmake b/third_party/Imath/config/ImathSetup.cmake similarity index 97% rename from third_party/Imath-3.1.9/config/ImathSetup.cmake rename to third_party/Imath/config/ImathSetup.cmake index 6cd37ce2..50a774a1 100644 --- a/third_party/Imath-3.1.9/config/ImathSetup.cmake +++ b/third_party/Imath/config/ImathSetup.cmake @@ -38,12 +38,11 @@ set(IMATH_PACKAGE_NAME "Imath ${IMATH_VERSION}${IMATH_VERSION_RELEASE_TYPE}" CAC # Whether to generate and install a pkg-config file Imath.pc on if(WIN32) - option(IMATH_INSTALL_PKG_CONFIG "Install Imath.pc file" OFF) option(IMATH_INSTALL_SYM_LINK "Create symbolic links for shared objects" OFF) else() - option(IMATH_INSTALL_PKG_CONFIG "Install Imath.pc file" ON) option(IMATH_INSTALL_SYM_LINK "Create symbolic links for shared objects" ON) endif() +option(IMATH_INSTALL_PKG_CONFIG "Install Imath.pc file" ON) # # Build related options diff --git a/third_party/Imath-3.1.9/config/LibraryDefine.cmake b/third_party/Imath/config/LibraryDefine.cmake similarity index 67% rename from third_party/Imath-3.1.9/config/LibraryDefine.cmake rename to third_party/Imath/config/LibraryDefine.cmake index 48689547..576aa2e4 100644 --- a/third_party/Imath-3.1.9/config/LibraryDefine.cmake +++ b/third_party/Imath/config/LibraryDefine.cmake @@ -84,27 +84,30 @@ function(IMATH_DEFINE_LIBRARY libname) ) add_library(${PROJECT_NAME}::${libname} ALIAS ${libname}) - install(TARGETS ${libname} - EXPORT ${PROJECT_NAME} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${IMATH_OUTPUT_SUBDIR} - ) - if(BUILD_SHARED_LIBS AND (NOT "${IMATH_LIB_SUFFIX}" STREQUAL "") AND IMATH_INSTALL_SYM_LINK) - string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) - set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${IMATH_LIB_SUFFIX}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) - if(WIN32) - install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_BINDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") - install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_BINDIR}/${baselibname} -> ${verlibname}\")") - else() - install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") - install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_LIBDIR}/${baselibname} -> ${verlibname}\")") + if (IMATH_INSTALL) + install(TARGETS ${libname} + EXPORT ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PUBLIC_HEADER + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${IMATH_OUTPUT_SUBDIR} + ) + if(BUILD_SHARED_LIBS AND (NOT "${IMATH_LIB_SUFFIX}" STREQUAL "") AND IMATH_INSTALL_SYM_LINK) + string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) + set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${IMATH_LIB_SUFFIX}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) + file(CREATE_LINK ${verlibname} ${CMAKE_CURRENT_BINARY_DIR}/${baselibname} SYMBOLIC) + if(WIN32) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${baselibname} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) + install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_BINDIR}/${baselibname} -> ${verlibname}\")") + else() + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${baselibname} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) + install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_LIBDIR}/${baselibname} -> ${verlibname}\")") + endif() + set(verlibname) + set(baselibname) endif() - set(verlibname) - set(baselibname) endif() endfunction() diff --git a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_boost.sh b/third_party/Imath/share/ci/scripts/linux/install_boost.sh similarity index 88% rename from third_party/Imath-3.1.9/share/ci/scripts/linux/install_boost.sh rename to third_party/Imath/share/ci/scripts/linux/install_boost.sh index 471ecffb..e194e3b1 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_boost.sh +++ b/third_party/Imath/share/ci/scripts/linux/install_boost.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + set -ex BOOST_VERSION="$1" diff --git a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_cmake.sh b/third_party/Imath/share/ci/scripts/linux/install_cmake.sh similarity index 80% rename from third_party/Imath-3.1.9/share/ci/scripts/linux/install_cmake.sh rename to third_party/Imath/share/ci/scripts/linux/install_cmake.sh index 7f194ed3..ab796d02 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_cmake.sh +++ b/third_party/Imath/share/ci/scripts/linux/install_cmake.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + set -ex echo "Updating to newer cmake to enable python-3" diff --git a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_gdb.sh b/third_party/Imath/share/ci/scripts/linux/install_gdb.sh similarity index 79% rename from third_party/Imath-3.1.9/share/ci/scripts/linux/install_gdb.sh rename to third_party/Imath/share/ci/scripts/linux/install_gdb.sh index 484b0239..16a9b4b1 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_gdb.sh +++ b/third_party/Imath/share/ci/scripts/linux/install_gdb.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + set -ex GDB_VERSION="8.3" diff --git a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_six.sh b/third_party/Imath/share/ci/scripts/linux/install_six.sh similarity index 77% rename from third_party/Imath-3.1.9/share/ci/scripts/linux/install_six.sh rename to third_party/Imath/share/ci/scripts/linux/install_six.sh index 7d87ed3b..aa7fb32f 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_six.sh +++ b/third_party/Imath/share/ci/scripts/linux/install_six.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + set -ex SIX_VERSION="1.12.0" diff --git a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_sonar.sh b/third_party/Imath/share/ci/scripts/linux/install_sonar.sh similarity index 88% rename from third_party/Imath-3.1.9/share/ci/scripts/linux/install_sonar.sh rename to third_party/Imath/share/ci/scripts/linux/install_sonar.sh index 8ed08615..a8779c4c 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_sonar.sh +++ b/third_party/Imath/share/ci/scripts/linux/install_sonar.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + set -ex SONAR_VERSION="$1" diff --git a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_valgrind.sh b/third_party/Imath/share/ci/scripts/linux/install_valgrind.sh similarity index 86% rename from third_party/Imath-3.1.9/share/ci/scripts/linux/install_valgrind.sh rename to third_party/Imath/share/ci/scripts/linux/install_valgrind.sh index d6135fd6..7006a3a8 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/linux/install_valgrind.sh +++ b/third_party/Imath/share/ci/scripts/linux/install_valgrind.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + set -ex VALGRIND_VERSION="3.15.0" diff --git a/third_party/Imath-3.1.9/share/ci/scripts/linux/log_valgrind.sh b/third_party/Imath/share/ci/scripts/linux/log_valgrind.sh similarity index 76% rename from third_party/Imath-3.1.9/share/ci/scripts/linux/log_valgrind.sh rename to third_party/Imath/share/ci/scripts/linux/log_valgrind.sh index 39183ba2..9153c95c 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/linux/log_valgrind.sh +++ b/third_party/Imath/share/ci/scripts/linux/log_valgrind.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + set -ex LOGDIR="$1" diff --git a/third_party/Imath-3.1.9/share/ci/scripts/linux/run_gcov.sh b/third_party/Imath/share/ci/scripts/linux/run_gcov.sh similarity index 93% rename from third_party/Imath-3.1.9/share/ci/scripts/linux/run_gcov.sh rename to third_party/Imath/share/ci/scripts/linux/run_gcov.sh index 35ce32fe..46536690 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/linux/run_gcov.sh +++ b/third_party/Imath/share/ci/scripts/linux/run_gcov.sh @@ -3,6 +3,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) Contributors to the OpenEXR Project. +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + set -ex if [ $# -gt 0 ] diff --git a/third_party/Imath-3.1.9/share/ci/scripts/macos/install_boost.sh b/third_party/Imath/share/ci/scripts/macos/install_boost.sh similarity index 100% rename from third_party/Imath-3.1.9/share/ci/scripts/macos/install_boost.sh rename to third_party/Imath/share/ci/scripts/macos/install_boost.sh diff --git a/third_party/Imath-3.1.9/share/ci/scripts/macos/install_python.sh b/third_party/Imath/share/ci/scripts/macos/install_python.sh similarity index 92% rename from third_party/Imath-3.1.9/share/ci/scripts/macos/install_python.sh rename to third_party/Imath/share/ci/scripts/macos/install_python.sh index ab2b7092..4f27e64a 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/macos/install_python.sh +++ b/third_party/Imath/share/ci/scripts/macos/install_python.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + set -ex PYTHON_VERSION="$1" diff --git a/third_party/Imath-3.1.9/share/ci/scripts/windows/install_boost.ps1 b/third_party/Imath/share/ci/scripts/windows/install_boost.ps1 similarity index 95% rename from third_party/Imath-3.1.9/share/ci/scripts/windows/install_boost.ps1 rename to third_party/Imath/share/ci/scripts/windows/install_boost.ps1 index ddc2ab4d..d64567fe 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/windows/install_boost.ps1 +++ b/third_party/Imath/share/ci/scripts/windows/install_boost.ps1 @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + # # TODO: fix this script to work with sourceforge archive! # diff --git a/third_party/Imath-3.1.9/share/ci/scripts/windows/install_cmake.ps1 b/third_party/Imath/share/ci/scripts/windows/install_cmake.ps1 similarity index 82% rename from third_party/Imath-3.1.9/share/ci/scripts/windows/install_cmake.ps1 rename to third_party/Imath/share/ci/scripts/windows/install_cmake.ps1 index 92cb6d61..6a47ffe8 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/windows/install_cmake.ps1 +++ b/third_party/Imath/share/ci/scripts/windows/install_cmake.ps1 @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + $cmakeVersion = $Args[0] $cmakeMajorMinor = [io.path]::GetFileNameWithoutExtension("$cmakeVersion") diff --git a/third_party/Imath-3.1.9/share/ci/scripts/windows/install_python.ps1 b/third_party/Imath/share/ci/scripts/windows/install_python.ps1 similarity index 92% rename from third_party/Imath-3.1.9/share/ci/scripts/windows/install_python.ps1 rename to third_party/Imath/share/ci/scripts/windows/install_python.ps1 index 24cb0e9f..6456b345 100755 --- a/third_party/Imath-3.1.9/share/ci/scripts/windows/install_python.ps1 +++ b/third_party/Imath/share/ci/scripts/windows/install_python.ps1 @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + $homeDir = (pwd) $pythonVersion = $Args[0] diff --git a/third_party/Imath-3.1.9/sonar-project.properties b/third_party/Imath/sonar-project.properties similarity index 100% rename from third_party/Imath-3.1.9/sonar-project.properties rename to third_party/Imath/sonar-project.properties diff --git a/third_party/Imath-3.1.9/src/Imath/CMakeLists.txt b/third_party/Imath/src/Imath/CMakeLists.txt similarity index 100% rename from third_party/Imath-3.1.9/src/Imath/CMakeLists.txt rename to third_party/Imath/src/Imath/CMakeLists.txt diff --git a/third_party/Imath-3.1.9/src/Imath/ImathBox.h b/third_party/Imath/src/Imath/ImathBox.h similarity index 60% rename from third_party/Imath-3.1.9/src/Imath/ImathBox.h rename to third_party/Imath/src/Imath/ImathBox.h index 7391dd7b..0ab65b74 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathBox.h +++ b/third_party/Imath/src/Imath/ImathBox.h @@ -36,11 +36,10 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class IMATH_EXPORT_TEMPLATE_TYPE Box { - public: - +public: /// @{ /// @name Direct access to bounds - + /// The minimum value of the box. V min; @@ -55,24 +54,27 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Box /// Construct an empty bounding box. This initializes the mimimum to /// std::numeric_limits::max() and the maximum to /// std::numeric_limits::lowest(). - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box () IMATH_NOEXCEPT; /// Construct a bounding box that contains a single point. IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box (const V& point) IMATH_NOEXCEPT; /// Construct a bounding box with the given minimum and maximum values. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box (const V& minV, const V& maxV) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box (const V& minV, const V& maxV) + IMATH_NOEXCEPT; /// @} /// @{ /// @name Comparison - + /// Equality - IMATH_HOSTDEVICE constexpr bool operator== (const Box& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator== (const Box& src) const IMATH_NOEXCEPT; /// Inequality - IMATH_HOSTDEVICE constexpr bool operator!= (const Box& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator!= (const Box& src) const IMATH_NOEXCEPT; /// @} @@ -82,7 +84,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Box /// Set the box to be empty. A box is empty if the mimimum is greater /// than the maximum. makeEmpty() sets the mimimum to `V::baseTypeMax()` /// and the maximum to `V::baseTypeLowest()`. - IMATH_HOSTDEVICE void makeEmpty() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeEmpty () IMATH_NOEXCEPT; /// Extend the box to include the given point. IMATH_HOSTDEVICE void extendBy (const V& point) IMATH_NOEXCEPT; @@ -91,43 +93,46 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Box IMATH_HOSTDEVICE void extendBy (const Box& box) IMATH_NOEXCEPT; /// Make the box include the entire range of `V`. - IMATH_HOSTDEVICE void makeInfinite() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeInfinite () IMATH_NOEXCEPT; /// @} /// @{ /// @name Query - + /// Return the size of the box. The size is of type `V`, defined /// as `(max-min)`. An empty box has a size of `V(0)`, i.e. 0 in /// each dimension. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 V size() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 V size () const IMATH_NOEXCEPT; /// Return the center of the box. The center is defined as /// `(max+min)/2`. The center of an empty box is undefined. - IMATH_HOSTDEVICE constexpr V center() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr V center () const IMATH_NOEXCEPT; /// Return true if the given point is inside the box, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects (const V& point) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersects (const V& point) const IMATH_NOEXCEPT; /// Return true if the given box is inside the box, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects (const Box& box) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersects (const Box& box) const IMATH_NOEXCEPT; /// Return the major axis of the box. The major axis is the dimension with /// the greatest difference between maximum and minimum. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 unsigned int majorAxis() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 unsigned int + majorAxis () const IMATH_NOEXCEPT; /// Return true if the box is empty, false otherwise. An empty box's /// minimum is greater than its maximum. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty () const IMATH_NOEXCEPT; /// Return true if the box is larger than a single point, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume () const IMATH_NOEXCEPT; /// Return true if the box contains all points, false otherwise. /// An infinite box has a mimimum of`V::baseTypeLowest()` /// and a maximum of `V::baseTypeMax()`. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite () const IMATH_NOEXCEPT; /// @} }; @@ -167,20 +172,22 @@ typedef Box Box3f; typedef Box Box3d; template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box::Box() IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box::Box () IMATH_NOEXCEPT { - makeEmpty(); + makeEmpty (); } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box::Box (const V& point) IMATH_NOEXCEPT +IMATH_HOSTDEVICE + IMATH_CONSTEXPR14 inline Box::Box (const V& point) IMATH_NOEXCEPT { min = point; max = point; } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box::Box (const V& minV, const V& maxV) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box::Box ( + const V& minV, const V& maxV) IMATH_NOEXCEPT { min = minV; max = maxV; @@ -202,31 +209,29 @@ Box::operator!= (const Box& src) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline void -Box::makeEmpty() IMATH_NOEXCEPT +Box::makeEmpty () IMATH_NOEXCEPT { - min = V (V::baseTypeMax()); - max = V (V::baseTypeLowest()); + min = V (V::baseTypeMax ()); + max = V (V::baseTypeLowest ()); } template IMATH_HOSTDEVICE inline void -Box::makeInfinite() IMATH_NOEXCEPT +Box::makeInfinite () IMATH_NOEXCEPT { - min = V (V::baseTypeLowest()); - max = V (V::baseTypeMax()); + min = V (V::baseTypeLowest ()); + max = V (V::baseTypeMax ()); } template IMATH_HOSTDEVICE inline void Box::extendBy (const V& point) IMATH_NOEXCEPT { - for (unsigned int i = 0; i < min.dimensions(); i++) + for (unsigned int i = 0; i < min.dimensions (); i++) { - if (point[i] < min[i]) - min[i] = point[i]; + if (point[i] < min[i]) min[i] = point[i]; - if (point[i] > max[i]) - max[i] = point[i]; + if (point[i] > max[i]) max[i] = point[i]; } } @@ -234,13 +239,11 @@ template IMATH_HOSTDEVICE inline void Box::extendBy (const Box& box) IMATH_NOEXCEPT { - for (unsigned int i = 0; i < min.dimensions(); i++) + for (unsigned int i = 0; i < min.dimensions (); i++) { - if (box.min[i] < min[i]) - min[i] = box.min[i]; + if (box.min[i] < min[i]) min[i] = box.min[i]; - if (box.max[i] > max[i]) - max[i] = box.max[i]; + if (box.max[i] > max[i]) max[i] = box.max[i]; } } @@ -248,10 +251,9 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool Box::intersects (const V& point) const IMATH_NOEXCEPT { - for (unsigned int i = 0; i < min.dimensions(); i++) + for (unsigned int i = 0; i < min.dimensions (); i++) { - if (point[i] < min[i] || point[i] > max[i]) - return false; + if (point[i] < min[i] || point[i] > max[i]) return false; } return true; @@ -261,10 +263,9 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool Box::intersects (const Box& box) const IMATH_NOEXCEPT { - for (unsigned int i = 0; i < min.dimensions(); i++) + for (unsigned int i = 0; i < min.dimensions (); i++) { - if (box.max[i] < min[i] || box.min[i] > max[i]) - return false; + if (box.max[i] < min[i] || box.min[i] > max[i]) return false; } return true; @@ -272,29 +273,27 @@ Box::intersects (const Box& box) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline V -Box::size() const IMATH_NOEXCEPT +Box::size () const IMATH_NOEXCEPT { - if (isEmpty()) - return V (0); + if (isEmpty ()) return V (0); return max - min; } template IMATH_HOSTDEVICE constexpr inline V -Box::center() const IMATH_NOEXCEPT +Box::center () const IMATH_NOEXCEPT { return (max + min) / 2; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Box::isEmpty() const IMATH_NOEXCEPT +Box::isEmpty () const IMATH_NOEXCEPT { - for (unsigned int i = 0; i < min.dimensions(); i++) + for (unsigned int i = 0; i < min.dimensions (); i++) { - if (max[i] < min[i]) - return true; + if (max[i] < min[i]) return true; } return false; @@ -302,11 +301,11 @@ Box::isEmpty() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Box::isInfinite() const IMATH_NOEXCEPT +Box::isInfinite () const IMATH_NOEXCEPT { - for (unsigned int i = 0; i < min.dimensions(); i++) + for (unsigned int i = 0; i < min.dimensions (); i++) { - if (min[i] != V::baseTypeLowest() || max[i] != V::baseTypeMax()) + if (min[i] != V::baseTypeLowest () || max[i] != V::baseTypeMax ()) return false; } @@ -315,12 +314,11 @@ Box::isInfinite() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Box::hasVolume() const IMATH_NOEXCEPT +Box::hasVolume () const IMATH_NOEXCEPT { - for (unsigned int i = 0; i < min.dimensions(); i++) + for (unsigned int i = 0; i < min.dimensions (); i++) { - if (max[i] <= min[i]) - return false; + if (max[i] <= min[i]) return false; } return true; @@ -328,15 +326,14 @@ Box::hasVolume() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline unsigned int -Box::majorAxis() const IMATH_NOEXCEPT +Box::majorAxis () const IMATH_NOEXCEPT { unsigned int major = 0; - V s = size(); + V s = size (); - for (unsigned int i = 1; i < min.dimensions(); i++) + for (unsigned int i = 1; i < min.dimensions (); i++) { - if (s[i] > s[major]) - major = i; + if (s[i] > s[major]) major = i; } return major; @@ -358,11 +355,10 @@ template class Box; template class IMATH_EXPORT_TEMPLATE_TYPE Box> { - public: - +public: /// @{ /// @name Direct access to bounds - + /// The minimum value of the box. Vec2 min; @@ -370,29 +366,33 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Box> Vec2 max; /// @} - + /// @{ /// @name Constructors and Assignment /// Empty by default - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box () IMATH_NOEXCEPT; /// Construct a bounding box that contains a single point. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box (const Vec2& point) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box (const Vec2& point) + IMATH_NOEXCEPT; /// Construct a bounding box with the given minimum and maximum points - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box (const Vec2& minT, const Vec2& maxT) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Box (const Vec2& minT, const Vec2& maxT) IMATH_NOEXCEPT; /// @} /// @{ /// @name Comparison - + /// Equality - IMATH_HOSTDEVICE constexpr bool operator== (const Box>& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator== (const Box>& src) const IMATH_NOEXCEPT; /// Inequality - IMATH_HOSTDEVICE constexpr bool operator!= (const Box>& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator!= (const Box>& src) const IMATH_NOEXCEPT; /// @} @@ -403,7 +403,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Box> /// greater than the maximum. makeEmpty() sets the mimimum to /// std::numeric_limits::max() and the maximum to /// std::numeric_limits::lowest(). - IMATH_HOSTDEVICE void makeEmpty() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeEmpty () IMATH_NOEXCEPT; /// Extend the Box to include the given point. IMATH_HOSTDEVICE void extendBy (const Vec2& point) IMATH_NOEXCEPT; @@ -412,42 +412,45 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Box> IMATH_HOSTDEVICE void extendBy (const Box>& box) IMATH_NOEXCEPT; /// Make the box include the entire range of T. - IMATH_HOSTDEVICE void makeInfinite() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeInfinite () IMATH_NOEXCEPT; /// @} /// @{ /// @name Query - + /// Return the size of the box. The size is of type `V`, defined as /// `(max-min)`. An empty box has a size of `V(0)`, i.e. 0 in each dimension. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec2 size() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec2 size () const IMATH_NOEXCEPT; /// Return the center of the box. The center is defined as /// `(max+min)/2`. The center of an empty box is undefined. - IMATH_HOSTDEVICE constexpr Vec2 center() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec2 center () const IMATH_NOEXCEPT; /// Return true if the given point is inside the box, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects (const Vec2& point) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersects (const Vec2& point) const IMATH_NOEXCEPT; /// Return true if the given box is inside the box, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects (const Box>& box) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersects (const Box>& box) const IMATH_NOEXCEPT; /// Return the major axis of the box. The major axis is the dimension with /// the greatest difference between maximum and minimum. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 unsigned int majorAxis() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 unsigned int + majorAxis () const IMATH_NOEXCEPT; /// Return true if the box is empty, false otherwise. An empty box's /// minimum is greater than its maximum. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty () const IMATH_NOEXCEPT; /// Return true if the box is larger than a single point, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume () const IMATH_NOEXCEPT; /// Return true if the box contains all points, false otherwise. /// An infinite box has a mimimum of `V::baseTypeMin()` /// and a maximum of `V::baseTypeMax()`. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite () const IMATH_NOEXCEPT; /// @} }; @@ -456,19 +459,23 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Box> // Implementation //---------------- -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box() IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box () IMATH_NOEXCEPT { - makeEmpty(); + makeEmpty (); } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box (const Vec2& point) IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box ( + const Vec2& point) IMATH_NOEXCEPT { min = point; max = point; } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box (const Vec2& minT, const Vec2& maxT) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box ( + const Vec2& minT, const Vec2& maxT) IMATH_NOEXCEPT { min = minT; max = maxT; @@ -490,59 +497,52 @@ Box>::operator!= (const Box>& src) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline void -Box>::makeEmpty() IMATH_NOEXCEPT +Box>::makeEmpty () IMATH_NOEXCEPT { - min = Vec2 (Vec2::baseTypeMax()); - max = Vec2 (Vec2::baseTypeLowest()); + min = Vec2 (Vec2::baseTypeMax ()); + max = Vec2 (Vec2::baseTypeLowest ()); } template IMATH_HOSTDEVICE inline void -Box>::makeInfinite() IMATH_NOEXCEPT +Box>::makeInfinite () IMATH_NOEXCEPT { - min = Vec2 (Vec2::baseTypeLowest()); - max = Vec2 (Vec2::baseTypeMax()); + min = Vec2 (Vec2::baseTypeLowest ()); + max = Vec2 (Vec2::baseTypeMax ()); } template IMATH_HOSTDEVICE inline void Box>::extendBy (const Vec2& point) IMATH_NOEXCEPT { - if (point[0] < min[0]) - min[0] = point[0]; + if (point[0] < min[0]) min[0] = point[0]; - if (point[0] > max[0]) - max[0] = point[0]; + if (point[0] > max[0]) max[0] = point[0]; - if (point[1] < min[1]) - min[1] = point[1]; + if (point[1] < min[1]) min[1] = point[1]; - if (point[1] > max[1]) - max[1] = point[1]; + if (point[1] > max[1]) max[1] = point[1]; } template IMATH_HOSTDEVICE inline void Box>::extendBy (const Box>& box) IMATH_NOEXCEPT { - if (box.min[0] < min[0]) - min[0] = box.min[0]; + if (box.min[0] < min[0]) min[0] = box.min[0]; - if (box.max[0] > max[0]) - max[0] = box.max[0]; + if (box.max[0] > max[0]) max[0] = box.max[0]; - if (box.min[1] < min[1]) - min[1] = box.min[1]; + if (box.min[1] < min[1]) min[1] = box.min[1]; - if (box.max[1] > max[1]) - max[1] = box.max[1]; + if (box.max[1] > max[1]) max[1] = box.max[1]; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool Box>::intersects (const Vec2& point) const IMATH_NOEXCEPT { - if (point[0] < min[0] || point[0] > max[0] || point[1] < min[1] || point[1] > max[1]) + if (point[0] < min[0] || point[0] > max[0] || point[1] < min[1] || + point[1] > max[1]) return false; return true; @@ -552,7 +552,8 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool Box>::intersects (const Box>& box) const IMATH_NOEXCEPT { - if (box.max[0] < min[0] || box.min[0] > max[0] || box.max[1] < min[1] || box.min[1] > max[1]) + if (box.max[0] < min[0] || box.min[0] > max[0] || box.max[1] < min[1] || + box.min[1] > max[1]) return false; return true; @@ -560,39 +561,37 @@ Box>::intersects (const Box>& box) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Vec2 -Box>::size() const IMATH_NOEXCEPT + Box>::size () const IMATH_NOEXCEPT { - if (isEmpty()) - return Vec2 (0); + if (isEmpty ()) return Vec2 (0); return max - min; } template IMATH_HOSTDEVICE constexpr inline Vec2 -Box>::center() const IMATH_NOEXCEPT +Box>::center () const IMATH_NOEXCEPT { return (max + min) / 2; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Box>::isEmpty() const IMATH_NOEXCEPT +Box>::isEmpty () const IMATH_NOEXCEPT { - if (max[0] < min[0] || max[1] < min[1]) - return true; + if (max[0] < min[0] || max[1] < min[1]) return true; return false; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Box>::isInfinite() const IMATH_NOEXCEPT +Box>::isInfinite () const IMATH_NOEXCEPT { - if (min[0] != std::numeric_limits::lowest() || - max[0] != std::numeric_limits::max() || - min[1] != std::numeric_limits::lowest() || - max[1] != std::numeric_limits::max()) + if (min[0] != std::numeric_limits::lowest () || + max[0] != std::numeric_limits::max () || + min[1] != std::numeric_limits::lowest () || + max[1] != std::numeric_limits::max ()) return false; return true; @@ -600,38 +599,35 @@ Box>::isInfinite() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Box>::hasVolume() const IMATH_NOEXCEPT +Box>::hasVolume () const IMATH_NOEXCEPT { - if (max[0] <= min[0] || max[1] <= min[1]) - return false; + if (max[0] <= min[0] || max[1] <= min[1]) return false; return true; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline unsigned int -Box>::majorAxis() const IMATH_NOEXCEPT +Box>::majorAxis () const IMATH_NOEXCEPT { unsigned int major = 0; - Vec2 s = size(); + Vec2 s = size (); - if (s[1] > s[major]) - major = 1; + if (s[1] > s[major]) major = 1; return major; } /// /// The Box template represents a 3D bounding box defined by -/// minimum and maximum values of type Vec3. +/// minimum and maximum values of type Vec3. /// template class IMATH_EXPORT_TEMPLATE_TYPE Box> { - public: - +public: /// @{ /// @name Direct access to bounds - + /// The minimum value of the box. Vec3 min; @@ -644,27 +640,31 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Box> /// @name Constructors /// Empty by default - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box () IMATH_NOEXCEPT; /// Construct a bounding box that contains a single point. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box (const Vec3& point) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box (const Vec3& point) + IMATH_NOEXCEPT; /// Construct a bounding box with the given minimum and maximum points - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box (const Vec3& minT, const Vec3& maxT) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Box (const Vec3& minT, const Vec3& maxT) IMATH_NOEXCEPT; /// @} /// Equality - IMATH_HOSTDEVICE constexpr bool operator== (const Box>& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator== (const Box>& src) const IMATH_NOEXCEPT; /// Inequality - IMATH_HOSTDEVICE constexpr bool operator!= (const Box>& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator!= (const Box>& src) const IMATH_NOEXCEPT; /// Set the Box to be empty. A Box is empty if the mimimum is /// greater than the maximum. makeEmpty() sets the mimimum to /// std::numeric_limits::max() and the maximum to /// std::numeric_limits::lowest(). - IMATH_HOSTDEVICE void makeEmpty() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeEmpty () IMATH_NOEXCEPT; /// Extend the Box to include the given point. IMATH_HOSTDEVICE void extendBy (const Vec3& point) IMATH_NOEXCEPT; @@ -673,56 +673,63 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Box> IMATH_HOSTDEVICE void extendBy (const Box>& box) IMATH_NOEXCEPT; /// Make the box include the entire range of T. - IMATH_HOSTDEVICE void makeInfinite() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeInfinite () IMATH_NOEXCEPT; /// Return the size of the box. The size is of type `V`, defined as /// (max-min). An empty box has a size of V(0), i.e. 0 in each dimension. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 size() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 size () const IMATH_NOEXCEPT; /// Return the center of the box. The center is defined as /// (max+min)/2. The center of an empty box is undefined. - IMATH_HOSTDEVICE constexpr Vec3 center() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 center () const IMATH_NOEXCEPT; /// Return true if the given point is inside the box, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects (const Vec3& point) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersects (const Vec3& point) const IMATH_NOEXCEPT; /// Return true if the given box is inside the box, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects (const Box>& box) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersects (const Box>& box) const IMATH_NOEXCEPT; /// Return the major axis of the box. The major axis is the dimension with /// the greatest difference between maximum and minimum. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 unsigned int majorAxis() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 unsigned int + majorAxis () const IMATH_NOEXCEPT; /// Return true if the box is empty, false otherwise. An empty box's /// minimum is greater than its maximum. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty () const IMATH_NOEXCEPT; /// Return true if the box is larger than a single point, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume () const IMATH_NOEXCEPT; /// Return true if the box contains all points, false otherwise. /// An infinite box has a mimimum of`V::baseTypeMin()` /// and a maximum of `V::baseTypeMax()`. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite () const IMATH_NOEXCEPT; }; //---------------- // Implementation //---------------- -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box() IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box () IMATH_NOEXCEPT { - makeEmpty(); + makeEmpty (); } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box (const Vec3& point) IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box ( + const Vec3& point) IMATH_NOEXCEPT { min = point; max = point; } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box (const Vec3& minT, const Vec3& maxT) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Box>::Box ( + const Vec3& minT, const Vec3& maxT) IMATH_NOEXCEPT { min = minT; max = maxT; @@ -744,72 +751,60 @@ Box>::operator!= (const Box>& src) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline void -Box>::makeEmpty() IMATH_NOEXCEPT +Box>::makeEmpty () IMATH_NOEXCEPT { - min = Vec3 (Vec3::baseTypeMax()); - max = Vec3 (Vec3::baseTypeLowest()); + min = Vec3 (Vec3::baseTypeMax ()); + max = Vec3 (Vec3::baseTypeLowest ()); } template IMATH_HOSTDEVICE inline void -Box>::makeInfinite() IMATH_NOEXCEPT +Box>::makeInfinite () IMATH_NOEXCEPT { - min = Vec3 (Vec3::baseTypeLowest()); - max = Vec3 (Vec3::baseTypeMax()); + min = Vec3 (Vec3::baseTypeLowest ()); + max = Vec3 (Vec3::baseTypeMax ()); } template IMATH_HOSTDEVICE inline void Box>::extendBy (const Vec3& point) IMATH_NOEXCEPT { - if (point[0] < min[0]) - min[0] = point[0]; + if (point[0] < min[0]) min[0] = point[0]; - if (point[0] > max[0]) - max[0] = point[0]; + if (point[0] > max[0]) max[0] = point[0]; - if (point[1] < min[1]) - min[1] = point[1]; + if (point[1] < min[1]) min[1] = point[1]; - if (point[1] > max[1]) - max[1] = point[1]; + if (point[1] > max[1]) max[1] = point[1]; - if (point[2] < min[2]) - min[2] = point[2]; + if (point[2] < min[2]) min[2] = point[2]; - if (point[2] > max[2]) - max[2] = point[2]; + if (point[2] > max[2]) max[2] = point[2]; } template IMATH_HOSTDEVICE inline void Box>::extendBy (const Box>& box) IMATH_NOEXCEPT { - if (box.min[0] < min[0]) - min[0] = box.min[0]; + if (box.min[0] < min[0]) min[0] = box.min[0]; - if (box.max[0] > max[0]) - max[0] = box.max[0]; + if (box.max[0] > max[0]) max[0] = box.max[0]; - if (box.min[1] < min[1]) - min[1] = box.min[1]; + if (box.min[1] < min[1]) min[1] = box.min[1]; - if (box.max[1] > max[1]) - max[1] = box.max[1]; + if (box.max[1] > max[1]) max[1] = box.max[1]; - if (box.min[2] < min[2]) - min[2] = box.min[2]; + if (box.min[2] < min[2]) min[2] = box.min[2]; - if (box.max[2] > max[2]) - max[2] = box.max[2]; + if (box.max[2] > max[2]) max[2] = box.max[2]; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool Box>::intersects (const Vec3& point) const IMATH_NOEXCEPT { - if (point[0] < min[0] || point[0] > max[0] || point[1] < min[1] || point[1] > max[1] || - point[2] < min[2] || point[2] > max[2]) + if (point[0] < min[0] || point[0] > max[0] || point[1] < min[1] || + point[1] > max[1] || point[2] < min[2] || point[2] > max[2]) return false; return true; @@ -819,8 +814,8 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool Box>::intersects (const Box>& box) const IMATH_NOEXCEPT { - if (box.max[0] < min[0] || box.min[0] > max[0] || box.max[1] < min[1] || box.min[1] > max[1] || - box.max[2] < min[2] || box.min[2] > max[2]) + if (box.max[0] < min[0] || box.min[0] > max[0] || box.max[1] < min[1] || + box.min[1] > max[1] || box.max[2] < min[2] || box.min[2] > max[2]) return false; return true; @@ -828,41 +823,39 @@ Box>::intersects (const Box>& box) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Vec3 -Box>::size() const IMATH_NOEXCEPT + Box>::size () const IMATH_NOEXCEPT { - if (isEmpty()) - return Vec3 (0); + if (isEmpty ()) return Vec3 (0); return max - min; } template IMATH_HOSTDEVICE constexpr inline Vec3 -Box>::center() const IMATH_NOEXCEPT +Box>::center () const IMATH_NOEXCEPT { return (max + min) / 2; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Box>::isEmpty() const IMATH_NOEXCEPT +Box>::isEmpty () const IMATH_NOEXCEPT { - if (max[0] < min[0] || max[1] < min[1] || max[2] < min[2]) - return true; + if (max[0] < min[0] || max[1] < min[1] || max[2] < min[2]) return true; return false; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Box>::isInfinite() const IMATH_NOEXCEPT -{ - if (min[0] != std::numeric_limits::lowest() || - max[0] != std::numeric_limits::max() || - min[1] != std::numeric_limits::lowest() || - max[1] != std::numeric_limits::max() || - min[2] != std::numeric_limits::lowest() || - max[2] != std::numeric_limits::max()) +Box>::isInfinite () const IMATH_NOEXCEPT +{ + if (min[0] != std::numeric_limits::lowest () || + max[0] != std::numeric_limits::max () || + min[1] != std::numeric_limits::lowest () || + max[1] != std::numeric_limits::max () || + min[2] != std::numeric_limits::lowest () || + max[2] != std::numeric_limits::max ()) return false; return true; @@ -870,26 +863,23 @@ Box>::isInfinite() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Box>::hasVolume() const IMATH_NOEXCEPT +Box>::hasVolume () const IMATH_NOEXCEPT { - if (max[0] <= min[0] || max[1] <= min[1] || max[2] <= min[2]) - return false; + if (max[0] <= min[0] || max[1] <= min[1] || max[2] <= min[2]) return false; return true; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline unsigned int -Box>::majorAxis() const IMATH_NOEXCEPT +Box>::majorAxis () const IMATH_NOEXCEPT { unsigned int major = 0; - Vec3 s = size(); + Vec3 s = size (); - if (s[1] > s[major]) - major = 1; + if (s[1] > s[major]) major = 1; - if (s[2] > s[major]) - major = 2; + if (s[2] > s[major]) major = 2; return major; } diff --git a/third_party/Imath-3.1.9/src/Imath/ImathBoxAlgo.h b/third_party/Imath/src/Imath/ImathBoxAlgo.h similarity index 89% rename from third_party/Imath-3.1.9/src/Imath/ImathBoxAlgo.h rename to third_party/Imath/src/Imath/ImathBoxAlgo.h index 97e6edb7..3ad5e127 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathBoxAlgo.h +++ b/third_party/Imath/src/Imath/ImathBoxAlgo.h @@ -30,7 +30,7 @@ clip (const T& p, const Box& box) IMATH_NOEXCEPT { T q; - for (int i = 0; i < int (box.min.dimensions()); i++) + for (int i = 0; i < int (box.min.dimensions ()); i++) { if (p[i] < box.min[i]) q[i] = box.min[i]; @@ -66,8 +66,7 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 closestPointOnBox (const Vec3& p, const Box>& box) IMATH_NOEXCEPT { - if (box.isEmpty()) - return p; + if (box.isEmpty ()) return p; Vec3 q = closestPointInBox (p, box); @@ -76,9 +75,10 @@ closestPointOnBox (const Vec3& p, const Box>& box) IMATH_NOEXCEPT Vec3 d1 = p - box.min; Vec3 d2 = box.max - p; - Vec3 d ((d1.x < d2.x) ? d1.x : d2.x, - (d1.y < d2.y) ? d1.y : d2.y, - (d1.z < d2.z) ? d1.z : d2.z); + Vec3 d ( + (d1.x < d2.x) ? d1.x : d2.x, + (d1.y < d2.y) ? d1.y : d2.y, + (d1.z < d2.z) ? d1.z : d2.z); if (d.x < d.y && d.x < d.z) { @@ -113,8 +113,7 @@ template IMATH_HOSTDEVICE Box> transform (const Box>& box, const Matrix44& m) IMATH_NOEXCEPT { - if (box.isEmpty() || box.isInfinite()) - return box; + if (box.isEmpty () || box.isInfinite ()) return box; // // If the last column of m is (0 0 0 1) then m is an affine @@ -192,12 +191,10 @@ transform (const Box>& box, const Matrix44& m) IMATH_NOEXCEPT template IMATH_HOSTDEVICE void -transform (const Box>& box, const Matrix44& m, Box>& result) IMATH_NOEXCEPT +transform (const Box>& box, const Matrix44& m, Box>& result) + IMATH_NOEXCEPT { - if (box.isEmpty() || box.isInfinite()) - { - return; - } + if (box.isEmpty () || box.isInfinite ()) { return; } // // If the last column of m is (0 0 0 1) then m is an affine @@ -269,8 +266,7 @@ template IMATH_HOSTDEVICE Box> affineTransform (const Box>& box, const Matrix44& m) IMATH_NOEXCEPT { - if (box.isEmpty() || box.isInfinite()) - return box; + if (box.isEmpty () || box.isInfinite ()) return box; Box> newBox; @@ -303,7 +299,7 @@ affineTransform (const Box>& box, const Matrix44& m) IMATH_NOEXCEPT /// /// Transform a 3D box by a matrix whose rightmost column is -/// `(0 0 0 1)`, and compute a new box that tightly encloses +/// `(0 0 0 1)`, and compute a new box that tightly encloses /// the transformed box. Return the transformed box in the `result` /// argument. /// @@ -315,17 +311,20 @@ affineTransform (const Box>& box, const Matrix44& m) IMATH_NOEXCEPT template IMATH_HOSTDEVICE void -affineTransform (const Box>& box, const Matrix44& m, Box>& result) IMATH_NOEXCEPT +affineTransform ( + const Box>& box, + const Matrix44& m, + Box>& result) IMATH_NOEXCEPT { - if (box.isEmpty()) + if (box.isEmpty ()) { - result.makeEmpty(); + result.makeEmpty (); return; } - if (box.isInfinite()) + if (box.isInfinite ()) { - result.makeInfinite(); + result.makeInfinite (); return; } @@ -369,9 +368,11 @@ affineTransform (const Box>& box, const Matrix44& m, Box>& re template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool -findEntryAndExitPoints (const Line3& r, const Box>& b, Vec3& entry, Vec3& exit) IMATH_NOEXCEPT +findEntryAndExitPoints ( + const Line3& r, const Box>& b, Vec3& entry, Vec3& exit) + IMATH_NOEXCEPT { - if (b.isEmpty()) + if (b.isEmpty ()) { // // No ray intersects an empty box @@ -398,7 +399,7 @@ findEntryAndExitPoints (const Line3& r, const Box>& b, Vec3& entry // exit point. // - const T TMAX = std::numeric_limits::max(); + const T TMAX = std::numeric_limits::max (); T tFrontMax = -TMAX; T tBackMin = TMAX; @@ -412,7 +413,8 @@ findEntryAndExitPoints (const Line3& r, const Box>& b, Vec3& entry T d1 = b.max.x - r.pos.x; T d2 = b.min.x - r.pos.x; - if (r.dir.x > 1 || (abs (d1) < TMAX * r.dir.x && abs (d2) < TMAX * r.dir.x)) + if (r.dir.x > 1 || + (abs (d1) < TMAX * r.dir.x && abs (d2) < TMAX * r.dir.x)) { T t1 = d1 / r.dir.x; T t2 = d2 / r.dir.x; @@ -445,7 +447,8 @@ findEntryAndExitPoints (const Line3& r, const Box>& b, Vec3& entry T d1 = b.min.x - r.pos.x; T d2 = b.max.x - r.pos.x; - if (r.dir.x < -1 || (abs (d1) < -TMAX * r.dir.x && abs (d2) < -TMAX * r.dir.x)) + if (r.dir.x < -1 || + (abs (d1) < -TMAX * r.dir.x && abs (d2) < -TMAX * r.dir.x)) { T t1 = d1 / r.dir.x; T t2 = d2 / r.dir.x; @@ -483,7 +486,8 @@ findEntryAndExitPoints (const Line3& r, const Box>& b, Vec3& entry T d1 = b.max.y - r.pos.y; T d2 = b.min.y - r.pos.y; - if (r.dir.y > 1 || (abs (d1) < TMAX * r.dir.y && abs (d2) < TMAX * r.dir.y)) + if (r.dir.y > 1 || + (abs (d1) < TMAX * r.dir.y && abs (d2) < TMAX * r.dir.y)) { T t1 = d1 / r.dir.y; T t2 = d2 / r.dir.y; @@ -516,7 +520,8 @@ findEntryAndExitPoints (const Line3& r, const Box>& b, Vec3& entry T d1 = b.min.y - r.pos.y; T d2 = b.max.y - r.pos.y; - if (r.dir.y < -1 || (abs (d1) < -TMAX * r.dir.y && abs (d2) < -TMAX * r.dir.y)) + if (r.dir.y < -1 || + (abs (d1) < -TMAX * r.dir.y && abs (d2) < -TMAX * r.dir.y)) { T t1 = d1 / r.dir.y; T t2 = d2 / r.dir.y; @@ -554,7 +559,8 @@ findEntryAndExitPoints (const Line3& r, const Box>& b, Vec3& entry T d1 = b.max.z - r.pos.z; T d2 = b.min.z - r.pos.z; - if (r.dir.z > 1 || (abs (d1) < TMAX * r.dir.z && abs (d2) < TMAX * r.dir.z)) + if (r.dir.z > 1 || + (abs (d1) < TMAX * r.dir.z && abs (d2) < TMAX * r.dir.z)) { T t1 = d1 / r.dir.z; T t2 = d2 / r.dir.z; @@ -587,7 +593,8 @@ findEntryAndExitPoints (const Line3& r, const Box>& b, Vec3& entry T d1 = b.min.z - r.pos.z; T d2 = b.max.z - r.pos.z; - if (r.dir.z < -1 || (abs (d1) < -TMAX * r.dir.z && abs (d2) < -TMAX * r.dir.z)) + if (r.dir.z < -1 || + (abs (d1) < -TMAX * r.dir.z && abs (d2) < -TMAX * r.dir.z)) { T t1 = d1 / r.dir.z; T t2 = d2 / r.dir.z; @@ -639,9 +646,10 @@ findEntryAndExitPoints (const Line3& r, const Box>& b, Vec3& entry template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool -intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEPT +intersects (const Box>& b, const Line3& r, Vec3& ip) + IMATH_NOEXCEPT { - if (b.isEmpty()) + if (b.isEmpty ()) { // // No ray intersects an empty box @@ -673,7 +681,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP // intersection is the ray-box intersection. // - const T TMAX = std::numeric_limits::max(); + const T TMAX = std::numeric_limits::max (); T tFrontMax = -1; T tBackMin = TMAX; @@ -684,8 +692,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP if (r.dir.x > 0) { - if (r.pos.x > b.max.x) - return false; + if (r.pos.x > b.max.x) return false; T d = b.max.x - r.pos.x; @@ -693,8 +700,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP { T t = d / r.dir.x; - if (tBackMin > t) - tBackMin = t; + if (tBackMin > t) tBackMin = t; } if (r.pos.x <= b.min.x) @@ -714,8 +720,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP } else if (r.dir.x < 0) { - if (r.pos.x < b.min.x) - return false; + if (r.pos.x < b.min.x) return false; T d = b.min.x - r.pos.x; @@ -723,8 +728,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP { T t = d / r.dir.x; - if (tBackMin > t) - tBackMin = t; + if (tBackMin > t) tBackMin = t; } if (r.pos.x >= b.max.x) @@ -744,8 +748,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP } else // r.dir.x == 0 { - if (r.pos.x < b.min.x || r.pos.x > b.max.x) - return false; + if (r.pos.x < b.min.x || r.pos.x > b.max.x) return false; } // @@ -754,8 +757,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP if (r.dir.y > 0) { - if (r.pos.y > b.max.y) - return false; + if (r.pos.y > b.max.y) return false; T d = b.max.y - r.pos.y; @@ -763,8 +765,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP { T t = d / r.dir.y; - if (tBackMin > t) - tBackMin = t; + if (tBackMin > t) tBackMin = t; } if (r.pos.y <= b.min.y) @@ -784,8 +785,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP } else if (r.dir.y < 0) { - if (r.pos.y < b.min.y) - return false; + if (r.pos.y < b.min.y) return false; T d = b.min.y - r.pos.y; @@ -793,8 +793,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP { T t = d / r.dir.y; - if (tBackMin > t) - tBackMin = t; + if (tBackMin > t) tBackMin = t; } if (r.pos.y >= b.max.y) @@ -814,8 +813,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP } else // r.dir.y == 0 { - if (r.pos.y < b.min.y || r.pos.y > b.max.y) - return false; + if (r.pos.y < b.min.y || r.pos.y > b.max.y) return false; } // @@ -824,8 +822,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP if (r.dir.z > 0) { - if (r.pos.z > b.max.z) - return false; + if (r.pos.z > b.max.z) return false; T d = b.max.z - r.pos.z; @@ -833,8 +830,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP { T t = d / r.dir.z; - if (tBackMin > t) - tBackMin = t; + if (tBackMin > t) tBackMin = t; } if (r.pos.z <= b.min.z) @@ -854,8 +850,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP } else if (r.dir.z < 0) { - if (r.pos.z < b.min.z) - return false; + if (r.pos.z < b.min.z) return false; T d = b.min.z - r.pos.z; @@ -863,8 +858,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP { T t = d / r.dir.z; - if (tBackMin > t) - tBackMin = t; + if (tBackMin > t) tBackMin = t; } if (r.pos.z >= b.max.z) @@ -884,8 +878,7 @@ intersects (const Box>& b, const Line3& r, Vec3& ip) IMATH_NOEXCEP } else // r.dir.z == 0 { - if (r.pos.z < b.min.z || r.pos.z > b.max.z) - return false; + if (r.pos.z < b.min.z || r.pos.z > b.max.z) return false; } return tFrontMax <= tBackMin; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathColor.h b/third_party/Imath/src/Imath/ImathColor.h similarity index 70% rename from third_party/Imath-3.1.9/src/Imath/ImathColor.h rename to third_party/Imath/src/Imath/ImathColor.h index 90599425..01843179 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathColor.h +++ b/third_party/Imath/src/Imath/ImathColor.h @@ -29,84 +29,95 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class IMATH_EXPORT_TEMPLATE_TYPE Color3 : public Vec3 { - public: - +public: /// @{ /// @name Constructors and Assignemt /// No initialization by default - IMATH_HOSTDEVICE Color3() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Color3 () IMATH_NOEXCEPT; /// Initialize to (a a a) - IMATH_HOSTDEVICE constexpr explicit Color3 (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr explicit Color3 (T a) IMATH_NOEXCEPT; /// Initialize to (a b c) - IMATH_HOSTDEVICE constexpr Color3 (T a, T b, T c) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color3 (T a, T b, T c) IMATH_NOEXCEPT; /// Construct from Color3 - IMATH_HOSTDEVICE constexpr Color3 (const Color3& c) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color3 (const Color3& c) IMATH_NOEXCEPT; /// Construct from Vec3 - template IMATH_HOSTDEVICE constexpr Color3 (const Vec3& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr Color3 (const Vec3& v) IMATH_NOEXCEPT; /// Destructor ~Color3() = default; /// Component-wise assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& operator= (const Color3& c) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& + operator= (const Color3& c) IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Arithmetic - + /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& operator+= (const Color3& c) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& + operator+= (const Color3& c) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE constexpr Color3 operator+ (const Color3& c) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color3 + operator+ (const Color3& c) const IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& operator-= (const Color3& c) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& + operator-= (const Color3& c) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE constexpr Color3 operator- (const Color3& c) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color3 + operator- (const Color3& c) const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE constexpr Color3 operator-() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color3 operator- () const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& negate() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& negate () IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& operator*= (const Color3& c) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& + operator*= (const Color3& c) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& operator*= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& + operator*= (T a) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE constexpr Color3 operator* (const Color3& c) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color3 + operator* (const Color3& c) const IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE constexpr Color3 operator* (T a) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color3 operator* (T a) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& operator/= (const Color3& c) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& + operator/= (const Color3& c) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& operator/= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3& + operator/= (T a) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE constexpr Color3 operator/ (const Color3& c) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color3 + operator/ (const Color3& c) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE constexpr Color3 operator/ (T a) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color3 operator/ (T a) const IMATH_NOEXCEPT; /// @} }; /// -/// A 4-channel color class: 3 channels plus alpha. +/// A 4-channel color class: 3 channels plus alpha. /// /// For convenience, the fields are named `r`, `g`, and `b`, although /// this class does not impose interpretation on the channels, which @@ -115,8 +126,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Color3 : public Vec3 template class IMATH_EXPORT_TEMPLATE_TYPE Color4 { - public: - +public: /// @{ /// @name Direct access to elements @@ -128,107 +138,140 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Color4 /// @name Constructors and Assignment /// No initialization by default - IMATH_HOSTDEVICE Color4() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Color4 () IMATH_NOEXCEPT; /// Initialize to `(a a a a)` - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 explicit Color4 (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 explicit Color4 (T a) IMATH_NOEXCEPT; /// Initialize to `(a b c d)` - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 (T a, T b, T c, T d) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 (T a, T b, T c, T d) + IMATH_NOEXCEPT; /// Construct from Color4 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 (const Color4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 (const Color4& v) IMATH_NOEXCEPT; /// Construct from Color4 - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 (const Color4& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 (const Color4& v) + IMATH_NOEXCEPT; /// Destructor ~Color4() = default; /// Assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& operator= (const Color4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& + operator= (const Color4& v) IMATH_NOEXCEPT; /// Component-wise value - IMATH_HOSTDEVICE T& operator[] (int i) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T& operator[] (int i) IMATH_NOEXCEPT; /// Component-wise value - IMATH_HOSTDEVICE const T& operator[] (int i) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const T& operator[] (int i) const IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Arithmetic and Comparison - + /// Equality - template IMATH_HOSTDEVICE constexpr bool operator== (const Color4& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr bool + operator== (const Color4& v) const IMATH_NOEXCEPT; /// Inequality - template IMATH_HOSTDEVICE constexpr bool operator!= (const Color4& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr bool + operator!= (const Color4& v) const IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& operator+= (const Color4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& + operator+= (const Color4& v) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE constexpr Color4 operator+ (const Color4& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color4 + operator+ (const Color4& v) const IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& operator-= (const Color4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& + operator-= (const Color4& v) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE constexpr Color4 operator- (const Color4& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color4 + operator- (const Color4& v) const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE constexpr Color4 operator-() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color4 operator- () const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& negate() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& negate () IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& operator*= (const Color4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& + operator*= (const Color4& v) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& operator*= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& + operator*= (T a) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE constexpr Color4 operator* (const Color4& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color4 + operator* (const Color4& v) const IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE constexpr Color4 operator* (T a) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color4 operator* (T a) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& operator/= (const Color4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& + operator/= (const Color4& v) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& operator/= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4& + operator/= (T a) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE constexpr Color4 operator/ (const Color4& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color4 + operator/ (const Color4& v) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE constexpr Color4 operator/ (T a) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Color4 operator/ (T a) const IMATH_NOEXCEPT; /// @} /// @{ /// @name Numeric Limits - + /// Number of dimensions (channels), i.e. 4 for a Color4 - IMATH_HOSTDEVICE constexpr static unsigned int dimensions() IMATH_NOEXCEPT { return 4; } + IMATH_HOSTDEVICE constexpr static unsigned int dimensions () IMATH_NOEXCEPT + { + return 4; + } /// Largest possible negative value - IMATH_HOSTDEVICE constexpr static T baseTypeLowest() IMATH_NOEXCEPT { return std::numeric_limits::lowest(); } + IMATH_HOSTDEVICE constexpr static T baseTypeLowest () IMATH_NOEXCEPT + { + return std::numeric_limits::lowest (); + } /// Largest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeMax() IMATH_NOEXCEPT { return std::numeric_limits::max(); } + IMATH_HOSTDEVICE constexpr static T baseTypeMax () IMATH_NOEXCEPT + { + return std::numeric_limits::max (); + } /// Smallest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeSmallest() IMATH_NOEXCEPT { return std::numeric_limits::min(); } + IMATH_HOSTDEVICE constexpr static T baseTypeSmallest () IMATH_NOEXCEPT + { + return std::numeric_limits::min (); + } /// Smallest possible e for which 1+e != 1 - IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon() IMATH_NOEXCEPT { return std::numeric_limits::epsilon(); } + IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon () IMATH_NOEXCEPT + { + return std::numeric_limits::epsilon (); + } /// @} - + /// The base type: In templates that accept a parameter `V` (could /// be a Color4), you can refer to `T` as `V::BaseType` typedef T BaseType; @@ -237,32 +280,39 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Color4 /// @name Compatibilty with Sb /// Set the value - template IMATH_HOSTDEVICE void setValue (S a, S b, S c, S d) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void setValue (S a, S b, S c, S d) IMATH_NOEXCEPT; /// Set the value - template IMATH_HOSTDEVICE void setValue (const Color4& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void setValue (const Color4& v) IMATH_NOEXCEPT; /// Return the value - template IMATH_HOSTDEVICE void getValue (S& a, S& b, S& c, S& d) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void + getValue (S& a, S& b, S& c, S& d) const IMATH_NOEXCEPT; /// Return the value - template IMATH_HOSTDEVICE void getValue (Color4& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void getValue (Color4& v) const IMATH_NOEXCEPT; /// Return raw pointer to the value - IMATH_HOSTDEVICE T* getValue() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T* getValue () IMATH_NOEXCEPT; /// Return raw pointer to the value - IMATH_HOSTDEVICE const T* getValue() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const T* getValue () const IMATH_NOEXCEPT; /// @} }; /// Stream output, as "(r g b a)" -template std::ostream& operator<< (std::ostream& s, const Color4& v); +template +std::ostream& operator<< (std::ostream& s, const Color4& v); /// Reverse multiplication: S * Color4 template -IMATH_HOSTDEVICE constexpr Color4 operator* (S a, const Color4& v) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Color4 +operator* (S a, const Color4& v) IMATH_NOEXCEPT; /// 3 float channels typedef Color3 Color3f; @@ -307,29 +357,37 @@ typedef unsigned int PackedColor; // Implementation of Color3 // -template IMATH_HOSTDEVICE inline Color3::Color3() IMATH_NOEXCEPT : Vec3() +template +IMATH_HOSTDEVICE inline Color3::Color3 () IMATH_NOEXCEPT : Vec3 () { // empty } -template IMATH_HOSTDEVICE constexpr inline Color3::Color3 (T a) IMATH_NOEXCEPT : Vec3 (a) +template +IMATH_HOSTDEVICE constexpr inline Color3::Color3 (T a) IMATH_NOEXCEPT + : Vec3 (a) { // empty } -template IMATH_HOSTDEVICE constexpr inline Color3::Color3 (T a, T b, T c) IMATH_NOEXCEPT : Vec3 (a, b, c) +template +IMATH_HOSTDEVICE constexpr inline Color3::Color3 (T a, T b, T c) + IMATH_NOEXCEPT : Vec3 (a, b, c) { // empty } -template IMATH_HOSTDEVICE constexpr inline Color3::Color3 (const Color3& c) IMATH_NOEXCEPT : Vec3 (c) +template +IMATH_HOSTDEVICE constexpr inline Color3::Color3 (const Color3& c) + IMATH_NOEXCEPT : Vec3 (c) { // empty } template template -IMATH_HOSTDEVICE constexpr inline Color3::Color3 (const Vec3& v) IMATH_NOEXCEPT : Vec3 (v) +IMATH_HOSTDEVICE constexpr inline Color3::Color3 (const Vec3& v) + IMATH_NOEXCEPT : Vec3 (v) { //empty } @@ -374,16 +432,16 @@ Color3::operator- (const Color3& c) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline Color3 -Color3::operator-() const IMATH_NOEXCEPT +Color3::operator- () const IMATH_NOEXCEPT { return Color3 (-(*(Vec3*) this)); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color3& -Color3::negate() IMATH_NOEXCEPT + Color3::negate () IMATH_NOEXCEPT { - ((Vec3*) this)->negate(); + ((Vec3*) this)->negate (); return *this; } @@ -465,8 +523,7 @@ Color4::operator[] (int i) const IMATH_NOEXCEPT return (&r)[i]; } -template -IMATH_HOSTDEVICE inline Color4::Color4() IMATH_NOEXCEPT +template IMATH_HOSTDEVICE inline Color4::Color4 () IMATH_NOEXCEPT { // empty } @@ -478,7 +535,8 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4::Color4 (T x) IMATH_NOEXCEPT } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4::Color4 (T x, T y, T z, T w) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4::Color4 (T x, T y, T z, T w) + IMATH_NOEXCEPT { r = x; g = y; @@ -487,7 +545,8 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4::Color4 (T x, T y, T z, T w) } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4::Color4 (const Color4& v) IMATH_NOEXCEPT +IMATH_HOSTDEVICE + IMATH_CONSTEXPR14 inline Color4::Color4 (const Color4& v) IMATH_NOEXCEPT { r = v.r; g = v.g; @@ -497,7 +556,8 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4::Color4 (const Color4& v) IM template template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4::Color4 (const Color4& v) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Color4::Color4 (const Color4& v) + IMATH_NOEXCEPT { r = T (v.r); g = T (v.g); @@ -562,14 +622,14 @@ Color4::getValue (Color4& v) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline T* -Color4::getValue() IMATH_NOEXCEPT +Color4::getValue () IMATH_NOEXCEPT { return (T*) &r; } template IMATH_HOSTDEVICE inline const T* -Color4::getValue() const IMATH_NOEXCEPT +Color4::getValue () const IMATH_NOEXCEPT { return (const T*) &r; } @@ -628,14 +688,14 @@ Color4::operator- (const Color4& v) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline Color4 -Color4::operator-() const IMATH_NOEXCEPT +Color4::operator- () const IMATH_NOEXCEPT { return Color4 (-r, -g, -b, -a); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Color4& -Color4::negate() IMATH_NOEXCEPT + Color4::negate () IMATH_NOEXCEPT { r = -r; g = -g; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathColorAlgo.cpp b/third_party/Imath/src/Imath/ImathColorAlgo.cpp similarity index 65% rename from third_party/Imath-3.1.9/src/Imath/ImathColorAlgo.cpp rename to third_party/Imath/src/Imath/ImathColorAlgo.cpp index ddc26ef4..4ccb62a9 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathColorAlgo.cpp +++ b/third_party/Imath/src/Imath/ImathColorAlgo.cpp @@ -27,7 +27,7 @@ hsv2rgb_d (const Vec3& hsv) IMATH_NOEXCEPT else hue *= 6; - int i = int (std::floor (hue)); + int i = int (std::floor (hue)); double f = hue - i; double p = val * (1 - sat); double q = val * (1 - (sat * f)); @@ -35,36 +35,36 @@ hsv2rgb_d (const Vec3& hsv) IMATH_NOEXCEPT switch (i) { - case 0: - x = val; - y = t; - z = p; - break; - case 1: - x = q; - y = val; - z = p; - break; - case 2: - x = p; - y = val; - z = t; - break; - case 3: - x = p; - y = q; - z = val; - break; - case 4: - x = t; - y = p; - z = val; - break; - case 5: - x = val; - y = p; - z = q; - break; + case 0: + x = val; + y = t; + z = p; + break; + case 1: + x = q; + y = val; + z = p; + break; + case 2: + x = p; + y = val; + z = t; + break; + case 3: + x = p; + y = q; + z = val; + break; + case 4: + x = t; + y = p; + z = val; + break; + case 5: + x = val; + y = p; + z = q; + break; } return Vec3 (x, y, z); @@ -84,7 +84,7 @@ hsv2rgb_d (const Color4& hsv) IMATH_NOEXCEPT else hue *= 6; - int i = int (std::floor (hue)); + int i = int (std::floor (hue)); double f = hue - i; double p = val * (1 - sat); double q = val * (1 - (sat * f)); @@ -92,36 +92,36 @@ hsv2rgb_d (const Color4& hsv) IMATH_NOEXCEPT switch (i) { - case 0: - r = val; - g = t; - b = p; - break; - case 1: - r = q; - g = val; - b = p; - break; - case 2: - r = p; - g = val; - b = t; - break; - case 3: - r = p; - g = q; - b = val; - break; - case 4: - r = t; - g = p; - b = val; - break; - case 5: - r = val; - g = p; - b = q; - break; + case 0: + r = val; + g = t; + b = p; + break; + case 1: + r = q; + g = val; + b = p; + break; + case 2: + r = p; + g = val; + b = t; + break; + case 3: + r = p; + g = q; + b = val; + break; + case 4: + r = t; + g = p; + b = val; + break; + case 5: + r = val; + g = p; + b = q; + break; } return Color4 (r, g, b, hsv.a); @@ -141,8 +141,7 @@ rgb2hsv_d (const Vec3& c) IMATH_NOEXCEPT double sat = 0; double hue = 0; - if (max != 0) - sat = range / max; + if (max != 0) sat = range / max; if (sat != 0) { @@ -157,8 +156,7 @@ rgb2hsv_d (const Vec3& c) IMATH_NOEXCEPT hue = h / 6.; - if (hue < 0.) - hue += 1.0; + if (hue < 0.) hue += 1.0; } return Vec3 (hue, sat, val); } @@ -177,8 +175,7 @@ rgb2hsv_d (const Color4& c) IMATH_NOEXCEPT double sat = 0; double hue = 0; - if (max != 0) - sat = range / max; + if (max != 0) sat = range / max; if (sat != 0) { @@ -193,8 +190,7 @@ rgb2hsv_d (const Color4& c) IMATH_NOEXCEPT hue = h / 6.; - if (hue < 0.) - hue += 1.0; + if (hue < 0.) hue += 1.0; } return Color4 (hue, sat, val, c.a); } diff --git a/third_party/Imath-3.1.9/src/Imath/ImathColorAlgo.h b/third_party/Imath/src/Imath/ImathColorAlgo.h similarity index 60% rename from third_party/Imath-3.1.9/src/Imath/ImathColorAlgo.h rename to third_party/Imath/src/Imath/ImathColorAlgo.h index cfb08c57..cb56fff3 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathColorAlgo.h +++ b/third_party/Imath/src/Imath/ImathColorAlgo.h @@ -10,8 +10,8 @@ #ifndef INCLUDED_IMATHCOLORALGO_H #define INCLUDED_IMATHCOLORALGO_H -#include "ImathNamespace.h" #include "ImathExport.h" +#include "ImathNamespace.h" #include "ImathColor.h" #include "ImathMath.h" @@ -29,7 +29,8 @@ IMATH_EXPORT Vec3 hsv2rgb_d (const Vec3& hsv) IMATH_NOEXCEPT; /// /// Convert 4-channel hsv to rgb (with alpha). Non-templated helper routine. -IMATH_EXPORT Color4 hsv2rgb_d (const Color4& hsv) IMATH_NOEXCEPT; +IMATH_EXPORT Color4 + hsv2rgb_d (const Color4& hsv) IMATH_NOEXCEPT; /// /// Convert 3-channel rgb to hsv. Non-templated helper routine. @@ -37,7 +38,8 @@ IMATH_EXPORT Vec3 rgb2hsv_d (const Vec3& rgb) IMATH_NOEXCEPT; /// /// Convert 4-channel rgb to hsv. Non-templated helper routine. -IMATH_EXPORT Color4 rgb2hsv_d (const Color4& rgb) IMATH_NOEXCEPT; +IMATH_EXPORT Color4 + rgb2hsv_d (const Color4& rgb) IMATH_NOEXCEPT; /// /// Convert 3-channel hsv to rgb. @@ -45,17 +47,19 @@ IMATH_EXPORT Color4 rgb2hsv_d (const Color4& rgb) IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 -hsv2rgb (const Vec3& hsv) IMATH_NOEXCEPT + hsv2rgb (const Vec3& hsv) IMATH_NOEXCEPT { if (std::numeric_limits::is_integer) { - Vec3 v = Vec3 (hsv.x / double (std::numeric_limits::max()), - hsv.y / double (std::numeric_limits::max()), - hsv.z / double (std::numeric_limits::max())); + Vec3 v = Vec3 ( + hsv.x / double (std::numeric_limits::max ()), + hsv.y / double (std::numeric_limits::max ()), + hsv.z / double (std::numeric_limits::max ())); Vec3 c = hsv2rgb_d (v); - return Vec3 ((T) (c.x * std::numeric_limits::max()), - (T) (c.y * std::numeric_limits::max()), - (T) (c.z * std::numeric_limits::max())); + return Vec3 ( + (T) (c.x * std::numeric_limits::max ()), + (T) (c.y * std::numeric_limits::max ()), + (T) (c.z * std::numeric_limits::max ())); } else { @@ -71,19 +75,21 @@ hsv2rgb (const Vec3& hsv) IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 -hsv2rgb (const Color4& hsv) IMATH_NOEXCEPT + hsv2rgb (const Color4& hsv) IMATH_NOEXCEPT { if (std::numeric_limits::is_integer) { - Color4 v = Color4 (hsv.r / float (std::numeric_limits::max()), - hsv.g / float (std::numeric_limits::max()), - hsv.b / float (std::numeric_limits::max()), - hsv.a / float (std::numeric_limits::max())); + Color4 v = Color4 ( + hsv.r / float (std::numeric_limits::max ()), + hsv.g / float (std::numeric_limits::max ()), + hsv.b / float (std::numeric_limits::max ()), + hsv.a / float (std::numeric_limits::max ())); Color4 c = hsv2rgb_d (v); - return Color4 ((T) (c.r * std::numeric_limits::max()), - (T) (c.g * std::numeric_limits::max()), - (T) (c.b * std::numeric_limits::max()), - (T) (c.a * std::numeric_limits::max())); + return Color4 ( + (T) (c.r * std::numeric_limits::max ()), + (T) (c.g * std::numeric_limits::max ()), + (T) (c.b * std::numeric_limits::max ()), + (T) (c.a * std::numeric_limits::max ())); } else { @@ -99,17 +105,19 @@ hsv2rgb (const Color4& hsv) IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 -rgb2hsv (const Vec3& rgb) IMATH_NOEXCEPT + rgb2hsv (const Vec3& rgb) IMATH_NOEXCEPT { if (std::numeric_limits::is_integer) { - Vec3 v = Vec3 (rgb.x / double (std::numeric_limits::max()), - rgb.y / double (std::numeric_limits::max()), - rgb.z / double (std::numeric_limits::max())); + Vec3 v = Vec3 ( + rgb.x / double (std::numeric_limits::max ()), + rgb.y / double (std::numeric_limits::max ()), + rgb.z / double (std::numeric_limits::max ())); Vec3 c = rgb2hsv_d (v); - return Vec3 ((T) (c.x * std::numeric_limits::max()), - (T) (c.y * std::numeric_limits::max()), - (T) (c.z * std::numeric_limits::max())); + return Vec3 ( + (T) (c.x * std::numeric_limits::max ()), + (T) (c.y * std::numeric_limits::max ()), + (T) (c.z * std::numeric_limits::max ())); } else { @@ -125,19 +133,21 @@ rgb2hsv (const Vec3& rgb) IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Color4 -rgb2hsv (const Color4& rgb) IMATH_NOEXCEPT + rgb2hsv (const Color4& rgb) IMATH_NOEXCEPT { if (std::numeric_limits::is_integer) { - Color4 v = Color4 (rgb.r / float (std::numeric_limits::max()), - rgb.g / float (std::numeric_limits::max()), - rgb.b / float (std::numeric_limits::max()), - rgb.a / float (std::numeric_limits::max())); + Color4 v = Color4 ( + rgb.r / float (std::numeric_limits::max ()), + rgb.g / float (std::numeric_limits::max ()), + rgb.b / float (std::numeric_limits::max ()), + rgb.a / float (std::numeric_limits::max ())); Color4 c = rgb2hsv_d (v); - return Color4 ((T) (c.r * std::numeric_limits::max()), - (T) (c.g * std::numeric_limits::max()), - (T) (c.b * std::numeric_limits::max()), - (T) (c.a * std::numeric_limits::max())); + return Color4 ( + (T) (c.r * std::numeric_limits::max ()), + (T) (c.g * std::numeric_limits::max ()), + (T) (c.b * std::numeric_limits::max ()), + (T) (c.a * std::numeric_limits::max ())); } else { @@ -157,9 +167,9 @@ rgb2packed (const Vec3& c) IMATH_NOEXCEPT { if (std::numeric_limits::is_integer) { - float x = c.x / float (std::numeric_limits::max()); - float y = c.y / float (std::numeric_limits::max()); - float z = c.z / float (std::numeric_limits::max()); + float x = c.x / float (std::numeric_limits::max ()); + float y = c.y / float (std::numeric_limits::max ()); + float z = c.z / float (std::numeric_limits::max ()); return rgb2packed (V3f (x, y, z)); } else @@ -182,10 +192,10 @@ rgb2packed (const Color4& c) IMATH_NOEXCEPT { if (std::numeric_limits::is_integer) { - float r = c.r / float (std::numeric_limits::max()); - float g = c.g / float (std::numeric_limits::max()); - float b = c.b / float (std::numeric_limits::max()); - float a = c.a / float (std::numeric_limits::max()); + float r = c.r / float (std::numeric_limits::max ()); + float g = c.g / float (std::numeric_limits::max ()); + float b = c.b / float (std::numeric_limits::max ()); + float a = c.a / float (std::numeric_limits::max ()); return rgb2packed (C4f (r, g, b, a)); } else @@ -210,7 +220,7 @@ packed2rgb (PackedColor packed, Vec3& out) IMATH_NOEXCEPT { if (std::numeric_limits::is_integer) { - T f = std::numeric_limits::max() / ((PackedColor) 0xFF); + T f = std::numeric_limits::max () / ((PackedColor) 0xFF); out.x = (packed & 0xFF) * f; out.y = ((packed & 0xFF00) >> 8) * f; out.z = ((packed & 0xFF0000) >> 16) * f; @@ -235,7 +245,7 @@ packed2rgb (PackedColor packed, Color4& out) IMATH_NOEXCEPT { if (std::numeric_limits::is_integer) { - T f = std::numeric_limits::max() / ((PackedColor) 0xFF); + T f = std::numeric_limits::max () / ((PackedColor) 0xFF); out.r = (packed & 0xFF) * f; out.g = ((packed & 0xFF00) >> 8) * f; out.b = ((packed & 0xFF0000) >> 16) * f; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathEuler.h b/third_party/Imath/src/Imath/ImathEuler.h similarity index 73% rename from third_party/Imath-3.1.9/src/Imath/ImathEuler.h rename to third_party/Imath/src/Imath/ImathEuler.h index 985cce33..17543bb6 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathEuler.h +++ b/third_party/Imath/src/Imath/ImathEuler.h @@ -119,12 +119,11 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class IMATH_EXPORT_TEMPLATE_TYPE Euler : public Vec3 { - public: +public: using Vec3::x; using Vec3::y; using Vec3::z; - /// /// All 24 possible orderings /// @@ -160,15 +159,16 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Euler : public Vec3 // |||| // VVVV // ABCD - // Legend: + // Legend: // A -> Initial Axis (0==x, 1==y, 2==z) // B -> Parity Even (1==true) // C -> Initial Repeated (1==true) // D -> Frame Static (1==true) // - Legal = XYZ | XZY | YZX | YXZ | ZXY | ZYX | XZX | XYX | YXY | YZY | ZYZ | ZXZ | XYZr | - XZYr | YZXr | YXZr | ZXYr | ZYXr | XZXr | XYXr | YXYr | YZYr | ZYZr | ZXZr, + Legal = XYZ | XZY | YZX | YXZ | ZXY | ZYX | XZX | XYX | YXY | YZY | + ZYZ | ZXZ | XYZr | XZYr | YZXr | YXZr | ZXYr | ZYXr | XZXr | + XYXr | YXYr | YZYr | ZYZr | ZXZr, Min = 0x0000, Max = 0x2111, @@ -188,7 +188,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Euler : public Vec3 /// /// Layout /// - + enum IMATH_EXPORT_ENUM InputLayout { XYZLayout, @@ -208,7 +208,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Euler : public Vec3 /// function, defined in ImathMatrixAlgo.h. /// No initialization by default - IMATH_HOSTDEVICE constexpr Euler() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Euler () IMATH_NOEXCEPT; /// Copy constructor IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Euler (const Euler&) IMATH_NOEXCEPT; @@ -217,59 +217,75 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Euler : public Vec3 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Euler (Order p) IMATH_NOEXCEPT; /// Construct from vector, order, layout - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Euler (const Vec3& v, - Order o = Default, - InputLayout l = IJKLayout) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Euler ( + const Vec3& v, + Order o = Default, + InputLayout l = IJKLayout) IMATH_NOEXCEPT; /// Construct from explicit axes, order, layout IMATH_HOSTDEVICE IMATH_CONSTEXPR14 - Euler (T i, T j, T k, Order o = Default, InputLayout l = IJKLayout) IMATH_NOEXCEPT; + Euler (T i, T j, T k, Order o = Default, InputLayout l = IJKLayout) + IMATH_NOEXCEPT; /// Copy constructor with new Order - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Euler (const Euler& euler, Order newp) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Euler (const Euler& euler, Order newp) + IMATH_NOEXCEPT; /// Construct from Matrix33 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Euler (const Matrix33&, Order o = Default) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Euler (const Matrix33&, Order o = Default) IMATH_NOEXCEPT; /// Construct from Matrix44 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Euler (const Matrix44&, Order o = Default) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Euler (const Matrix44&, Order o = Default) IMATH_NOEXCEPT; /// Destructor ~Euler () = default; /// @} - + /// @{ /// @name Query - + /// Return whether the given value is a legal Order IMATH_HOSTDEVICE constexpr static bool legal (Order) IMATH_NOEXCEPT; /// Return the order - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Order order() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Order order () const IMATH_NOEXCEPT; /// Return frameStatic - IMATH_HOSTDEVICE constexpr bool frameStatic() const { return _frameStatic; } + IMATH_HOSTDEVICE constexpr bool frameStatic () const + { + return _frameStatic; + } /// Return intialRepeated - IMATH_HOSTDEVICE constexpr bool initialRepeated() const { return _initialRepeated; } + IMATH_HOSTDEVICE constexpr bool initialRepeated () const + { + return _initialRepeated; + } /// Return partityEven - IMATH_HOSTDEVICE constexpr bool parityEven() const { return _parityEven; } + IMATH_HOSTDEVICE constexpr bool parityEven () const { return _parityEven; } - /// Return initialAxis - IMATH_HOSTDEVICE constexpr Axis initialAxis() const { return _initialAxis; } + /// Return initialAxis + IMATH_HOSTDEVICE constexpr Axis initialAxis () const + { + return _initialAxis; + } /// Unpack angles from ijk form - IMATH_HOSTDEVICE void angleOrder (int& i, int& j, int& k) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + angleOrder (int& i, int& j, int& k) const IMATH_NOEXCEPT; /// Determine mapping from xyz to ijk (reshuffle the xyz to match the order) - IMATH_HOSTDEVICE void angleMapping (int& i, int& j, int& k) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + angleMapping (int& i, int& j, int& k) const IMATH_NOEXCEPT; /// @} /// @{ /// @name Set Value - + /// Set the order. This does NOT convert the angles, but it /// does reorder the input vector. IMATH_HOSTDEVICE void setOrder (Order) IMATH_NOEXCEPT; @@ -279,19 +295,23 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Euler : public Vec3 IMATH_HOSTDEVICE void setXYZVector (const Vec3&) IMATH_NOEXCEPT; /// Set the value. - IMATH_HOSTDEVICE void set (Axis initial, bool relative, bool parityEven, bool firstRepeats) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + set (Axis initial, bool relative, bool parityEven, bool firstRepeats) + IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Assignments and Conversions /// /// Assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Euler& operator= (const Euler&) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Euler& + operator= (const Euler&) IMATH_NOEXCEPT; /// Assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Euler& operator= (const Vec3&) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Euler& + operator= (const Vec3&) IMATH_NOEXCEPT; /// Assign from Matrix33, assumed to be affine IMATH_HOSTDEVICE void extract (const Matrix33&) IMATH_NOEXCEPT; @@ -303,21 +323,21 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Euler : public Vec3 IMATH_HOSTDEVICE void extract (const Quat&) IMATH_NOEXCEPT; /// Convert to Matrix33 - IMATH_HOSTDEVICE Matrix33 toMatrix33() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Matrix33 toMatrix33 () const IMATH_NOEXCEPT; /// Convert to Matrix44 - IMATH_HOSTDEVICE Matrix44 toMatrix44() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Matrix44 toMatrix44 () const IMATH_NOEXCEPT; /// Convert to Quat - IMATH_HOSTDEVICE Quat toQuat() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Quat toQuat () const IMATH_NOEXCEPT; /// Reorder the angles so that the X rotation comes first, /// followed by the Y and Z in cases like XYX ordering, the /// repeated angle will be in the "z" component - IMATH_HOSTDEVICE Vec3 toXYZVector() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Vec3 toXYZVector () const IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Utility Methods /// @@ -326,15 +346,19 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Euler : public Vec3 /// that is the intent). /// Convert an angle to its equivalent in [-PI, PI] - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 static float angleMod (T angle) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 static float + angleMod (T angle) IMATH_NOEXCEPT; /// Adjust xyzRot so that its components differ from targetXyzRot by no more than +/-PI - IMATH_HOSTDEVICE static void simpleXYZRotation (Vec3& xyzRot, const Vec3& targetXyzRot) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE static void simpleXYZRotation ( + Vec3& xyzRot, const Vec3& targetXyzRot) IMATH_NOEXCEPT; /// Adjust xyzRot so that its components differ from targetXyzRot by as little as possible. /// Note that xyz here really means ijk, because the order must be provided. - IMATH_HOSTDEVICE static void - nearestRotation (Vec3& xyzRot, const Vec3& targetXyzRot, Order order = XYZ) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE static void nearestRotation ( + Vec3& xyzRot, + const Vec3& targetXyzRot, + Order order = XYZ) IMATH_NOEXCEPT; /// Adjusts "this" Euler so that its components differ from target /// by as little as possible. This method might not make sense for @@ -344,23 +368,22 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Euler : public Vec3 /// @} - protected: - +protected: /// relative or static rotations - bool _frameStatic : 1; + bool _frameStatic : 1; /// init axis repeated as last - bool _initialRepeated : 1; + bool _initialRepeated : 1; /// "parity of axis permutation" - bool _parityEven : 1; + bool _parityEven : 1; #if defined _WIN32 || defined _WIN64 /// First axis of rotation - Axis _initialAxis; + Axis _initialAxis; #else /// First axis of rotation - Axis _initialAxis : 2; + Axis _initialAxis : 2; #endif }; @@ -415,7 +438,7 @@ Euler::setXYZVector (const Vec3& v) IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline Vec3 -Euler::toXYZVector() const IMATH_NOEXCEPT +Euler::toXYZVector () const IMATH_NOEXCEPT { int i, j, k; angleMapping (i, j, k); @@ -423,7 +446,7 @@ Euler::toXYZVector() const IMATH_NOEXCEPT } template -IMATH_HOSTDEVICE constexpr inline Euler::Euler() IMATH_NOEXCEPT +IMATH_HOSTDEVICE constexpr inline Euler::Euler () IMATH_NOEXCEPT : Vec3 (0, 0, 0), _frameStatic (true), _initialRepeated (false), @@ -432,20 +455,21 @@ IMATH_HOSTDEVICE constexpr inline Euler::Euler() IMATH_NOEXCEPT {} template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler (typename Euler::Order p) IMATH_NOEXCEPT - : Vec3 (0, 0, 0), - _frameStatic (true), - _initialRepeated (false), - _parityEven (true), - _initialAxis (X) +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler ( + typename Euler::Order p) IMATH_NOEXCEPT : Vec3 (0, 0, 0), + _frameStatic (true), + _initialRepeated (false), + _parityEven (true), + _initialAxis (X) { setOrder (p); } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler (const Vec3& v, - typename Euler::Order p, - typename Euler::InputLayout l) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler ( + const Vec3& v, + typename Euler::Order p, + typename Euler::InputLayout l) IMATH_NOEXCEPT { setOrder (p); if (l == XYZLayout) @@ -459,23 +483,28 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler (const Vec3& v, } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler (const Euler& euler) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler ( + const Euler& euler) IMATH_NOEXCEPT { operator= (euler); } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler (const Euler& euler, Order p) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler ( + const Euler& euler, Order p) IMATH_NOEXCEPT { setOrder (p); - Matrix33 M = euler.toMatrix33(); + Matrix33 M = euler.toMatrix33 (); extract (M); } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline -Euler::Euler (T xi, T yi, T zi, typename Euler::Order p, - typename Euler::InputLayout l) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler ( + T xi, + T yi, + T zi, + typename Euler::Order p, + typename Euler::InputLayout l) IMATH_NOEXCEPT { setOrder (p); if (l == XYZLayout) @@ -489,14 +518,16 @@ Euler::Euler (T xi, T yi, T zi, typename Euler::Order p, } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler (const Matrix33& M, typename Euler::Order p) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler ( + const Matrix33& M, typename Euler::Order p) IMATH_NOEXCEPT { setOrder (p); extract (M); } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler (const Matrix44& M, typename Euler::Order p) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Euler::Euler ( + const Matrix44& M, typename Euler::Order p) IMATH_NOEXCEPT { setOrder (p); extract (M); @@ -506,7 +537,7 @@ template IMATH_HOSTDEVICE inline void Euler::extract (const Quat& q) IMATH_NOEXCEPT { - extract (q.toMatrix33()); + extract (q.toMatrix33 ()); } template @@ -536,22 +567,23 @@ Euler::extract (const Matrix33& M) IMATH_NOEXCEPT Matrix44 N; N.rotate (r); - N = N * Matrix44 (M[0][0], - M[0][1], - M[0][2], - 0, - M[1][0], - M[1][1], - M[1][2], - 0, - M[2][0], - M[2][1], - M[2][2], - 0, - 0, - 0, - 0, - 1); + N = N * Matrix44 ( + M[0][0], + M[0][1], + M[0][2], + 0, + M[1][0], + M[1][1], + M[1][2], + 0, + M[2][0], + M[2][1], + M[2][2], + 0, + 0, + 0, + 0, + 1); // // Extract the other two angles, y and z, from N. // @@ -580,22 +612,23 @@ Euler::extract (const Matrix33& M) IMATH_NOEXCEPT Matrix44 N; N.rotate (r); - N = N * Matrix44 (M[0][0], - M[0][1], - M[0][2], - 0, - M[1][0], - M[1][1], - M[1][2], - 0, - M[2][0], - M[2][1], - M[2][2], - 0, - 0, - 0, - 0, - 1); + N = N * Matrix44 ( + M[0][0], + M[0][1], + M[0][2], + 0, + M[1][0], + M[1][1], + M[1][2], + 0, + M[2][0], + M[2][1], + M[2][2], + 0, + 0, + 0, + 0, + 1); // // Extract the other two angles, y and z, from N. // @@ -605,8 +638,7 @@ Euler::extract (const Matrix33& M) IMATH_NOEXCEPT z = std::atan2 (-N[j][i], N[j][j]); } - if (!_parityEven) - *this *= -1; + if (!_parityEven) *this *= -1; if (!_frameStatic) { @@ -682,8 +714,7 @@ Euler::extract (const Matrix44& M) IMATH_NOEXCEPT z = std::atan2 (-N[j][i], N[j][j]); } - if (!_parityEven) - *this *= -1; + if (!_parityEven) *this *= -1; if (!_frameStatic) { @@ -695,7 +726,7 @@ Euler::extract (const Matrix44& M) IMATH_NOEXCEPT template IMATH_HOSTDEVICE Matrix33 -Euler::toMatrix33() const IMATH_NOEXCEPT + Euler::toMatrix33 () const IMATH_NOEXCEPT { int i, j, k; angleOrder (i, j, k); @@ -707,8 +738,7 @@ Euler::toMatrix33() const IMATH_NOEXCEPT else angles = Vec3 (z, y, x); - if (!_parityEven) - angles *= -1.0; + if (!_parityEven) angles *= -1.0; T ci = std::cos (angles.x); T cj = std::cos (angles.y); @@ -754,7 +784,7 @@ Euler::toMatrix33() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE Matrix44 -Euler::toMatrix44() const IMATH_NOEXCEPT + Euler::toMatrix44 () const IMATH_NOEXCEPT { int i, j, k; angleOrder (i, j, k); @@ -766,8 +796,7 @@ Euler::toMatrix44() const IMATH_NOEXCEPT else angles = Vec3 (z, y, x); - if (!_parityEven) - angles *= -1.0; + if (!_parityEven) angles *= -1.0; T ci = std::cos (angles.x); T cj = std::cos (angles.y); @@ -813,10 +842,10 @@ Euler::toMatrix44() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE Quat -Euler::toQuat() const IMATH_NOEXCEPT + Euler::toQuat () const IMATH_NOEXCEPT { Vec3 angles; - int i, j, k; + int i, j, k; angleOrder (i, j, k); if (_frameStatic) @@ -824,8 +853,7 @@ Euler::toQuat() const IMATH_NOEXCEPT else angles = Vec3 (z, y, x); - if (!_parityEven) - angles.y = -angles.y; + if (!_parityEven) angles.y = -angles.y; T ti = angles.x * 0.5; T tj = angles.y * 0.5; @@ -848,15 +876,17 @@ Euler::toQuat() const IMATH_NOEXCEPT if (_initialRepeated) { - a[i] = cj * (cs + sc); - a[j] = sj * (cc + ss) * parity, // NOSONAR - suppress SonarCloud bug report. + a[i] = cj * (cs + sc); + a[j] = sj * (cc + ss) * + parity, // NOSONAR - suppress SonarCloud bug report. a[k] = sj * (cs - sc); q.r = cj * (cc - ss); } else { - a[i] = cj * sc - sj * cs, - a[j] = (cj * ss + sj * cc) * parity, // NOSONAR - suppress SonarCloud bug report. + a[i] = cj * sc - sj * cs, + a[j] = (cj * ss + sj * cc) * + parity, // NOSONAR - suppress SonarCloud bug report. a[k] = cj * cs - sj * sc; q.r = cj * cc + sj * ss; } @@ -875,16 +905,13 @@ Euler::legal (typename Euler::Order order) IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 typename Euler::Order -Euler::order() const IMATH_NOEXCEPT + Euler::order () const IMATH_NOEXCEPT { int foo = (_initialAxis == Z ? 0x2000 : (_initialAxis == Y ? 0x1000 : 0)); - if (_parityEven) - foo |= 0x0100; - if (_initialRepeated) - foo |= 0x0010; - if (_frameStatic) - foo++; + if (_parityEven) foo |= 0x0100; + if (_initialRepeated) foo |= 0x0010; + if (_frameStatic) foo++; return (Order) foo; } @@ -893,15 +920,20 @@ template IMATH_HOSTDEVICE inline void Euler::setOrder (typename Euler::Order p) IMATH_NOEXCEPT { - set (p & 0x2000 ? Z : (p & 0x1000 ? Y : X), // initial axis - !(p & 0x1), // static? - !!(p & 0x100), // permutation even? - !!(p & 0x10)); // initial repeats? + set ( + p & 0x2000 ? Z : (p & 0x1000 ? Y : X), // initial axis + !(p & 0x1), // static? + !!(p & 0x100), // permutation even? + !!(p & 0x10)); // initial repeats? } template IMATH_HOSTDEVICE inline void -Euler::set (typename Euler::Axis axis, bool relative, bool parityEven, bool firstRepeats) IMATH_NOEXCEPT +Euler::set ( + typename Euler::Axis axis, + bool relative, + bool parityEven, + bool firstRepeats) IMATH_NOEXCEPT { _initialAxis = axis; _frameStatic = !relative; @@ -940,17 +972,16 @@ Euler::angleMod (T angle) IMATH_NOEXCEPT const T pi = static_cast (M_PI); angle = fmod (T (angle), T (2 * pi)); - if (angle < -pi) - angle += 2 * pi; - if (angle > +pi) - angle -= 2 * pi; + if (angle < -pi) angle += 2 * pi; + if (angle > +pi) angle -= 2 * pi; return angle; } template IMATH_HOSTDEVICE inline void -Euler::simpleXYZRotation (Vec3& xyzRot, const Vec3& targetXyzRot) IMATH_NOEXCEPT +Euler::simpleXYZRotation (Vec3& xyzRot, const Vec3& targetXyzRot) + IMATH_NOEXCEPT { Vec3 d = xyzRot - targetXyzRot; xyzRot[0] = targetXyzRot[0] + angleMod (d[0]); @@ -960,9 +991,10 @@ Euler::simpleXYZRotation (Vec3& xyzRot, const Vec3& targetXyzRot) IMATH template IMATH_HOSTDEVICE void -Euler::nearestRotation (Vec3& xyzRot, const Vec3& targetXyzRot, Order order) IMATH_NOEXCEPT +Euler::nearestRotation ( + Vec3& xyzRot, const Vec3& targetXyzRot, Order order) IMATH_NOEXCEPT { - int i, j, k; + int i, j, k; Euler e (0, 0, 0, order); e.angleOrder (i, j, k); @@ -975,34 +1007,31 @@ Euler::nearestRotation (Vec3& xyzRot, const Vec3& targetXyzRot, Order o simpleXYZRotation (otherXyzRot, targetXyzRot); - Vec3 d = xyzRot - targetXyzRot; - Vec3 od = otherXyzRot - targetXyzRot; - T dMag = d.dot (d); - T odMag = od.dot (od); + Vec3 d = xyzRot - targetXyzRot; + Vec3 od = otherXyzRot - targetXyzRot; + T dMag = d.dot (d); + T odMag = od.dot (od); - if (odMag < dMag) - { - xyzRot = otherXyzRot; - } + if (odMag < dMag) { xyzRot = otherXyzRot; } } template IMATH_HOSTDEVICE void Euler::makeNear (const Euler& target) IMATH_NOEXCEPT { - Vec3 xyzRot = toXYZVector(); + Vec3 xyzRot = toXYZVector (); Vec3 targetXyz; - if (order() != target.order()) + if (order () != target.order ()) { - Euler targetSameOrder = Euler (target, order()); - targetXyz = targetSameOrder.toXYZVector(); + Euler targetSameOrder = Euler (target, order ()); + targetXyz = targetSameOrder.toXYZVector (); } else { - targetXyz = target.toXYZVector(); + targetXyz = target.toXYZVector (); } - nearestRotation (xyzRot, targetXyz, order()); + nearestRotation (xyzRot, targetXyz, order ()); setXYZVector (xyzRot); } @@ -1014,24 +1043,22 @@ template std::ostream& operator<< (std::ostream& o, const Euler& euler) { - char a[3] = { 'X', 'Y', 'Z' }; + char a[3] = {'X', 'Y', 'Z'}; - const char* r = euler.frameStatic() ? "" : "r"; - int i, j, k; + const char* r = euler.frameStatic () ? "" : "r"; + int i, j, k; euler.angleOrder (i, j, k); - if (euler.initialRepeated()) - k = i; + if (euler.initialRepeated ()) k = i; - return o << "(" << euler.x << " " << euler.y << " " << euler.z << " " << a[i] << a[j] << a[k] - << r << ")"; + return o << "(" << euler.x << " " << euler.y << " " << euler.z << " " + << a[i] << a[j] << a[k] << r << ")"; } #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER # pragma warning(pop) #endif - IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHEULER_H diff --git a/third_party/Imath-3.1.9/src/Imath/ImathExport.h b/third_party/Imath/src/Imath/ImathExport.h similarity index 50% rename from third_party/Imath-3.1.9/src/Imath/ImathExport.h rename to third_party/Imath/src/Imath/ImathExport.h index 8e7bb6aa..846eb65c 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathExport.h +++ b/third_party/Imath/src/Imath/ImathExport.h @@ -18,7 +18,7 @@ /// Imath only needs a couple of the possible macros outlined in the /// above document, and due to it largely being inline only, does not /// have much to do. -/// +/// /// @{ #if defined(IMATH_DLL) @@ -28,38 +28,39 @@ // has some weirdness with DLLs and extern const, so we have to // provide a macro to handle that. -# if defined(IMATH_EXPORTS) -# define IMATH_EXPORT __declspec(dllexport) -# define IMATH_EXPORT_CONST extern __declspec(dllexport) -# else -# define IMATH_EXPORT __declspec(dllimport) -# define IMATH_EXPORT_CONST extern __declspec(dllimport) -# endif +# if defined(IMATH_EXPORTS) +# define IMATH_EXPORT __declspec(dllexport) +# define IMATH_EXPORT_CONST extern __declspec(dllexport) +# else +# define IMATH_EXPORT __declspec(dllimport) +# define IMATH_EXPORT_CONST extern __declspec(dllimport) +# endif // DLLs don't support these types of visibility controls, just leave them as empty -# define IMATH_EXPORT_TYPE -# define IMATH_EXPORT_ENUM -# define IMATH_EXPORT_TEMPLATE_TYPE +# define IMATH_EXPORT_TYPE +# define IMATH_EXPORT_ENUM +# define IMATH_EXPORT_TEMPLATE_TYPE #else -# ifdef IMATH_PUBLIC_SYMBOL_ATTRIBUTE -# define IMATH_EXPORT IMATH_PUBLIC_SYMBOL_ATTRIBUTE -# define IMATH_EXPORT_CONST extern const IMATH_PUBLIC_SYMBOL_ATTRIBUTE -# else -# define IMATH_EXPORT -# define IMATH_EXPORT_CONST extern const -# endif +# ifdef IMATH_PUBLIC_SYMBOL_ATTRIBUTE +# define IMATH_EXPORT IMATH_PUBLIC_SYMBOL_ATTRIBUTE +# define IMATH_EXPORT_CONST extern const IMATH_PUBLIC_SYMBOL_ATTRIBUTE +# else +# define IMATH_EXPORT +# define IMATH_EXPORT_CONST extern const +# endif -# ifdef IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE -# define IMATH_EXPORT_ENUM IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE -# define IMATH_EXPORT_TEMPLATE_TYPE IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE -# define IMATH_EXPORT_TYPE IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE -# else -# define IMATH_EXPORT_ENUM -# define IMATH_EXPORT_TEMPLATE_TYPE IMATH_EXPORT -# define IMATH_EXPORT_TYPE IMATH_EXPORT -# endif +# ifdef IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE +# define IMATH_EXPORT_ENUM IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE +# define IMATH_EXPORT_TEMPLATE_TYPE \ + IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE +# define IMATH_EXPORT_TYPE IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE +# else +# define IMATH_EXPORT_ENUM +# define IMATH_EXPORT_TEMPLATE_TYPE IMATH_EXPORT +# define IMATH_EXPORT_TYPE IMATH_EXPORT +# endif #endif // IMATH_DLL diff --git a/third_party/Imath-3.1.9/src/Imath/ImathForward.h b/third_party/Imath/src/Imath/ImathForward.h similarity index 100% rename from third_party/Imath-3.1.9/src/Imath/ImathForward.h rename to third_party/Imath/src/Imath/ImathForward.h index 87416521..2ba9e7fc 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathForward.h +++ b/third_party/Imath/src/Imath/ImathForward.h @@ -6,8 +6,8 @@ #ifndef INCLUDED_IMATHFORWARD_H #define INCLUDED_IMATHFORWARD_H -#include "ImathNamespace.h" #include "ImathExport.h" +#include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER diff --git a/third_party/Imath-3.1.9/src/Imath/ImathFrame.h b/third_party/Imath/src/Imath/ImathFrame.h similarity index 66% rename from third_party/Imath-3.1.9/src/Imath/ImathFrame.h rename to third_party/Imath/src/Imath/ImathFrame.h index 4d547fc5..05e7bd70 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathFrame.h +++ b/third_party/Imath/src/Imath/ImathFrame.h @@ -39,23 +39,25 @@ template class Matrix44; /// /// See Graphics Gems I for the underlying algorithm. - template -Matrix44 constexpr firstFrame (const Vec3&, // First point - const Vec3&, // Second point - const Vec3&) IMATH_NOEXCEPT; // Third point +Matrix44 constexpr firstFrame ( + const Vec3&, // First point + const Vec3&, // Second point + const Vec3&) IMATH_NOEXCEPT; // Third point template -Matrix44 constexpr nextFrame (const Matrix44&, // Previous matrix - const Vec3&, // Previous point - const Vec3&, // Current point - Vec3&, // Previous tangent - Vec3&) IMATH_NOEXCEPT; // Current tangent +Matrix44 constexpr nextFrame ( + const Matrix44&, // Previous matrix + const Vec3&, // Previous point + const Vec3&, // Current point + Vec3&, // Previous tangent + Vec3&) IMATH_NOEXCEPT; // Current tangent template -Matrix44 constexpr lastFrame (const Matrix44&, // Previous matrix - const Vec3&, // Previous point - const Vec3&) IMATH_NOEXCEPT; // Last point +Matrix44 constexpr lastFrame ( + const Matrix44&, // Previous matrix + const Vec3&, // Previous point + const Vec3&) IMATH_NOEXCEPT; // Last point /// /// Compute the first reference frame along a curve. @@ -73,27 +75,27 @@ Matrix44 constexpr lastFrame (const Matrix44&, // Previous matrix /// Second point /// @param pk /// Third point -/// +/// template -Matrix44 constexpr firstFrame (const Vec3& pi, // first point - const Vec3& pj, // secont point - const Vec3& pk) IMATH_NOEXCEPT // third point +Matrix44 constexpr firstFrame ( + const Vec3& pi, // first point + const Vec3& pj, // secont point + const Vec3& pk) IMATH_NOEXCEPT // third point { Vec3 t = pj - pi; - t.normalizeExc(); + t.normalizeExc (); Vec3 n = t.cross (pk - pi); - n.normalize(); - if (n.length() == 0.0f) + n.normalize (); + if (n.length () == 0.0f) { int i = fabs (t[0]) < fabs (t[1]) ? 0 : 1; - if (fabs (t[2]) < fabs (t[i])) - i = 2; + if (fabs (t[2]) < fabs (t[i])) i = 2; Vec3 v (0.0, 0.0, 0.0); v[i] = 1.0; n = t.cross (v); - n.normalize(); + n.normalize (); } Vec3 b = t.cross (n); @@ -136,19 +138,20 @@ Matrix44 constexpr firstFrame (const Vec3& pi, // first point /// The current tangent vector template -Matrix44 constexpr nextFrame (const Matrix44& Mi, // Previous matrix - const Vec3& pi, // Previous point - const Vec3& pj, // Current point - Vec3& ti, // Previous tangent vector - Vec3& tj) IMATH_NOEXCEPT // Current tangent vector +Matrix44 constexpr nextFrame ( + const Matrix44& Mi, // Previous matrix + const Vec3& pi, // Previous point + const Vec3& pj, // Current point + Vec3& ti, // Previous tangent vector + Vec3& tj) IMATH_NOEXCEPT // Current tangent vector { Vec3 a (0.0, 0.0, 0.0); /// Rotation axis. - T r = 0.0; // Rotation angle. + T r = 0.0; // Rotation angle. - if (ti.length() != 0.0 && tj.length() != 0.0) + if (ti.length () != 0.0 && tj.length () != 0.0) { - ti.normalize(); - tj.normalize(); + ti.normalize (); + tj.normalize (); T dot = ti.dot (tj); // @@ -164,7 +167,7 @@ Matrix44 constexpr nextFrame (const Matrix44& Mi, // Previous matrix a = ti.cross (tj); } - if (a.length() != 0.0 && r != 0.0) + if (a.length () != 0.0 && r != 0.0) { Matrix44 R; R.setAxisAngle (a, r); @@ -199,9 +202,10 @@ Matrix44 constexpr nextFrame (const Matrix44& Mi, // Previous matrix /// The last point template -Matrix44 constexpr lastFrame (const Matrix44& Mi, // Previous matrix - const Vec3& pi, // Previous point - const Vec3& pj) IMATH_NOEXCEPT // Last point +Matrix44 constexpr lastFrame ( + const Matrix44& Mi, // Previous matrix + const Vec3& pi, // Previous point + const Vec3& pj) IMATH_NOEXCEPT // Last point { Matrix44 Tr; Tr.translate (pj - pi); diff --git a/third_party/Imath-3.1.9/src/Imath/ImathFrustum.h b/third_party/Imath/src/Imath/ImathFrustum.h similarity index 70% rename from third_party/Imath-3.1.9/src/Imath/ImathFrustum.h rename to third_party/Imath/src/Imath/ImathFrustum.h index a5daf0e2..90337467 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathFrustum.h +++ b/third_party/Imath/src/Imath/ImathFrustum.h @@ -38,31 +38,38 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class IMATH_EXPORT_TEMPLATE_TYPE Frustum { - public: - +public: /// @{ /// @name Constructors and Assignment /// /// Initialize with default values: /// near=0.1, far=1000.0, left=-1.0, right=1.0, top=1.0, bottom=-1.0, ortho=false - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Frustum() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Frustum () IMATH_NOEXCEPT; /// Copy constructor IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Frustum (const Frustum&) IMATH_NOEXCEPT; /// Initialize to specific values + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Frustum ( + T nearPlane, + T farPlane, + T left, + T right, + T top, + T bottom, + bool ortho = false) IMATH_NOEXCEPT; + + /// Initialize with fov and aspect IMATH_HOSTDEVICE IMATH_CONSTEXPR14 - Frustum (T nearPlane, T farPlane, T left, T right, T top, T bottom, bool ortho = false) IMATH_NOEXCEPT; - - /// Initialize with fov and aspect - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Frustum (T nearPlane, T farPlane, T fovx, T fovy, T aspect) IMATH_NOEXCEPT; + Frustum (T nearPlane, T farPlane, T fovx, T fovy, T aspect) IMATH_NOEXCEPT; /// Destructor - virtual ~Frustum() IMATH_NOEXCEPT; + virtual ~Frustum () IMATH_NOEXCEPT; /// Component-wise assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Frustum& operator= (const Frustum&) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Frustum& + operator= (const Frustum&) IMATH_NOEXCEPT; /// @} @@ -70,78 +77,109 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Frustum /// @name Comparison /// Equality - IMATH_HOSTDEVICE constexpr bool operator== (const Frustum& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator== (const Frustum& src) const IMATH_NOEXCEPT; /// Inequality - IMATH_HOSTDEVICE constexpr bool operator!= (const Frustum& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator!= (const Frustum& src) const IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Query - + /// Return true if the frustum is orthographic, false if perspective - IMATH_HOSTDEVICE constexpr bool orthographic() const IMATH_NOEXCEPT { return _orthographic; } + IMATH_HOSTDEVICE constexpr bool orthographic () const IMATH_NOEXCEPT + { + return _orthographic; + } /// Return the near clipping plane - IMATH_HOSTDEVICE constexpr T nearPlane() const IMATH_NOEXCEPT { return _nearPlane; } + IMATH_HOSTDEVICE constexpr T nearPlane () const IMATH_NOEXCEPT + { + return _nearPlane; + } /// Return the near clipping plane - IMATH_HOSTDEVICE constexpr T hither() const IMATH_NOEXCEPT { return _nearPlane; } + IMATH_HOSTDEVICE constexpr T hither () const IMATH_NOEXCEPT + { + return _nearPlane; + } /// Return the far clipping plane - IMATH_HOSTDEVICE constexpr T farPlane() const IMATH_NOEXCEPT { return _farPlane; } + IMATH_HOSTDEVICE constexpr T farPlane () const IMATH_NOEXCEPT + { + return _farPlane; + } /// Return the far clipping plane - IMATH_HOSTDEVICE constexpr T yon() const IMATH_NOEXCEPT { return _farPlane; } + IMATH_HOSTDEVICE constexpr T yon () const IMATH_NOEXCEPT + { + return _farPlane; + } /// Return the left of the frustum - IMATH_HOSTDEVICE constexpr T left() const IMATH_NOEXCEPT { return _left; } + IMATH_HOSTDEVICE constexpr T left () const IMATH_NOEXCEPT { return _left; } /// Return the right of the frustum - IMATH_HOSTDEVICE constexpr T right() const IMATH_NOEXCEPT { return _right; } + IMATH_HOSTDEVICE constexpr T right () const IMATH_NOEXCEPT + { + return _right; + } /// Return the bottom of the frustum - IMATH_HOSTDEVICE constexpr T bottom() const IMATH_NOEXCEPT { return _bottom; } + IMATH_HOSTDEVICE constexpr T bottom () const IMATH_NOEXCEPT + { + return _bottom; + } /// Return the top of the frustum - IMATH_HOSTDEVICE constexpr T top() const IMATH_NOEXCEPT { return _top; } + IMATH_HOSTDEVICE constexpr T top () const IMATH_NOEXCEPT { return _top; } /// Return the field of view in X - IMATH_HOSTDEVICE constexpr T fovx() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T fovx () const IMATH_NOEXCEPT; /// Return the field of view in Y - IMATH_HOSTDEVICE constexpr T fovy() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T fovy () const IMATH_NOEXCEPT; /// Return the aspect ratio - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T aspect() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T aspect () const IMATH_NOEXCEPT; /// Return the aspect ratio. Throw an exception if the aspect /// ratio is undefined. - IMATH_CONSTEXPR14 T aspectExc() const; + IMATH_CONSTEXPR14 T aspectExc () const; /// Return the project matrix that the frustum defines - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 projectionMatrix() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 + projectionMatrix () const IMATH_NOEXCEPT; /// Return the project matrix that the frustum defines. Throw an /// exception if the frustum is degenerate. - IMATH_CONSTEXPR14 Matrix44 projectionMatrixExc() const; + IMATH_CONSTEXPR14 Matrix44 projectionMatrixExc () const; /// Return true if the frustum is degenerate. - IMATH_HOSTDEVICE constexpr bool degenerate() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool degenerate () const IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Set Value - + /// Set functions change the entire state of the Frustum - IMATH_HOSTDEVICE void - set (T nearPlane, T farPlane, T left, T right, T top, T bottom, bool ortho = false) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void set ( + T nearPlane, + T farPlane, + T left, + T right, + T top, + T bottom, + bool ortho = false) IMATH_NOEXCEPT; /// Set functions change the entire state of the Frustum using /// field of view and aspect ratio - IMATH_HOSTDEVICE void set (T nearPlane, T farPlane, T fovx, T fovy, T aspect) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + set (T nearPlane, T farPlane, T fovx, T fovy, T aspect) IMATH_NOEXCEPT; /// Set functions change the entire state of the Frustum using /// field of view and aspect ratio. Throw an exception if `fovx` @@ -149,7 +187,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Frustum void setExc (T nearPlane, T farPlane, T fovx, T fovy, T aspect); /// Set the near and far clipping planes - IMATH_HOSTDEVICE void modifyNearAndFar (T nearPlane, T farPlane) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + modifyNearAndFar (T nearPlane, T farPlane) IMATH_NOEXCEPT; /// Set the ortographic state IMATH_HOSTDEVICE void setOrthographic (bool) IMATH_NOEXCEPT; @@ -164,7 +203,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Frustum /// near, far. Note that the planes have normals that point out /// of the frustum. Apply the given matrix to transform the /// frustum before setting the planes. - IMATH_HOSTDEVICE void planes (Plane3 p[6], const Matrix44& M) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + planes (Plane3 p[6], const Matrix44& M) const IMATH_NOEXCEPT; /// Takes a rectangle in the screen space (i.e., -1 <= left <= right <= 1 /// and -1 <= bottom <= top <= 1) of this Frustum, and returns a new @@ -177,26 +217,28 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Frustum /// @{ /// @name Utility Methods - + /// Project a point in screen spaced to 3d ray - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Line3 projectScreenToRay (const Vec2&) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Line3 + projectScreenToRay (const Vec2&) const IMATH_NOEXCEPT; /// Project a 3D point into screen coordinates - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec2 projectPointToScreen (const Vec3&) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec2 + projectPointToScreen (const Vec3&) const IMATH_NOEXCEPT; /// Project a 3D point into screen coordinates. Throw an /// exception if the point cannot be projected. IMATH_CONSTEXPR14 Vec2 projectPointToScreenExc (const Vec3&) const; /// Map a z value to its depth in the frustum. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T ZToDepth (long zval, - long min, - long max) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T + ZToDepth (long zval, long min, long max) const IMATH_NOEXCEPT; /// Map a z value to its depth in the frustum. IMATH_CONSTEXPR14 T ZToDepthExc (long zval, long min, long max) const; /// Map a normalized z value to its depth in the frustum. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T normalizedZToDepth (T zval) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T + normalizedZToDepth (T zval) const IMATH_NOEXCEPT; /// Map a normalized z value to its depth in the frustum. Throw an /// exception on error. @@ -210,23 +252,25 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Frustum IMATH_CONSTEXPR14 long DepthToZExc (T depth, long zmin, long zmax) const; /// Compute worldRadius - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T worldRadius (const Vec3& p, T radius) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T + worldRadius (const Vec3& p, T radius) const IMATH_NOEXCEPT; /// Compute worldRadius. Throw an exception on error. IMATH_CONSTEXPR14 T worldRadiusExc (const Vec3& p, T radius) const; /// Compute screen radius - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T screenRadius (const Vec3& p, T radius) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T + screenRadius (const Vec3& p, T radius) const IMATH_NOEXCEPT; /// Compute screen radius. Throw an exception on error. IMATH_CONSTEXPR14 T screenRadiusExc (const Vec3& p, T radius) const; /// @} - - protected: +protected: /// Map point from screen space to local space - IMATH_HOSTDEVICE constexpr Vec2 screenToLocal (const Vec2&) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec2 + screenToLocal (const Vec2&) const IMATH_NOEXCEPT; /// Map point from local space to screen space IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec2 @@ -236,44 +280,47 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Frustum /// on error. IMATH_CONSTEXPR14 Vec2 localToScreenExc (const Vec2&) const; - protected: - +protected: /// @cond Doxygen_Suppress - T _nearPlane; - T _farPlane; - T _left; - T _right; - T _top; - T _bottom; + T _nearPlane; + T _farPlane; + T _left; + T _right; + T _top; + T _bottom; bool _orthographic; /// @endcond }; -template IMATH_CONSTEXPR14 inline Frustum::Frustum() IMATH_NOEXCEPT +template +IMATH_CONSTEXPR14 inline Frustum::Frustum () IMATH_NOEXCEPT { set (T (0.1), T (1000.0), T (-1.0), T (1.0), T (1.0), T (-1.0), false); } -template IMATH_CONSTEXPR14 inline Frustum::Frustum (const Frustum& f) IMATH_NOEXCEPT +template +IMATH_CONSTEXPR14 inline Frustum::Frustum (const Frustum& f) IMATH_NOEXCEPT { *this = f; } template -IMATH_CONSTEXPR14 inline Frustum::Frustum (T n, T f, T l, T r, T t, T b, bool o) IMATH_NOEXCEPT +IMATH_CONSTEXPR14 inline Frustum::Frustum ( + T n, T f, T l, T r, T t, T b, bool o) IMATH_NOEXCEPT { set (n, f, l, r, t, b, o); } template -IMATH_CONSTEXPR14 inline Frustum::Frustum (T nearPlane, T farPlane, T fovx, T fovy, T aspect) IMATH_NOEXCEPT +IMATH_CONSTEXPR14 inline Frustum::Frustum ( + T nearPlane, T farPlane, T fovx, T fovy, T aspect) IMATH_NOEXCEPT { set (nearPlane, farPlane, fovx, fovy, aspect); } -template Frustum::~Frustum() IMATH_NOEXCEPT +template Frustum::~Frustum () IMATH_NOEXCEPT {} template @@ -295,9 +342,9 @@ template constexpr inline bool Frustum::operator== (const Frustum& src) const IMATH_NOEXCEPT { - return _nearPlane == src._nearPlane && _farPlane == src._farPlane && _left == src._left && - _right == src._right && _top == src._top && _bottom == src._bottom && - _orthographic == src._orthographic; + return _nearPlane == src._nearPlane && _farPlane == src._farPlane && + _left == src._left && _right == src._right && _top == src._top && + _bottom == src._bottom && _orthographic == src._orthographic; } template @@ -324,14 +371,13 @@ template inline void Frustum::modifyNearAndFar (T n, T f) IMATH_NOEXCEPT { - if (_orthographic) - { - _nearPlane = n; - } + if (_orthographic) { _nearPlane = n; } else { - Line3 lowerLeft (Vec3 (0, 0, 0), Vec3 (_left, _bottom, -_nearPlane)); - Line3 upperRight (Vec3 (0, 0, 0), Vec3 (_right, _top, -_nearPlane)); + Line3 lowerLeft ( + Vec3 (0, 0, 0), Vec3 (_left, _bottom, -_nearPlane)); + Line3 upperRight ( + Vec3 (0, 0, 0), Vec3 (_right, _top, -_nearPlane)); Plane3 nearPlane (Vec3 (0, 0, -1), n); Vec3 ll = Vec3 (0, 0, 0); @@ -387,7 +433,8 @@ Frustum::setExc (T nearPlane, T farPlane, T fovx, T fovy, T aspect) template inline void -Frustum::set (T nearPlane, T farPlane, T fovx, T fovy, T aspect) IMATH_NOEXCEPT +Frustum::set (T nearPlane, T farPlane, T fovx, T fovy, T aspect) + IMATH_NOEXCEPT { const T two = static_cast (2); @@ -412,26 +459,28 @@ Frustum::set (T nearPlane, T farPlane, T fovx, T fovy, T aspect) IMATH_NOEXCE template constexpr inline T -Frustum::fovx() const IMATH_NOEXCEPT +Frustum::fovx () const IMATH_NOEXCEPT { return std::atan2 (_right, _nearPlane) - std::atan2 (_left, _nearPlane); } template constexpr inline T -Frustum::fovy() const IMATH_NOEXCEPT +Frustum::fovy () const IMATH_NOEXCEPT { return std::atan2 (_top, _nearPlane) - std::atan2 (_bottom, _nearPlane); } template IMATH_CONSTEXPR14 inline T -Frustum::aspectExc() const +Frustum::aspectExc () const { T rightMinusLeft = _right - _left; T topMinusBottom = _top - _bottom; - if (abs (topMinusBottom) < T (1) && abs (rightMinusLeft) > std::numeric_limits::max() * abs (topMinusBottom)) + if (abs (topMinusBottom) < T (1) && + abs (rightMinusLeft) > + std::numeric_limits::max () * abs (topMinusBottom)) { throw std::domain_error ("Bad viewing frustum: " "aspect ratio cannot be computed."); @@ -442,7 +491,7 @@ Frustum::aspectExc() const template IMATH_CONSTEXPR14 inline T -Frustum::aspect() const IMATH_NOEXCEPT +Frustum::aspect () const IMATH_NOEXCEPT { T rightMinusLeft = _right - _left; T topMinusBottom = _top - _bottom; @@ -451,7 +500,7 @@ Frustum::aspect() const IMATH_NOEXCEPT template IMATH_CONSTEXPR14 inline Matrix44 -Frustum::projectionMatrixExc() const +Frustum::projectionMatrixExc () const { T rightPlusLeft = _right + _left; T rightMinusLeft = _right - _left; @@ -463,10 +512,14 @@ Frustum::projectionMatrixExc() const T farMinusNear = _farPlane - _nearPlane; if ((abs (rightMinusLeft) < T (1) && - abs (rightPlusLeft) > std::numeric_limits::max() * abs (rightMinusLeft)) || + abs (rightPlusLeft) > + std::numeric_limits::max () * abs (rightMinusLeft)) || (abs (topMinusBottom) < T (1) && - abs (topPlusBottom) > std::numeric_limits::max() * abs (topMinusBottom)) || - (abs (farMinusNear) < 1 && abs (farPlusNear) > std::numeric_limits::max() * abs (farMinusNear))) + abs (topPlusBottom) > + std::numeric_limits::max () * abs (topMinusBottom)) || + (abs (farMinusNear) < 1 && + abs (farPlusNear) > + std::numeric_limits::max () * abs (farMinusNear))) { throw std::domain_error ("Bad viewing frustum: " "projection matrix cannot be computed."); @@ -478,9 +531,12 @@ Frustum::projectionMatrixExc() const T ty = -topPlusBottom / topMinusBottom; T tz = -farPlusNear / farMinusNear; - if ((abs (rightMinusLeft) < T (1) && T (2) > std::numeric_limits::max() * abs (rightMinusLeft)) || - (abs (topMinusBottom) < T (1) && T (2) > std::numeric_limits::max() * abs (topMinusBottom)) || - (abs (farMinusNear) < T (1) && T (2) > std::numeric_limits::max() * abs (farMinusNear))) + if ((abs (rightMinusLeft) < T (1) && + T (2) > std::numeric_limits::max () * abs (rightMinusLeft)) || + (abs (topMinusBottom) < T (1) && + T (2) > std::numeric_limits::max () * abs (topMinusBottom)) || + (abs (farMinusNear) < T (1) && + T (2) > std::numeric_limits::max () * abs (farMinusNear))) { throw std::domain_error ("Bad viewing frustum: " "projection matrix cannot be computed."); @@ -490,7 +546,8 @@ Frustum::projectionMatrixExc() const T B = T (2) / topMinusBottom; T C = T (-2) / farMinusNear; - return Matrix44 (A, 0, 0, 0, 0, B, 0, 0, 0, 0, C, 0, tx, ty, tz, 1.f); + return Matrix44 ( + A, 0, 0, 0, 0, B, 0, 0, 0, 0, C, 0, tx, ty, tz, 1.f); } else { @@ -499,8 +556,11 @@ Frustum::projectionMatrixExc() const T C = -farPlusNear / farMinusNear; T farTimesNear = T (-2) * _farPlane * _nearPlane; - if (abs (farMinusNear) < T (1) && abs (farTimesNear) > std::numeric_limits::max() * abs (farMinusNear)) + if (abs (farMinusNear) < T (1) && + abs (farTimesNear) > + std::numeric_limits::max () * abs (farMinusNear)) { + // impossible condition: already tested above throw std::domain_error ("Bad viewing frustum: " "projection matrix cannot be computed."); } @@ -510,10 +570,13 @@ Frustum::projectionMatrixExc() const T twoTimesNear = T (2) * _nearPlane; if ((abs (rightMinusLeft) < T (1) && - abs (twoTimesNear) > std::numeric_limits::max() * abs (rightMinusLeft)) || + abs (twoTimesNear) > + std::numeric_limits::max () * abs (rightMinusLeft)) || (abs (topMinusBottom) < T (1) && - abs (twoTimesNear) > std::numeric_limits::max() * abs (topMinusBottom))) + abs (twoTimesNear) > + std::numeric_limits::max () * abs (topMinusBottom))) { + // impossible condition: already tested above throw std::domain_error ("Bad viewing frustum: " "projection matrix cannot be computed."); } @@ -527,7 +590,7 @@ Frustum::projectionMatrixExc() const template IMATH_CONSTEXPR14 inline Matrix44 -Frustum::projectionMatrix() const IMATH_NOEXCEPT +Frustum::projectionMatrix () const IMATH_NOEXCEPT { T rightPlusLeft = _right + _left; T rightMinusLeft = _right - _left; @@ -548,7 +611,8 @@ Frustum::projectionMatrix() const IMATH_NOEXCEPT T B = T (2) / topMinusBottom; T C = T (-2) / farMinusNear; - return Matrix44 (A, 0, 0, 0, 0, B, 0, 0, 0, 0, C, 0, tx, ty, tz, 1.f); + return Matrix44 ( + A, 0, 0, 0, 0, B, 0, 0, 0, 0, C, 0, tx, ty, tz, 1.f); } else { @@ -571,7 +635,7 @@ Frustum::projectionMatrix() const IMATH_NOEXCEPT template constexpr inline bool -Frustum::degenerate() const IMATH_NOEXCEPT +Frustum::degenerate () const IMATH_NOEXCEPT { return (_nearPlane == _farPlane) || (_left == _right) || (_top == _bottom); } @@ -585,15 +649,17 @@ Frustum::window (T l, T r, T t, T b) const IMATH_NOEXCEPT Vec2 bl = screenToLocal (Vec2 (l, b)); Vec2 tr = screenToLocal (Vec2 (r, t)); - return Frustum (_nearPlane, _farPlane, bl.x, tr.x, tr.y, bl.y, _orthographic); + return Frustum ( + _nearPlane, _farPlane, bl.x, tr.x, tr.y, bl.y, _orthographic); } template constexpr inline Vec2 Frustum::screenToLocal (const Vec2& s) const IMATH_NOEXCEPT { - return Vec2 (_left + (_right - _left) * (1.f + s.x) / 2.f, - _bottom + (_top - _bottom) * (1.f + s.y) / 2.f); + return Vec2 ( + _left + (_right - _left) * (1.f + s.x) / 2.f, + _bottom + (_top - _bottom) * (1.f + s.y) / 2.f); } template @@ -606,15 +672,19 @@ Frustum::localToScreenExc (const Vec2& p) const T bottomMinusTop = _bottom - _top; if ((abs (leftMinusRight) < T (1) && - abs (leftPlusRight) > std::numeric_limits::max() * abs (leftMinusRight)) || + abs (leftPlusRight) > + std::numeric_limits::max () * abs (leftMinusRight)) || (abs (bottomMinusTop) < T (1) && - abs (bottomPlusTop) > std::numeric_limits::max() * abs (bottomMinusTop))) + abs (bottomPlusTop) > + std::numeric_limits::max () * abs (bottomMinusTop))) { - throw std::domain_error ("Bad viewing frustum: " - "local-to-screen transformation cannot be computed"); + throw std::domain_error ( + "Bad viewing frustum: " + "local-to-screen transformation cannot be computed"); } - return Vec2 (leftPlusRight / leftMinusRight, bottomPlusTop / bottomMinusTop); + return Vec2 ( + leftPlusRight / leftMinusRight, bottomPlusTop / bottomMinusTop); } template @@ -626,7 +696,8 @@ Frustum::localToScreen (const Vec2& p) const IMATH_NOEXCEPT T bottomPlusTop = _bottom - T (2) * p.y + _top; T bottomMinusTop = _bottom - _top; - return Vec2 (leftPlusRight / leftMinusRight, bottomPlusTop / bottomMinusTop); + return Vec2 ( + leftPlusRight / leftMinusRight, bottomPlusTop / bottomMinusTop); } template @@ -634,32 +705,34 @@ IMATH_CONSTEXPR14 inline Line3 Frustum::projectScreenToRay (const Vec2& p) const IMATH_NOEXCEPT { Vec2 point = screenToLocal (p); - if (orthographic()) - return Line3 (Vec3 (point.x, point.y, 0.0), Vec3 (point.x, point.y, -1.0)); + if (orthographic ()) + return Line3 ( + Vec3 (point.x, point.y, 0.0), Vec3 (point.x, point.y, -1.0)); else - return Line3 (Vec3 (0, 0, 0), Vec3 (point.x, point.y, -_nearPlane)); + return Line3 ( + Vec3 (0, 0, 0), Vec3 (point.x, point.y, -_nearPlane)); } template IMATH_CONSTEXPR14 Vec2 Frustum::projectPointToScreenExc (const Vec3& point) const { - if (orthographic() || point.z == T (0)) + if (orthographic () || point.z == T (0)) return localToScreenExc (Vec2 (point.x, point.y)); else - return localToScreenExc ( - Vec2 (point.x * _nearPlane / -point.z, point.y * _nearPlane / -point.z)); + return localToScreenExc (Vec2 ( + point.x * _nearPlane / -point.z, point.y * _nearPlane / -point.z)); } template IMATH_CONSTEXPR14 Vec2 Frustum::projectPointToScreen (const Vec3& point) const IMATH_NOEXCEPT { - if (orthographic() || point.z == T (0)) + if (orthographic () || point.z == T (0)) return localToScreen (Vec2 (point.x, point.y)); else - return localToScreen ( - Vec2 (point.x * _nearPlane / -point.z, point.y * _nearPlane / -point.z)); + return localToScreen (Vec2 ( + point.x * _nearPlane / -point.z, point.y * _nearPlane / -point.z)); } template @@ -673,8 +746,7 @@ Frustum::ZToDepthExc (long zval, long zmin, long zmax) const throw std::domain_error ("Bad call to Frustum::ZToDepth: zmax == zmin"); } - if (zval > zmax + 1) - zval -= zdiff; + if (zval > zmax + 1) zval -= zdiff; T fzval = (T (zval) - T (zmin)) / T (zdiff); return normalizedZToDepthExc (fzval); @@ -686,8 +758,7 @@ Frustum::ZToDepth (long zval, long zmin, long zmax) const IMATH_NOEXCEPT { int zdiff = zmax - zmin; - if (zval > zmax + 1) - zval -= zdiff; + if (zval > zmax + 1) zval -= zdiff; T fzval = (T (zval) - T (zmin)) / T (zdiff); return normalizedZToDepth (fzval); @@ -701,18 +772,22 @@ Frustum::normalizedZToDepthExc (T zval) const if (_orthographic) { - return -(Zp * (_farPlane - _nearPlane) + (_farPlane + _nearPlane)) / T (2); + return -(Zp * (_farPlane - _nearPlane) + (_farPlane + _nearPlane)) / + T (2); } else { T farTimesNear = 2 * _farPlane * _nearPlane; T farMinusNear = Zp * (_farPlane - _nearPlane) - _farPlane - _nearPlane; - if (abs (farMinusNear) < 1 && abs (farTimesNear) > std::numeric_limits::max() * abs (farMinusNear)) + if (abs (farMinusNear) < 1 && + abs (farTimesNear) > + std::numeric_limits::max () * abs (farMinusNear)) { - throw std::domain_error ("Frustum::normalizedZToDepth cannot be computed: " - "near and far clipping planes of the viewing frustum " - "may be too close to each other"); + throw std::domain_error ( + "Frustum::normalizedZToDepth cannot be computed: " + "near and far clipping planes of the viewing frustum " + "may be too close to each other"); } return farTimesNear / farMinusNear; @@ -727,7 +802,8 @@ Frustum::normalizedZToDepth (T zval) const IMATH_NOEXCEPT if (_orthographic) { - return -(Zp * (_farPlane - _nearPlane) + (_farPlane + _nearPlane)) / T (2); + return -(Zp * (_farPlane - _nearPlane) + (_farPlane + _nearPlane)) / + T (2); } else { @@ -742,14 +818,16 @@ template IMATH_CONSTEXPR14 long Frustum::DepthToZExc (T depth, long zmin, long zmax) const { - long zdiff = zmax - zmin; - T farMinusNear = _farPlane - _nearPlane; + long zdiff = zmax - zmin; + T farMinusNear = _farPlane - _nearPlane; if (_orthographic) { T farPlusNear = T (2) * depth + _farPlane + _nearPlane; - if (abs (farMinusNear) < T (1) && abs (farPlusNear) > std::numeric_limits::max() * abs (farMinusNear)) + if (abs (farMinusNear) < T (1) && + abs (farPlusNear) > + std::numeric_limits::max () * abs (farMinusNear)) { throw std::domain_error ("Bad viewing frustum: " "near and far clipping planes " @@ -764,14 +842,17 @@ Frustum::DepthToZExc (T depth, long zmin, long zmax) const // Perspective T farTimesNear = T (2) * _farPlane * _nearPlane; - if (abs (depth) < T (1) && abs (farTimesNear) > std::numeric_limits::max() * abs (depth)) + if (abs (depth) < T (1) && + abs (farTimesNear) > std::numeric_limits::max () * abs (depth)) { throw std::domain_error ("Bad call to DepthToZ function: " "value of `depth' is too small"); } T farPlusNear = farTimesNear / depth + _farPlane + _nearPlane; - if (abs (farMinusNear) < T (1) && abs (farPlusNear) > std::numeric_limits::max() * abs (farMinusNear)) + if (abs (farMinusNear) < T (1) && + abs (farPlusNear) > + std::numeric_limits::max () * abs (farMinusNear)) { throw std::domain_error ("Bad viewing frustum: " "near and far clipping planes " @@ -787,8 +868,8 @@ template IMATH_CONSTEXPR14 long Frustum::DepthToZ (T depth, long zmin, long zmax) const IMATH_NOEXCEPT { - long zdiff = zmax - zmin; - T farMinusNear = _farPlane - _nearPlane; + long zdiff = zmax - zmin; + T farMinusNear = _farPlane - _nearPlane; if (_orthographic) { @@ -824,7 +905,8 @@ Frustum::screenRadiusExc (const Vec3& p, T radius) const // A similar analysis holds in the Y-Z plane. // So r is the quantity we want to return. - if (abs (p.z) > T (1) || abs (-_nearPlane) < std::numeric_limits::max() * abs (p.z)) + if (abs (p.z) > T (1) || + abs (-_nearPlane) < std::numeric_limits::max () * abs (p.z)) { return radius * (-_nearPlane / p.z); } @@ -858,7 +940,8 @@ template IMATH_CONSTEXPR14 T Frustum::worldRadiusExc (const Vec3& p, T radius) const { - if (abs (-_nearPlane) > T (1) || abs (p.z) < std::numeric_limits::max() * abs (-_nearPlane)) + if (abs (-_nearPlane) > T (1) || + abs (p.z) < std::numeric_limits::max () * abs (-_nearPlane)) { return radius * (p.z / -_nearPlane); } @@ -924,15 +1007,15 @@ Frustum::planes (Plane3 p[6], const Matrix44& M) const IMATH_NOEXCEPT Vec3 d = Vec3 (_right, _bottom, -_nearPlane) * M; if (!_orthographic) { - double s = _farPlane / double (_nearPlane); - T farLeft = (T) (s * _left); - T farRight = (T) (s * _right); - T farTop = (T) (s * _top); - T farBottom = (T) (s * _bottom); - Vec3 e = Vec3 (farLeft, farBottom, -_farPlane) * M; - Vec3 f = Vec3 (farLeft, farTop, -_farPlane) * M; - Vec3 g = Vec3 (farRight, farTop, -_farPlane) * M; - Vec3 o = Vec3 (0, 0, 0) * M; + double s = _farPlane / double (_nearPlane); + T farLeft = (T) (s * _left); + T farRight = (T) (s * _right); + T farTop = (T) (s * _top); + T farBottom = (T) (s * _bottom); + Vec3 e = Vec3 (farLeft, farBottom, -_farPlane) * M; + Vec3 f = Vec3 (farLeft, farTop, -_farPlane) * M; + Vec3 g = Vec3 (farRight, farTop, -_farPlane) * M; + Vec3 o = Vec3 (0, 0, 0) * M; p[0].set (o, c, b); p[1].set (o, d, c); p[2].set (o, a, d); diff --git a/third_party/Imath-3.1.9/src/Imath/ImathFrustumTest.h b/third_party/Imath/src/Imath/ImathFrustumTest.h similarity index 68% rename from third_party/Imath-3.1.9/src/Imath/ImathFrustumTest.h rename to third_party/Imath/src/Imath/ImathFrustumTest.h index 3995ddb9..d052cca1 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathFrustumTest.h +++ b/third_party/Imath/src/Imath/ImathFrustumTest.h @@ -84,21 +84,22 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class IMATH_EXPORT_TEMPLATE_TYPE FrustumTest { - public: +public: /// @{ /// @name Constructors /// Initialize camera matrix to identity - FrustumTest() IMATH_NOEXCEPT + FrustumTest () IMATH_NOEXCEPT { - Frustum frust; + Frustum frust; Matrix44 cameraMat; - cameraMat.makeIdentity(); + cameraMat.makeIdentity (); setFrustum (frust, cameraMat); } /// Initialize to a given frustum and camera matrix. - FrustumTest (const Frustum& frustum, const Matrix44& cameraMat) IMATH_NOEXCEPT + FrustumTest (const Frustum& frustum, const Matrix44& cameraMat) + IMATH_NOEXCEPT { setFrustum (frustum, cameraMat); } @@ -107,17 +108,18 @@ template class IMATH_EXPORT_TEMPLATE_TYPE FrustumTest /// @{ /// @name Set Value - + /// Update the frustum test with a new frustum and matrix. /// This should usually be called just once per frame, or however /// often the camera moves. - void setFrustum (const Frustum& frustum, const Matrix44& cameraMat) IMATH_NOEXCEPT; + void setFrustum (const Frustum& frustum, const Matrix44& cameraMat) + IMATH_NOEXCEPT; /// @} /// @{ /// @name Query - + /// Return true if any part of the sphere is inside the frustum. /// The result MAY return close false-positives, but not false-negatives. bool isVisible (const Sphere3& sphere) const IMATH_NOEXCEPT; @@ -138,15 +140,20 @@ template class IMATH_EXPORT_TEMPLATE_TYPE FrustumTest bool completelyContains (const Box>& box) const IMATH_NOEXCEPT; /// Return the camera matrix (primarily for debugging) - IMATH_INTERNAL_NAMESPACE::Matrix44 cameraMat() const IMATH_NOEXCEPT { return cameraMatrix; } + IMATH_INTERNAL_NAMESPACE::Matrix44 cameraMat () const IMATH_NOEXCEPT + { + return cameraMatrix; + } /// Return the viewing frustum (primarily for debugging) - IMATH_INTERNAL_NAMESPACE::Frustum currentFrustum() const IMATH_NOEXCEPT { return currFrustum; } + IMATH_INTERNAL_NAMESPACE::Frustum currentFrustum () const IMATH_NOEXCEPT + { + return currFrustum; + } /// @} - - protected: +protected: // To understand why the planes are stored this way, see // the SPECIAL NOTE above. @@ -164,7 +171,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE FrustumTest Vec3 planeNormAbsZ[2]; // The abs(X) components from 6 plane equations // These are kept primarily for debugging tools. - Frustum currFrustum; + Frustum currFrustum; Matrix44 cameraMatrix; /// @endcond @@ -172,7 +179,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE FrustumTest template void -FrustumTest::setFrustum (const Frustum& frustum, const Matrix44& cameraMat) IMATH_NOEXCEPT +FrustumTest::setFrustum ( + const Frustum& frustum, const Matrix44& cameraMat) IMATH_NOEXCEPT { Plane3 frustumPlanes[6]; frustum.planes (frustumPlanes, cameraMat); @@ -183,29 +191,36 @@ FrustumTest::setFrustum (const Frustum& frustum, const Matrix44& camera { int index = i * 3; - planeNormX[i] = Vec3 (frustumPlanes[index + 0].normal.x, - frustumPlanes[index + 1].normal.x, - frustumPlanes[index + 2].normal.x); - planeNormY[i] = Vec3 (frustumPlanes[index + 0].normal.y, - frustumPlanes[index + 1].normal.y, - frustumPlanes[index + 2].normal.y); - planeNormZ[i] = Vec3 (frustumPlanes[index + 0].normal.z, - frustumPlanes[index + 1].normal.z, - frustumPlanes[index + 2].normal.z); - - planeNormAbsX[i] = Vec3 (std::abs (planeNormX[i].x), - std::abs (planeNormX[i].y), - std::abs (planeNormX[i].z)); - planeNormAbsY[i] = Vec3 (std::abs (planeNormY[i].x), - std::abs (planeNormY[i].y), - std::abs (planeNormY[i].z)); - planeNormAbsZ[i] = Vec3 (std::abs (planeNormZ[i].x), - std::abs (planeNormZ[i].y), - std::abs (planeNormZ[i].z)); - - planeOffsetVec[i] = Vec3 (frustumPlanes[index + 0].distance, - frustumPlanes[index + 1].distance, - frustumPlanes[index + 2].distance); + planeNormX[i] = Vec3 ( + frustumPlanes[index + 0].normal.x, + frustumPlanes[index + 1].normal.x, + frustumPlanes[index + 2].normal.x); + planeNormY[i] = Vec3 ( + frustumPlanes[index + 0].normal.y, + frustumPlanes[index + 1].normal.y, + frustumPlanes[index + 2].normal.y); + planeNormZ[i] = Vec3 ( + frustumPlanes[index + 0].normal.z, + frustumPlanes[index + 1].normal.z, + frustumPlanes[index + 2].normal.z); + + planeNormAbsX[i] = Vec3 ( + std::abs (planeNormX[i].x), + std::abs (planeNormX[i].y), + std::abs (planeNormX[i].z)); + planeNormAbsY[i] = Vec3 ( + std::abs (planeNormY[i].x), + std::abs (planeNormY[i].y), + std::abs (planeNormY[i].z)); + planeNormAbsZ[i] = Vec3 ( + std::abs (planeNormZ[i].x), + std::abs (planeNormZ[i].y), + std::abs (planeNormZ[i].z)); + + planeOffsetVec[i] = Vec3 ( + frustumPlanes[index + 0].distance, + frustumPlanes[index + 1].distance, + frustumPlanes[index + 2].distance); } currFrustum = frustum; cameraMatrix = cameraMat; @@ -219,40 +234,37 @@ FrustumTest::isVisible (const Sphere3& sphere) const IMATH_NOEXCEPT Vec3 radiusVec = Vec3 (sphere.radius, sphere.radius, sphere.radius); // This is a vertical dot-product on three vectors at once. - Vec3 d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + planeNormZ[0] * center.z - - radiusVec - planeOffsetVec[0]; + Vec3 d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + + planeNormZ[0] * center.z - radiusVec - planeOffsetVec[0]; - if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) - return false; + if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; - Vec3 d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + planeNormZ[1] * center.z - - radiusVec - planeOffsetVec[1]; + Vec3 d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + + planeNormZ[1] * center.z - radiusVec - planeOffsetVec[1]; - if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) - return false; + if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } template bool -FrustumTest::completelyContains (const Sphere3& sphere) const IMATH_NOEXCEPT +FrustumTest::completelyContains (const Sphere3& sphere) const + IMATH_NOEXCEPT { Vec3 center = sphere.center; Vec3 radiusVec = Vec3 (sphere.radius, sphere.radius, sphere.radius); // This is a vertical dot-product on three vectors at once. - Vec3 d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + planeNormZ[0] * center.z + - radiusVec - planeOffsetVec[0]; + Vec3 d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + + planeNormZ[0] * center.z + radiusVec - planeOffsetVec[0]; - if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) - return false; + if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; - Vec3 d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + planeNormZ[1] * center.z + - radiusVec - planeOffsetVec[1]; + Vec3 d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + + planeNormZ[1] * center.z + radiusVec - planeOffsetVec[1]; - if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) - return false; + if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } @@ -261,54 +273,53 @@ template bool FrustumTest::isVisible (const Box>& box) const IMATH_NOEXCEPT { - if (box.isEmpty()) - return false; + if (box.isEmpty ()) return false; Vec3 center = (box.min + box.max) / 2; Vec3 extent = (box.max - center); // This is a vertical dot-product on three vectors at once. - Vec3 d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + planeNormZ[0] * center.z - - planeNormAbsX[0] * extent.x - planeNormAbsY[0] * extent.y - - planeNormAbsZ[0] * extent.z - planeOffsetVec[0]; + Vec3 d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + + planeNormZ[0] * center.z - planeNormAbsX[0] * extent.x - + planeNormAbsY[0] * extent.y - planeNormAbsZ[0] * extent.z - + planeOffsetVec[0]; - if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) - return false; + if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; - Vec3 d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + planeNormZ[1] * center.z - - planeNormAbsX[1] * extent.x - planeNormAbsY[1] * extent.y - - planeNormAbsZ[1] * extent.z - planeOffsetVec[1]; + Vec3 d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + + planeNormZ[1] * center.z - planeNormAbsX[1] * extent.x - + planeNormAbsY[1] * extent.y - planeNormAbsZ[1] * extent.z - + planeOffsetVec[1]; - if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) - return false; + if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } template bool -FrustumTest::completelyContains (const Box>& box) const IMATH_NOEXCEPT +FrustumTest::completelyContains (const Box>& box) const + IMATH_NOEXCEPT { - if (box.isEmpty()) - return false; + if (box.isEmpty ()) return false; Vec3 center = (box.min + box.max) / 2; Vec3 extent = (box.max - center); // This is a vertical dot-product on three vectors at once. - Vec3 d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + planeNormZ[0] * center.z + - planeNormAbsX[0] * extent.x + planeNormAbsY[0] * extent.y + - planeNormAbsZ[0] * extent.z - planeOffsetVec[0]; + Vec3 d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + + planeNormZ[0] * center.z + planeNormAbsX[0] * extent.x + + planeNormAbsY[0] * extent.y + planeNormAbsZ[0] * extent.z - + planeOffsetVec[0]; - if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) - return false; + if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; - Vec3 d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + planeNormZ[1] * center.z + - planeNormAbsX[1] * extent.x + planeNormAbsY[1] * extent.y + - planeNormAbsZ[1] * extent.z - planeOffsetVec[1]; + Vec3 d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + + planeNormZ[1] * center.z + planeNormAbsX[1] * extent.x + + planeNormAbsY[1] * extent.y + planeNormAbsZ[1] * extent.z - + planeOffsetVec[1]; - if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) - return false; + if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } @@ -318,17 +329,15 @@ bool FrustumTest::isVisible (const Vec3& vec) const IMATH_NOEXCEPT { // This is a vertical dot-product on three vectors at once. - Vec3 d0 = (planeNormX[0] * vec.x) + (planeNormY[0] * vec.y) + (planeNormZ[0] * vec.z) - - planeOffsetVec[0]; + Vec3 d0 = (planeNormX[0] * vec.x) + (planeNormY[0] * vec.y) + + (planeNormZ[0] * vec.z) - planeOffsetVec[0]; - if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) - return false; + if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; - Vec3 d1 = (planeNormX[1] * vec.x) + (planeNormY[1] * vec.y) + (planeNormZ[1] * vec.z) - - planeOffsetVec[1]; + Vec3 d1 = (planeNormX[1] * vec.x) + (planeNormY[1] * vec.y) + + (planeNormZ[1] * vec.z) - planeOffsetVec[1]; - if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) - return false; + if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } diff --git a/third_party/Imath/src/Imath/ImathFun.cpp b/third_party/Imath/src/Imath/ImathFun.cpp new file mode 100644 index 00000000..c8c2e7ea --- /dev/null +++ b/third_party/Imath/src/Imath/ImathFun.cpp @@ -0,0 +1,35 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#include "ImathFun.h" +#include + +IMATH_INTERNAL_NAMESPACE_SOURCE_ENTER + +float succf(float f) IMATH_NOEXCEPT +{ + return std::isfinite(f) ? + std::nextafter(f, std::numeric_limits::infinity()) : f; +} + +float predf(float f) IMATH_NOEXCEPT +{ + return std::isfinite(f) ? + std::nextafter(f, -std::numeric_limits::infinity()) : f; +} + +double succd(double d) IMATH_NOEXCEPT +{ + return std::isfinite(d) ? + std::nextafter(d, std::numeric_limits::infinity()) : d; +} + +double predd(double d) IMATH_NOEXCEPT +{ + return std::isfinite(d) ? + std::nextafter(d, -std::numeric_limits::infinity()) : d; +} + +IMATH_INTERNAL_NAMESPACE_SOURCE_EXIT diff --git a/third_party/Imath-3.1.9/src/Imath/ImathFun.h b/third_party/Imath/src/Imath/ImathFun.h similarity index 94% rename from third_party/Imath-3.1.9/src/Imath/ImathFun.h rename to third_party/Imath/src/Imath/ImathFun.h index 938d0cf1..5004c876 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathFun.h +++ b/third_party/Imath/src/Imath/ImathFun.h @@ -12,8 +12,8 @@ // //----------------------------------------------------------------------------- -#include #include +#include #include "ImathExport.h" #include "ImathNamespace.h" @@ -66,7 +66,7 @@ lerpfactor (T m, T a, T b) IMATH_NOEXCEPT T d = b - a; T n = m - a; - if (abs (d) > T (1) || abs (n) < std::numeric_limits::max() * abs (d)) + if (abs (d) > T (1) || abs (n) < std::numeric_limits::max () * abs (d)) return n / d; return T (0); @@ -139,13 +139,15 @@ trunc (T x) IMATH_NOEXCEPT IMATH_HOSTDEVICE constexpr inline int divs (int x, int y) IMATH_NOEXCEPT { - return (x >= 0) ? ((y >= 0) ? (x / y) : -(x / -y)) : ((y >= 0) ? -(-x / y) : (-x / -y)); + return (x >= 0) ? ((y >= 0) ? (x / y) : -(x / -y)) + : ((y >= 0) ? -(-x / y) : (-x / -y)); } IMATH_HOSTDEVICE constexpr inline int mods (int x, int y) IMATH_NOEXCEPT { - return (x >= 0) ? ((y >= 0) ? (x % y) : (x % -y)) : ((y >= 0) ? -(-x % y) : -(-x % -y)); + return (x >= 0) ? ((y >= 0) ? (x % y) : (x % -y)) + : ((y >= 0) ? -(-x % y) : -(-x % -y)); } // @@ -206,7 +208,7 @@ finitef (float f) IMATH_NOEXCEPT union { float f; - int i; + int i; } u; u.f = f; @@ -218,7 +220,7 @@ finited (double d) IMATH_NOEXCEPT { union { - double d; + double d; uint64_t i; } u; u.d = d; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathGL.h b/third_party/Imath/src/Imath/ImathGL.h similarity index 86% rename from third_party/Imath-3.1.9/src/Imath/ImathGL.h rename to third_party/Imath/src/Imath/ImathGL.h index e38fe652..90884f2a 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathGL.h +++ b/third_party/Imath/src/Imath/ImathGL.h @@ -61,7 +61,7 @@ glTexCoord (const IMATH_INTERNAL_NAMESPACE::V2f& t) /// Disable GL textures inline void -glDisableTexture() +glDisableTexture () { glActiveTexture (GL_TEXTURE1); glBindTexture (GL_TEXTURE_2D, 0); @@ -78,7 +78,8 @@ const float GL_FLOAT_MAX = 1.8e+19; // sqrt (FLT_MAX) inline bool badFloat (float f) { - return !IMATH_INTERNAL_NAMESPACE::finitef (f) || f < -GL_FLOAT_MAX || f > GL_FLOAT_MAX; + return !IMATH_INTERNAL_NAMESPACE::finitef (f) || f < -GL_FLOAT_MAX || + f > GL_FLOAT_MAX; } } // namespace @@ -87,10 +88,12 @@ badFloat (float f) inline void throwBadMatrix (const IMATH_INTERNAL_NAMESPACE::M44f& m) { - if (badFloat (m[0][0]) || badFloat (m[0][1]) || badFloat (m[0][2]) || badFloat (m[0][3]) || - badFloat (m[1][0]) || badFloat (m[1][1]) || badFloat (m[1][2]) || badFloat (m[1][3]) || - badFloat (m[2][0]) || badFloat (m[2][1]) || badFloat (m[2][2]) || badFloat (m[2][3]) || - badFloat (m[3][0]) || badFloat (m[3][1]) || badFloat (m[3][2]) || badFloat (m[3][3])) + if (badFloat (m[0][0]) || badFloat (m[0][1]) || badFloat (m[0][2]) || + badFloat (m[0][3]) || badFloat (m[1][0]) || badFloat (m[1][1]) || + badFloat (m[1][2]) || badFloat (m[1][3]) || badFloat (m[2][0]) || + badFloat (m[2][1]) || badFloat (m[2][2]) || badFloat (m[2][3]) || + badFloat (m[3][0]) || badFloat (m[3][1]) || badFloat (m[3][2]) || + badFloat (m[3][3])) throw std::invalid_argument ("GL matrix overflow"); } @@ -135,9 +138,9 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER class GLPushMatrix { - public: - GLPushMatrix() { glPushMatrix(); } - ~GLPushMatrix() { glPopMatrix(); } +public: + GLPushMatrix () { glPushMatrix (); } + ~GLPushMatrix () { glPopMatrix (); } }; /// @@ -147,12 +150,12 @@ class GLPushMatrix class GLPushAttrib { - public: +public: /// call glPushAttrib() GLPushAttrib (GLbitfield mask) { glPushAttrib (mask); } /// call glPopAttrib() - ~GLPushAttrib() { glPopAttrib(); } + ~GLPushAttrib () { glPopAttrib (); } }; /// @@ -162,13 +165,12 @@ class GLPushAttrib class GLBegin { - public: - +public: /// Call glBegin() GLBegin (GLenum mode) { glBegin (mode); } /// Call glEnd() - ~GLBegin() { glEnd(); } + ~GLBegin () { glEnd (); } }; IMATH_INTERNAL_NAMESPACE_HEADER_EXIT diff --git a/third_party/Imath-3.1.9/src/Imath/ImathGLU.h b/third_party/Imath/src/Imath/ImathGLU.h similarity index 54% rename from third_party/Imath-3.1.9/src/Imath/ImathGLU.h rename to third_party/Imath/src/Imath/ImathGLU.h index 231da831..396c21d7 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathGLU.h +++ b/third_party/Imath/src/Imath/ImathGLU.h @@ -17,11 +17,21 @@ /// Call gluLookAt with the given position, interest, and up-vector. inline void -gluLookAt (const IMATH_INTERNAL_NAMESPACE::V3f& pos, - const IMATH_INTERNAL_NAMESPACE::V3f& interest, - const IMATH_INTERNAL_NAMESPACE::V3f& up) +gluLookAt ( + const IMATH_INTERNAL_NAMESPACE::V3f& pos, + const IMATH_INTERNAL_NAMESPACE::V3f& interest, + const IMATH_INTERNAL_NAMESPACE::V3f& up) { - gluLookAt (pos.x, pos.y, pos.z, interest.x, interest.y, interest.z, up.x, up.y, up.z); + gluLookAt ( + pos.x, + pos.y, + pos.z, + interest.x, + interest.y, + interest.z, + up.x, + up.y, + up.z); } #endif diff --git a/third_party/Imath-3.1.9/src/Imath/ImathInt64.h b/third_party/Imath/src/Imath/ImathInt64.h similarity index 81% rename from third_party/Imath-3.1.9/src/Imath/ImathInt64.h rename to third_party/Imath/src/Imath/ImathInt64.h index 258b1470..fd123eae 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathInt64.h +++ b/third_party/Imath/src/Imath/ImathInt64.h @@ -19,24 +19,24 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER #if (defined _WIN32 || defined _WIN64) && _MSC_VER >= 1300 /// Int64 - unsigned 64-bit integer -IMATH_DEPRECATED("use uint64_t") +IMATH_DEPRECATED ("use uint64_t") typedef unsigned __int64 Int64; /// SInt64 - signed 64-bit integer -IMATH_DEPRECATED("use sint64_t") +IMATH_DEPRECATED ("use sint64_t") typedef __int64 SInt64; #elif ULONG_MAX == 18446744073709551615LU /// Int64 - unsigned 64-bit integer -IMATH_DEPRECATED("use uint64_t") +IMATH_DEPRECATED ("use uint64_t") typedef long unsigned int Int64; /// SInt64 - signed 64-bit integer -IMATH_DEPRECATED("use sint64_t") +IMATH_DEPRECATED ("use sint64_t") typedef long int SInt64; #else /// Int64 - unsigned 64-bit integer -IMATH_DEPRECATED("use uint64_t") +IMATH_DEPRECATED ("use uint64_t") typedef long long unsigned int Int64; /// SInt64 - signed 64-bit integer -IMATH_DEPRECATED("use sint64_t") +IMATH_DEPRECATED ("use sint64_t") typedef long long int SInt64; #endif diff --git a/third_party/Imath-3.1.9/src/Imath/ImathInterval.h b/third_party/Imath/src/Imath/ImathInterval.h similarity index 70% rename from third_party/Imath-3.1.9/src/Imath/ImathInterval.h rename to third_party/Imath/src/Imath/ImathInterval.h index ae483a4a..0e139621 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathInterval.h +++ b/third_party/Imath/src/Imath/ImathInterval.h @@ -24,11 +24,10 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class IMATH_EXPORT_TEMPLATE_TYPE Interval { - public: - +public: /// @{ /// @name Direct access to bounds - + /// The minimum value of the interval T min; @@ -36,18 +35,19 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Interval T max; /// @} - + /// @{ /// @name Constructors /// Initialize to the empty interval - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval () IMATH_NOEXCEPT; /// Intitialize to a single point IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval (const T& point) IMATH_NOEXCEPT; /// Intitialize to a given (min,max) - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval (const T& minT, const T& maxT) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval (const T& minT, const T& maxT) + IMATH_NOEXCEPT; /// @} @@ -55,9 +55,11 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Interval /// @name Comparison /// Equality - IMATH_HOSTDEVICE constexpr bool operator== (const Interval& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator== (const Interval& src) const IMATH_NOEXCEPT; /// Inequality - IMATH_HOSTDEVICE constexpr bool operator!= (const Interval& src) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator!= (const Interval& src) const IMATH_NOEXCEPT; /// @} @@ -66,7 +68,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Interval /// Set the interval to be empty. An interval is empty if the /// minimum is greater than the maximum. - IMATH_HOSTDEVICE void makeEmpty() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeEmpty () IMATH_NOEXCEPT; /// Extend the interval to include the given point. IMATH_HOSTDEVICE void extendBy (const T& point) IMATH_NOEXCEPT; @@ -75,7 +77,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Interval IMATH_HOSTDEVICE void extendBy (const Interval& interval) IMATH_NOEXCEPT; /// Make the interval include the entire range of the base type. - IMATH_HOSTDEVICE void makeInfinite() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeInfinite () IMATH_NOEXCEPT; /// @} @@ -83,36 +85,39 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Interval /// @name Query /// Return the size of the interval. The size is (max-min). An empty box has a size of 0. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T size() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T size () const IMATH_NOEXCEPT; /// Return the center of the interval. The center is defined as /// (max+min)/2. The center of an empty interval is undefined. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T center() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T center () const IMATH_NOEXCEPT; /// Return true if the given point is inside the interval, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects (const T& point) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersects (const T& point) const IMATH_NOEXCEPT; /// Return true if the given interval is inside the interval, false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects (const Interval& interval) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersects (const Interval& interval) const IMATH_NOEXCEPT; /// Return true if the interval is empty, false otherwise. An /// empty interval's minimum is greater than its maximum. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty () const IMATH_NOEXCEPT; /// Return true if the interval is larger than a single point, /// false otherwise. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume () const IMATH_NOEXCEPT; /// Return true if the interval contains all points, false /// otherwise. An infinite box has a mimimum of std::numeric_limits::lowest() /// and a maximum of std::numeric_limits::max() - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite () const IMATH_NOEXCEPT; /// @} }; /// Stream output, as "(min max)" -template std::ostream& operator<< (std::ostream& s, const Interval& v); +template +std::ostream& operator<< (std::ostream& s, const Interval& v); /// Interval of type float typedef Interval Intervalf; @@ -127,20 +132,23 @@ typedef Interval Intervals; typedef Interval Intervali; template -IMATH_HOSTDEVICE inline IMATH_CONSTEXPR14 Interval::Interval() IMATH_NOEXCEPT +IMATH_HOSTDEVICE inline IMATH_CONSTEXPR14 +Interval::Interval () IMATH_NOEXCEPT { - makeEmpty(); + makeEmpty (); } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Interval::Interval (const T& point) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Interval::Interval (const T& point) + IMATH_NOEXCEPT { min = point; max = point; } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Interval::Interval (const T& minV, const T& maxV) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Interval::Interval ( + const T& minV, const T& maxV) IMATH_NOEXCEPT { min = minV; max = maxV; @@ -162,41 +170,36 @@ Interval::operator!= (const Interval& src) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline void -Interval::makeEmpty() IMATH_NOEXCEPT +Interval::makeEmpty () IMATH_NOEXCEPT { - min = std::numeric_limits::max(); - max = std::numeric_limits::lowest(); + min = std::numeric_limits::max (); + max = std::numeric_limits::lowest (); } template IMATH_HOSTDEVICE inline void -Interval::makeInfinite() IMATH_NOEXCEPT +Interval::makeInfinite () IMATH_NOEXCEPT { - min = std::numeric_limits::lowest(); - max = std::numeric_limits::max(); + min = std::numeric_limits::lowest (); + max = std::numeric_limits::max (); } - template IMATH_HOSTDEVICE inline void Interval::extendBy (const T& point) IMATH_NOEXCEPT { - if (point < min) - min = point; + if (point < min) min = point; - if (point > max) - max = point; + if (point > max) max = point; } template IMATH_HOSTDEVICE inline void Interval::extendBy (const Interval& interval) IMATH_NOEXCEPT { - if (interval.min < min) - min = interval.min; + if (interval.min < min) min = interval.min; - if (interval.max > max) - max = interval.max; + if (interval.max > max) max = interval.max; } template @@ -215,40 +218,40 @@ Interval::intersects (const Interval& interval) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline T -Interval::size() const IMATH_NOEXCEPT +Interval::size () const IMATH_NOEXCEPT { - if (isEmpty()) - return T(0); - + if (isEmpty ()) return T (0); + return max - min; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline T -Interval::center() const IMATH_NOEXCEPT +Interval::center () const IMATH_NOEXCEPT { return (max + min) / 2; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Interval::isEmpty() const IMATH_NOEXCEPT +Interval::isEmpty () const IMATH_NOEXCEPT { return max < min; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Interval::hasVolume() const IMATH_NOEXCEPT +Interval::hasVolume () const IMATH_NOEXCEPT { return max > min; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool -Interval::isInfinite() const IMATH_NOEXCEPT +Interval::isInfinite () const IMATH_NOEXCEPT { - if (min != std::numeric_limits::lowest() || max != std::numeric_limits::max()) + if (min != std::numeric_limits::lowest () || + max != std::numeric_limits::max ()) return false; return true; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathLine.h b/third_party/Imath/src/Imath/ImathLine.h similarity index 72% rename from third_party/Imath-3.1.9/src/Imath/ImathLine.h rename to third_party/Imath/src/Imath/ImathLine.h index 499d75ba..73c32e95 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathLine.h +++ b/third_party/Imath/src/Imath/ImathLine.h @@ -23,11 +23,10 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class Line3 { - public: - +public: /// @{ /// @name Direct access to member fields - + /// A point on the line Vec3 pos; @@ -40,40 +39,47 @@ template class Line3 /// @name Constructors /// Uninitialized by default - IMATH_HOSTDEVICE constexpr Line3() IMATH_NOEXCEPT {} + IMATH_HOSTDEVICE constexpr Line3 () IMATH_NOEXCEPT {} /// Initialize with two points. The direction is the difference /// between the points. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Line3 (const Vec3& point1, const Vec3& point2) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Line3 (const Vec3& point1, const Vec3& point2) IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Manipulation - + /// Set the line defined by two points. The direction is the difference /// between the points. - IMATH_HOSTDEVICE void set (const Vec3& point1, const Vec3& point2) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + set (const Vec3& point1, const Vec3& point2) IMATH_NOEXCEPT; /// @} /// @{ /// @name Utility Methods - + /// Return the point on the line at the given parameter value, /// e.g. L(t) - IMATH_HOSTDEVICE constexpr Vec3 operator() (T parameter) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 + operator() (T parameter) const IMATH_NOEXCEPT; /// Return the distance to the given point - IMATH_HOSTDEVICE constexpr T distanceTo (const Vec3& point) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T + distanceTo (const Vec3& point) const IMATH_NOEXCEPT; /// Return the distance to the given line - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T distanceTo (const Line3& line) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T + distanceTo (const Line3& line) const IMATH_NOEXCEPT; /// Return the point on the line closest to the given point - IMATH_HOSTDEVICE constexpr Vec3 closestPointTo (const Vec3& point) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 + closestPointTo (const Vec3& point) const IMATH_NOEXCEPT; /// Return the point on the line closest to the given line - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 closestPointTo (const Line3& line) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 + closestPointTo (const Line3& line) const IMATH_NOEXCEPT; /// @} }; @@ -85,7 +91,8 @@ typedef Line3 Line3f; typedef Line3 Line3d; template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Line3::Line3 (const Vec3& p0, const Vec3& p1) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Line3::Line3 ( + const Vec3& p0, const Vec3& p1) IMATH_NOEXCEPT { set (p0, p1); } @@ -96,7 +103,7 @@ Line3::set (const Vec3& p0, const Vec3& p1) IMATH_NOEXCEPT { pos = p0; dir = p1 - p0; - dir.normalize(); + dir.normalize (); } template @@ -110,7 +117,7 @@ template IMATH_HOSTDEVICE constexpr inline T Line3::distanceTo (const Vec3& point) const IMATH_NOEXCEPT { - return (closestPointTo (point) - point).length(); + return (closestPointTo (point) - point).length (); } template @@ -135,10 +142,10 @@ Line3::closestPointTo (const Line3& line) const IMATH_NOEXCEPT // Assumes the lines are normalized Vec3 posLpos = pos - line.pos; - T c = dir ^ posLpos; - T a = line.dir ^ dir; - T f = line.dir ^ posLpos; - T num = c - a * f; + T c = dir ^ posLpos; + T a = line.dir ^ dir; + T f = line.dir ^ posLpos; + T num = c - a * f; T denom = a * a - 1; @@ -148,8 +155,7 @@ Line3::closestPointTo (const Line3& line) const IMATH_NOEXCEPT { T absNum = ((num >= 0) ? num : -num); - if (absNum >= absDenom * std::numeric_limits::max()) - return pos; + if (absNum >= absDenom * std::numeric_limits::max ()) return pos; } return pos + dir * (num / denom); diff --git a/third_party/Imath-3.1.9/src/Imath/ImathLineAlgo.h b/third_party/Imath/src/Imath/ImathLineAlgo.h similarity index 71% rename from third_party/Imath-3.1.9/src/Imath/ImathLineAlgo.h rename to third_party/Imath/src/Imath/ImathLineAlgo.h index 89d3a777..a5e6add3 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathLineAlgo.h +++ b/third_party/Imath/src/Imath/ImathLineAlgo.h @@ -28,18 +28,23 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template IMATH_CONSTEXPR14 bool -closestPoints (const Line3& line1, const Line3& line2, Vec3& point1, Vec3& point2) IMATH_NOEXCEPT +closestPoints ( + const Line3& line1, + const Line3& line2, + Vec3& point1, + Vec3& point2) IMATH_NOEXCEPT { - Vec3 w = line1.pos - line2.pos; - T d1w = line1.dir ^ w; - T d2w = line2.dir ^ w; - T d1d2 = line1.dir ^ line2.dir; - T n1 = d1d2 * d2w - d1w; - T n2 = d2w - d1d2 * d1w; - T d = 1 - d1d2 * d1d2; - T absD = abs (d); - - if ((absD > 1) || (abs (n1) < std::numeric_limits::max() * absD && abs (n2) < std::numeric_limits::max() * absD)) + Vec3 w = line1.pos - line2.pos; + T d1w = line1.dir ^ w; + T d2w = line2.dir ^ w; + T d1d2 = line1.dir ^ line2.dir; + T n1 = d1d2 * d2w - d1w; + T n2 = d2w - d1d2 * d1w; + T d = 1 - d1d2 * d1d2; + T absD = abs (d); + + if ((absD > 1) || (abs (n1) < std::numeric_limits::max () * absD && + abs (n2) < std::numeric_limits::max () * absD)) { point1 = line1 (n1 / d); point2 = line2 (n2 / d); @@ -77,19 +82,20 @@ closestPoints (const Line3& line1, const Line3& line2, Vec3& point1, Ve template IMATH_CONSTEXPR14 bool -intersect (const Line3& line, - const Vec3& v0, - const Vec3& v1, - const Vec3& v2, - Vec3& pt, - Vec3& barycentric, - bool& front) IMATH_NOEXCEPT +intersect ( + const Line3& line, + const Vec3& v0, + const Vec3& v1, + const Vec3& v2, + Vec3& pt, + Vec3& barycentric, + bool& front) IMATH_NOEXCEPT { Vec3 edge0 = v1 - v0; Vec3 edge1 = v2 - v1; Vec3 normal = edge1 % edge0; - T l = normal.length(); + T l = normal.length (); if (l != 0) normal /= l; @@ -104,7 +110,7 @@ intersect (const Line3& line, T d = normal ^ (v0 - line.pos); T nd = normal ^ line.dir; - if (abs (nd) > 1 || abs (d) < std::numeric_limits::max() * abs (nd)) + if (abs (nd) > 1 || abs (d) < std::numeric_limits::max () * abs (nd)) pt = line (d / nd); else return false; // line and plane are nearly parallel @@ -116,13 +122,13 @@ intersect (const Line3& line, // { - Vec3 en = edge0.normalized(); + Vec3 en = edge0.normalized (); Vec3 a = pt - v0; Vec3 b = v2 - v0; Vec3 c = (a - en * (en ^ a)); Vec3 d = (b - en * (en ^ b)); - T e = c ^ d; - T f = d ^ d; + T e = c ^ d; + T f = d ^ d; if (e >= 0 && e <= f) barycentric.z = e / f; @@ -131,13 +137,13 @@ intersect (const Line3& line, } { - Vec3 en = edge1.normalized(); + Vec3 en = edge1.normalized (); Vec3 a = pt - v1; Vec3 b = v0 - v1; Vec3 c = (a - en * (en ^ a)); Vec3 d = (b - en * (en ^ b)); - T e = c ^ d; - T f = d ^ d; + T e = c ^ d; + T f = d ^ d; if (e >= 0 && e <= f) barycentric.x = e / f; @@ -147,8 +153,7 @@ intersect (const Line3& line, barycentric.y = 1 - barycentric.x - barycentric.z; - if (barycentric.y < 0) - return false; // outside + if (barycentric.y < 0) return false; // outside front = ((line.dir ^ normal) < 0); return true; @@ -161,12 +166,14 @@ intersect (const Line3& line, template IMATH_CONSTEXPR14 Vec3 -closestVertex (const Vec3& v0, const Vec3& v1, const Vec3& v2, const Line3& l) IMATH_NOEXCEPT + closestVertex ( + const Vec3& v0, const Vec3& v1, const Vec3& v2, const Line3& l) + IMATH_NOEXCEPT { Vec3 nearest = v0; - T neardot = (v0 - l.closestPointTo (v0)).length2(); + T neardot = (v0 - l.closestPointTo (v0)).length2 (); - T tmp = (v1 - l.closestPointTo (v1)).length2(); + T tmp = (v1 - l.closestPointTo (v1)).length2 (); if (tmp < neardot) { @@ -174,7 +181,7 @@ closestVertex (const Vec3& v0, const Vec3& v1, const Vec3& v2, const Li nearest = v1; } - tmp = (v2 - l.closestPointTo (v2)).length2(); + tmp = (v2 - l.closestPointTo (v2)).length2 (); if (tmp < neardot) { neardot = tmp; @@ -197,12 +204,12 @@ rotatePoint (const Vec3 p, Line3 l, T angle) IMATH_NOEXCEPT // plane. // - Vec3 q = l.closestPointTo (p); - Vec3 x = p - q; - T radius = x.length(); + Vec3 q = l.closestPointTo (p); + Vec3 x = p - q; + T radius = x.length (); - x.normalize(); - Vec3 y = (x % l.dir).normalize(); + x.normalize (); + Vec3 y = (x % l.dir).normalize (); T cosangle = std::cos (angle); T sinangle = std::sin (angle); diff --git a/third_party/Imath-3.1.9/src/Imath/ImathMath.h b/third_party/Imath/src/Imath/ImathMath.h similarity index 77% rename from third_party/Imath-3.1.9/src/Imath/ImathMath.h rename to third_party/Imath/src/Imath/ImathMath.h index d6551b91..b3d2845a 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathMath.h +++ b/third_party/Imath/src/Imath/ImathMath.h @@ -36,59 +36,59 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER /// @cond Doxygen_Suppress template struct Math { - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T acos (T x) { return std::acos (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T asin (T x) { return std::asin (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T atan (T x) { return std::atan (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T atan2 (T x, T y) { return std::atan2 (x, y); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T cos (T x) { return std::cos (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T sin (T x) { return std::sin (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T tan (T x) { return std::tan (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T cosh (T x) { return std::cosh (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T sinh (T x) { return std::sinh (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T tanh (T x) { return std::tanh (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T exp (T x) { return std::exp (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T log (T x) { return std::log (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T log10 (T x) { return std::log10 (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T modf (T x, T* iptr) { @@ -98,44 +98,43 @@ template struct Math return rval; } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T pow (T x, T y) { return std::pow (x, y); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T sqrt (T x) { return std::sqrt (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T ceil (T x) { return std::ceil (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T fabs (T x) { return std::fabs (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T floor (T x) { return std::floor (x); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T fmod (T x, T y) { return std::fmod (x, y); } - IMATH_DEPRECATED("use std::math functions") + IMATH_DEPRECATED ("use std::math functions") IMATH_HOSTDEVICE static T hypot (T x, T y) { return std::hypot (x, y); } }; /// @endcond - /// Don Hatch's version of sin(x)/x, which is accurate for very small x. /// Returns 1 for x == 0. template IMATH_HOSTDEVICE inline T sinx_over_x (T x) { - if (x * x < std::numeric_limits::epsilon()) + if (x * x < std::numeric_limits::epsilon ()) return T (1); else return std::sin (x) / x; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathMatrix.h b/third_party/Imath/src/Imath/ImathMatrix.h similarity index 67% rename from third_party/Imath-3.1.9/src/Imath/ImathMatrix.h rename to third_party/Imath/src/Imath/ImathMatrix.h index 63e1447e..55f7c05a 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathMatrix.h +++ b/third_party/Imath/src/Imath/ImathMatrix.h @@ -44,16 +44,15 @@ enum IMATH_EXPORT_ENUM Uninitialized template class IMATH_EXPORT_TEMPLATE_TYPE Matrix22 { - public: - +public: /// @{ /// @name Direct access to elements - + /// Matrix elements T x[2][2]; /// @} - + /// Row access IMATH_HOSTDEVICE T* operator[] (int i) IMATH_NOEXCEPT; @@ -70,7 +69,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix22 /// /// 1 0 /// 0 1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22 () IMATH_NOEXCEPT; /// Initialize to scalar constant: /// @@ -87,22 +86,28 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix22 /// /// a b /// c d - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22 (T a, T b, T c, T d) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22 (T a, T b, T c, T d) + IMATH_NOEXCEPT; /// Copy constructor - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22 (const Matrix22& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22 (const Matrix22& v) + IMATH_NOEXCEPT; /// Construct from Matrix22 of another base type - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 explicit Matrix22 (const Matrix22& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 explicit Matrix22 (const Matrix22& v) + IMATH_NOEXCEPT; /// Assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& operator= (const Matrix22& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + operator= (const Matrix22& v) IMATH_NOEXCEPT; /// Assignment from scalar - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& operator= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + operator= (T a) IMATH_NOEXCEPT; /// Destructor - ~Matrix22() IMATH_NOEXCEPT = default; + ~Matrix22 () IMATH_NOEXCEPT = default; /// @} @@ -121,15 +126,19 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix22 /// disabled by defining IMATH_FOREIGN_VECTOR_INTEROP to be 0 prior to /// including any Imath header files. /// - template::value)> + template < + typename M, + IMATH_ENABLE_IF (has_double_subscript::value)> IMATH_HOSTDEVICE explicit Matrix22 (const M& m) - : Matrix22(T(m[0][0]), T(m[0][1]), T(m[1][0]), T(m[1][1])) - { } + : Matrix22 (T (m[0][0]), T (m[0][1]), T (m[1][0]), T (m[1][1])) + {} - template::value)> + template < + typename M, + IMATH_ENABLE_IF (has_double_subscript::value)> IMATH_HOSTDEVICE const Matrix22& operator= (const M& m) { - *this = Matrix22(T(m[0][0]), T(m[0][1]), T(m[1][0]), T(m[1][1])); + *this = Matrix22 (T (m[0][0]), T (m[0][1]), T (m[1][0]), T (m[1][1])); return *this; } /// @} @@ -139,92 +148,112 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix22 /// @name Compatibility with Sb /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE T* getValue() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T* getValue () IMATH_NOEXCEPT; /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE const T* getValue() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const T* getValue () const IMATH_NOEXCEPT; /// Return the value in `v` - template IMATH_HOSTDEVICE void getValue (Matrix22& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void getValue (Matrix22& v) const IMATH_NOEXCEPT; /// Set the value - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22& setValue (const Matrix22& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22& + setValue (const Matrix22& v) IMATH_NOEXCEPT; /// Set the value template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22& setTheMatrix (const Matrix22& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22& + setTheMatrix (const Matrix22& v) IMATH_NOEXCEPT; /// @} /// @{ /// @name Arithmetic and Comparison - + /// Equality - IMATH_HOSTDEVICE constexpr bool operator== (const Matrix22& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator== (const Matrix22& v) const IMATH_NOEXCEPT; /// Inequality - IMATH_HOSTDEVICE constexpr bool operator!= (const Matrix22& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator!= (const Matrix22& v) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and `m` are the same /// with an absolute error of no more than e, i.e., for all i, j: /// /// abs (this[i][j] - m[i][j]) <= e - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithAbsError (const Matrix22& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithAbsError (const Matrix22& v, T e) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and m are the same with /// a relative error of no more than e, i.e., for all i, j: /// /// abs (this[i] - v[i][j]) <= e * abs (this[i][j]) - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithRelError (const Matrix22& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithRelError (const Matrix22& v, T e) const IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& operator+= (const Matrix22& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + operator+= (const Matrix22& v) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& operator+= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + operator+= (T a) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE constexpr Matrix22 operator+ (const Matrix22& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix22 + operator+ (const Matrix22& v) const IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& operator-= (const Matrix22& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + operator-= (const Matrix22& v) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& operator-= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + operator-= (T a) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE constexpr Matrix22 operator- (const Matrix22& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix22 + operator- (const Matrix22& v) const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE constexpr Matrix22 operator-() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix22 operator- () const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& negate() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& negate () IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& operator*= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + operator*= (T a) IMATH_NOEXCEPT; /// Component-wise multiplication IMATH_HOSTDEVICE constexpr Matrix22 operator* (T a) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& operator/= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + operator/= (T a) IMATH_NOEXCEPT; /// Component-wise division IMATH_HOSTDEVICE constexpr Matrix22 operator/ (T a) const IMATH_NOEXCEPT; /// Matrix-matrix multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& operator*= (const Matrix22& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + operator*= (const Matrix22& v) IMATH_NOEXCEPT; /// Matrix-matrix multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22 operator* (const Matrix22& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22 + operator* (const Matrix22& v) const IMATH_NOEXCEPT; /// Vector * matrix multiplication /// @param[in] src Input vector /// @param[out] dst transformed vector - template IMATH_HOSTDEVICE void multDirMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void + multDirMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCEPT; /// @} @@ -232,13 +261,14 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix22 /// @name Maniplation /// Set to the identity - IMATH_HOSTDEVICE void makeIdentity() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeIdentity () IMATH_NOEXCEPT; /// Transpose - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& transpose() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + transpose () IMATH_NOEXCEPT; /// Return the transpose - IMATH_HOSTDEVICE constexpr Matrix22 transposed() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix22 transposed () const IMATH_NOEXCEPT; /// Invert in place /// @param singExc If true, throw an exception if the matrix cannot be inverted. @@ -247,63 +277,86 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix22 /// Invert in place /// @return const reference to this - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& invert() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& invert () IMATH_NOEXCEPT; /// Return the inverse, leaving this unmodified. /// @param singExc If true, throw an exception if the matrix cannot be inverted. IMATH_CONSTEXPR14 Matrix22 inverse (bool singExc) const; /// Return the inverse, leaving this unmodified. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22 inverse() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix22 + inverse () const IMATH_NOEXCEPT; /// Determinant - IMATH_HOSTDEVICE constexpr T determinant() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T determinant () const IMATH_NOEXCEPT; /// Trace IMATH_HOSTDEVICE constexpr T trace() const IMATH_NOEXCEPT; /// Set matrix to rotation by r (in radians) /// @return const referenced to this - template IMATH_HOSTDEVICE const Matrix22& setRotation (S r) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE const Matrix22& setRotation (S r) IMATH_NOEXCEPT; /// Rotate the given matrix by r (in radians) /// @return const referenced to this - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& rotate (S r) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + rotate (S r) IMATH_NOEXCEPT; /// Set matrix to scale by given uniform factor /// @return const referenced to this - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& setScale (T s) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + setScale (T s) IMATH_NOEXCEPT; /// Set matrix to scale by given vector /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& setScale (const Vec2& s) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + setScale (const Vec2& s) IMATH_NOEXCEPT; // Scale the matrix by s /// @return const referenced to this - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& scale (const Vec2& s) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix22& + scale (const Vec2& s) IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Numeric Limits - + /// Largest possible negative value - IMATH_HOSTDEVICE constexpr static T baseTypeLowest() IMATH_NOEXCEPT { return std::numeric_limits::lowest(); } + IMATH_HOSTDEVICE constexpr static T baseTypeLowest () IMATH_NOEXCEPT + { + return std::numeric_limits::lowest (); + } /// Largest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeMax() IMATH_NOEXCEPT { return std::numeric_limits::max(); } + IMATH_HOSTDEVICE constexpr static T baseTypeMax () IMATH_NOEXCEPT + { + return std::numeric_limits::max (); + } /// Smallest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeSmallest() IMATH_NOEXCEPT { return std::numeric_limits::min(); } + IMATH_HOSTDEVICE constexpr static T baseTypeSmallest () IMATH_NOEXCEPT + { + return std::numeric_limits::min (); + } /// Smallest possible e for which 1+e != 1 - IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon() IMATH_NOEXCEPT { return std::numeric_limits::epsilon(); } + IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon () IMATH_NOEXCEPT + { + return std::numeric_limits::epsilon (); + } /// @} - + /// Return the number of the row and column dimensions, i.e. 2. - IMATH_HOSTDEVICE constexpr static unsigned int dimensions() IMATH_NOEXCEPT { return 2; } + IMATH_HOSTDEVICE constexpr static unsigned int dimensions () IMATH_NOEXCEPT + { + return 2; + } /// The base type: In templates that accept a parameter `V`, you /// can refer to `T` as `V::BaseType` @@ -319,16 +372,15 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix22 template class IMATH_EXPORT_TEMPLATE_TYPE Matrix33 { - public: - +public: /// @{ /// @name Direct access to elements - + /// Matrix elements T x[3][3]; /// @} - + /// Row access IMATH_HOSTDEVICE T* operator[] (int i) IMATH_NOEXCEPT; @@ -345,7 +397,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix33 /// 1 0 0 /// 0 1 0 /// 0 0 1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33 () IMATH_NOEXCEPT; /// Initialize to scalar constant /// a a a @@ -362,22 +414,28 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix33 /// a b c /// d e f /// g h i - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33 (T a, T b, T c, T d, T e, T f, T g, T h, T i) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Matrix33 (T a, T b, T c, T d, T e, T f, T g, T h, T i) IMATH_NOEXCEPT; /// Copy constructor - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33 (const Matrix33& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33 (const Matrix33& v) + IMATH_NOEXCEPT; /// Construct from Matrix33 of another base type - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 explicit Matrix33 (const Matrix33& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 explicit Matrix33 (const Matrix33& v) + IMATH_NOEXCEPT; /// Assignment operator - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& operator= (const Matrix33& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + operator= (const Matrix33& v) IMATH_NOEXCEPT; /// Assignment from scalar - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& operator= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + operator= (T a) IMATH_NOEXCEPT; /// Destructor - ~Matrix33() IMATH_NOEXCEPT = default; + ~Matrix33 () IMATH_NOEXCEPT = default; /// @} @@ -396,21 +454,39 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix33 /// disabled by defining IMATH_FOREIGN_VECTOR_INTEROP to be 0 prior to /// including any Imath header files. /// - template::value)> + template < + typename M, + IMATH_ENABLE_IF (has_double_subscript::value)> IMATH_HOSTDEVICE explicit Matrix33 (const M& m) - : Matrix33(T(m[0][0]), T(m[0][1]), T(m[0][2]), - T(m[1][0]), T(m[1][1]), T(m[1][2]), - T(m[2][0]), T(m[2][1]), T(m[2][2])) - { } + : Matrix33 ( + T (m[0][0]), + T (m[0][1]), + T (m[0][2]), + T (m[1][0]), + T (m[1][1]), + T (m[1][2]), + T (m[2][0]), + T (m[2][1]), + T (m[2][2])) + {} /// Interoperability assignment from another type that behaves as if it /// were an equivalent matrix. - template::value)> + template < + typename M, + IMATH_ENABLE_IF (has_double_subscript::value)> IMATH_HOSTDEVICE const Matrix33& operator= (const M& m) { - *this = Matrix33(T(m[0][0]), T(m[0][1]), T(m[0][2]), - T(m[1][0]), T(m[1][1]), T(m[1][2]), - T(m[2][0]), T(m[2][1]), T(m[2][2])); + *this = Matrix33 ( + T (m[0][0]), + T (m[0][1]), + T (m[0][2]), + T (m[1][0]), + T (m[1][1]), + T (m[1][2]), + T (m[2][0]), + T (m[2][1]), + T (m[2][2])); return *this; } /// @} @@ -420,100 +496,122 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix33 /// @name Compatibility with Sb /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE T* getValue() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T* getValue () IMATH_NOEXCEPT; /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE const T* getValue() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const T* getValue () const IMATH_NOEXCEPT; /// Return the value in `v` - template IMATH_HOSTDEVICE void getValue (Matrix33& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void getValue (Matrix33& v) const IMATH_NOEXCEPT; /// Set the value - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33& setValue (const Matrix33& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33& + setValue (const Matrix33& v) IMATH_NOEXCEPT; /// Set the value template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33& setTheMatrix (const Matrix33& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33& + setTheMatrix (const Matrix33& v) IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Arithmetic and Comparison - + /// Equality - IMATH_HOSTDEVICE constexpr bool operator== (const Matrix33& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator== (const Matrix33& v) const IMATH_NOEXCEPT; /// Inequality - IMATH_HOSTDEVICE constexpr bool operator!= (const Matrix33& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator!= (const Matrix33& v) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and `m` are the same /// with an absolute error of no more than e, i.e., for all i, j: /// /// abs (this[i][j] - m[i][j]) <= e - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithAbsError (const Matrix33& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithAbsError (const Matrix33& v, T e) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and m are the same with /// a relative error of no more than e, i.e., for all i, j: /// /// abs (this[i] - v[i][j]) <= e * abs (this[i][j]) - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithRelError (const Matrix33& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithRelError (const Matrix33& v, T e) const IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& operator+= (const Matrix33& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + operator+= (const Matrix33& v) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& operator+= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + operator+= (T a) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE constexpr Matrix33 operator+ (const Matrix33& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix33 + operator+ (const Matrix33& v) const IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& operator-= (const Matrix33& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + operator-= (const Matrix33& v) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& operator-= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + operator-= (T a) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE constexpr Matrix33 operator- (const Matrix33& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix33 + operator- (const Matrix33& v) const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE constexpr Matrix33 operator-() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix33 operator- () const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& negate() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& negate () IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& operator*= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + operator*= (T a) IMATH_NOEXCEPT; /// Component-wise multiplication IMATH_HOSTDEVICE constexpr Matrix33 operator* (T a) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& operator/= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + operator/= (T a) IMATH_NOEXCEPT; /// Component-wise division IMATH_HOSTDEVICE constexpr Matrix33 operator/ (T a) const IMATH_NOEXCEPT; /// Matrix-matrix multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& operator*= (const Matrix33& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + operator*= (const Matrix33& v) IMATH_NOEXCEPT; /// Matrix-matrix multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33 operator* (const Matrix33& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33 + operator* (const Matrix33& v) const IMATH_NOEXCEPT; /// Vector-matrix multiplication: a homogeneous transformation /// by computing Vec3 (src.x, src.y, 1) * m and dividing by the /// result's third element. /// @param[in] src The input vector /// @param[out] dst The output vector - template IMATH_HOSTDEVICE void multVecMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void + multVecMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCEPT; /// Vector-matrix multiplication: multiply `src` by the upper left 2x2 /// submatrix, ignoring the rest of matrix. /// @param[in] src The input vector /// @param[out] dst The output vector - template IMATH_HOSTDEVICE void multDirMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void + multDirMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCEPT; /// @} @@ -521,13 +619,14 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix33 /// @name Maniplation /// Set to the identity matrix - IMATH_HOSTDEVICE void makeIdentity() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeIdentity () IMATH_NOEXCEPT; /// Transpose - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& transpose() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + transpose () IMATH_NOEXCEPT; /// Return the transpose - IMATH_HOSTDEVICE constexpr Matrix33 transposed() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix33 transposed () const IMATH_NOEXCEPT; /// Invert in place using the determinant. /// @param singExc If true, throw an exception if the matrix cannot be inverted. @@ -536,25 +635,26 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix33 /// Invert in place using the determinant. /// @return const reference to this - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& invert() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& invert () IMATH_NOEXCEPT; /// Return the inverse using the determinant, leaving this unmodified. /// @param singExc If true, throw an exception if the matrix cannot be inverted. IMATH_CONSTEXPR14 Matrix33 inverse (bool singExc) const; /// Return the inverse using the determinant, leaving this unmodified. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33 inverse() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix33 + inverse () const IMATH_NOEXCEPT; /// Invert in place using the Gauss-Jordan method. Significantly slower /// but more accurate than invert(). /// @param singExc If true, throw an exception if the matrix cannot be inverted. /// @return const reference to this const Matrix33& gjInvert (bool singExc); - + /// Invert in place using the Gauss-Jordan method. Significantly slower /// but more accurate than invert(). /// @return const reference to this - IMATH_HOSTDEVICE const Matrix33& gjInvert() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const Matrix33& gjInvert () IMATH_NOEXCEPT; /// Return the inverse using the Gauss-Jordan method, leaving this /// unmodified. Significantly slower but more accurate than inverse(). @@ -562,95 +662,129 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix33 /// Return the inverse using the Gauss-Jordan method. Significantly slower, /// leaving this unmodified. Slower but more accurate than inverse(). - IMATH_HOSTDEVICE Matrix33 gjInverse() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Matrix33 gjInverse () const IMATH_NOEXCEPT; /// Calculate the matrix minor of the (r,c) element - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T minorOf (const int r, const int c) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T + minorOf (const int r, const int c) const IMATH_NOEXCEPT; /// Build a minor using the specified rows and columns IMATH_HOSTDEVICE - constexpr T fastMinor (const int r0, const int r1, const int c0, const int c1) const IMATH_NOEXCEPT; + constexpr T + fastMinor (const int r0, const int r1, const int c0, const int c1) const + IMATH_NOEXCEPT; /// Determinant - IMATH_HOSTDEVICE constexpr T determinant() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T determinant () const IMATH_NOEXCEPT; /// Trace IMATH_HOSTDEVICE constexpr T trace() const IMATH_NOEXCEPT; - /// Set matrix to rotation by r (in radians) + /// Set matrix to rotation by r (in radians, assumed to be a scalar) around (0, 0, 1) /// @return const referenced to this - template IMATH_HOSTDEVICE const Matrix33& setRotation (S r) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE const Matrix33& setRotation (S r) IMATH_NOEXCEPT; // Rotate the given matrix by r (in radians) /// @return const referenced to this - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& rotate (S r) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + rotate (S r) IMATH_NOEXCEPT; /// Set matrix to scale by given uniform factor /// @return const referenced to this - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& setScale (T s) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + setScale (T s) IMATH_NOEXCEPT; /// Set matrix to scale by given vector /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& setScale (const Vec2& s) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + setScale (const Vec2& s) IMATH_NOEXCEPT; /// Scale the matrix by s /// @return const referenced to this - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& scale (const Vec2& s) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + scale (const Vec2& s) IMATH_NOEXCEPT; /// Set matrix to translation by given vector /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& setTranslation (const Vec2& t) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + setTranslation (const Vec2& t) IMATH_NOEXCEPT; /// Return the translation component - IMATH_HOSTDEVICE constexpr Vec2 translation() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec2 translation () const IMATH_NOEXCEPT; /// Translate the matrix by t /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& translate (const Vec2& t) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + translate (const Vec2& t) IMATH_NOEXCEPT; /// Set matrix to shear x for each y coord. by given factor xy /// @return const referenced to this - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& setShear (const S& h) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + setShear (const S& h) IMATH_NOEXCEPT; /// Set matrix to shear x for each y coord. by given factor h.x /// and to shear y for each x coord. by given factor h.y /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& setShear (const Vec2& h) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + setShear (const Vec2& h) IMATH_NOEXCEPT; /// Shear the matrix in x for each y coord. by given factor xy /// @return const referenced to this - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& shear (const S& xy) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + shear (const S& xy) IMATH_NOEXCEPT; /// Shear the matrix in x for each y coord. by given factor xy /// and shear y for each x coord. by given factor yx /// @return const referenced to this - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& shear (const Vec2& h) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix33& + shear (const Vec2& h) IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Numeric Limits - + /// Largest possible negative value - IMATH_HOSTDEVICE constexpr static T baseTypeLowest() IMATH_NOEXCEPT { return std::numeric_limits::lowest(); } + IMATH_HOSTDEVICE constexpr static T baseTypeLowest () IMATH_NOEXCEPT + { + return std::numeric_limits::lowest (); + } /// Largest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeMax() IMATH_NOEXCEPT { return std::numeric_limits::max(); } + IMATH_HOSTDEVICE constexpr static T baseTypeMax () IMATH_NOEXCEPT + { + return std::numeric_limits::max (); + } /// Smallest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeSmallest() IMATH_NOEXCEPT { return std::numeric_limits::min(); } + IMATH_HOSTDEVICE constexpr static T baseTypeSmallest () IMATH_NOEXCEPT + { + return std::numeric_limits::min (); + } /// Smallest possible e for which 1+e != 1 - IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon() IMATH_NOEXCEPT { return std::numeric_limits::epsilon(); } + IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon () IMATH_NOEXCEPT + { + return std::numeric_limits::epsilon (); + } /// @} - + /// Return the number of the row and column dimensions, i.e. 3. - IMATH_HOSTDEVICE constexpr static unsigned int dimensions() IMATH_NOEXCEPT { return 3; } + IMATH_HOSTDEVICE constexpr static unsigned int dimensions () IMATH_NOEXCEPT + { + return 3; + } /// The base type: In templates that accept a parameter `V` (could be a Color4), you can refer to `T` as `V::BaseType` typedef T BaseType; @@ -665,16 +799,15 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix33 template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 { - public: - +public: /// @{ /// @name Direct access to elements - + /// Matrix elements T x[4][4]; /// @} - + /// Row access IMATH_HOSTDEVICE T* operator[] (int i) IMATH_NOEXCEPT; @@ -692,7 +825,7 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// 0 1 0 0 /// 0 0 1 0 /// 0 0 0 1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 () IMATH_NOEXCEPT; /// Initialize to scalar constant /// a a a a @@ -712,31 +845,51 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// e f g h /// i j k l /// m n o p - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 - Matrix44 (T a, T b, T c, T d, T e, T f, T g, T h, T i, T j, T k, T l, T m, T n, T o, T p) IMATH_NOEXCEPT; - + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 ( + T a, + T b, + T c, + T d, + T e, + T f, + T g, + T h, + T i, + T j, + T k, + T l, + T m, + T n, + T o, + T p) IMATH_NOEXCEPT; /// Construct from a 3x3 rotation matrix and a translation vector /// r r r 0 /// r r r 0 /// r r r 0 /// t t t 1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 (Matrix33 r, Vec3 t) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 (Matrix33 r, Vec3 t) + IMATH_NOEXCEPT; /// Copy constructor - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 (const Matrix44& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 (const Matrix44& v) + IMATH_NOEXCEPT; /// Construct from Matrix44 of another base type - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 explicit Matrix44 (const Matrix44& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 explicit Matrix44 (const Matrix44& v) + IMATH_NOEXCEPT; /// Assignment operator - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& operator= (const Matrix44& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + operator= (const Matrix44& v) IMATH_NOEXCEPT; /// Assignment from scalar - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& operator= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + operator= (T a) IMATH_NOEXCEPT; /// Destructor - ~Matrix44() IMATH_NOEXCEPT = default; + ~Matrix44 () IMATH_NOEXCEPT = default; /// @} @@ -755,23 +908,53 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// disabled by defining IMATH_FOREIGN_VECTOR_INTEROP to be 0 prior to /// including any Imath header files. /// - template::value)> + template < + typename M, + IMATH_ENABLE_IF (has_double_subscript::value)> IMATH_HOSTDEVICE explicit Matrix44 (const M& m) - : Matrix44(T(m[0][0]), T(m[0][1]), T(m[0][2]), T(m[0][3]), - T(m[1][0]), T(m[1][1]), T(m[1][2]), T(m[1][3]), - T(m[2][0]), T(m[2][1]), T(m[2][2]), T(m[2][3]), - T(m[3][0]), T(m[3][1]), T(m[3][2]), T(m[3][3])) - { } + : Matrix44 ( + T (m[0][0]), + T (m[0][1]), + T (m[0][2]), + T (m[0][3]), + T (m[1][0]), + T (m[1][1]), + T (m[1][2]), + T (m[1][3]), + T (m[2][0]), + T (m[2][1]), + T (m[2][2]), + T (m[2][3]), + T (m[3][0]), + T (m[3][1]), + T (m[3][2]), + T (m[3][3])) + {} /// Interoperability assignment from another type that behaves as if it /// were an equivalent matrix. - template::value)> + template < + typename M, + IMATH_ENABLE_IF (has_double_subscript::value)> IMATH_HOSTDEVICE const Matrix44& operator= (const M& m) { - *this = Matrix44(T(m[0][0]), T(m[0][1]), T(m[0][2]), T(m[0][3]), - T(m[1][0]), T(m[1][1]), T(m[1][2]), T(m[1][3]), - T(m[2][0]), T(m[2][1]), T(m[2][2]), T(m[2][3]), - T(m[3][0]), T(m[3][1]), T(m[3][2]), T(m[3][3])); + *this = Matrix44 ( + T (m[0][0]), + T (m[0][1]), + T (m[0][2]), + T (m[0][3]), + T (m[1][0]), + T (m[1][1]), + T (m[1][2]), + T (m[1][3]), + T (m[2][0]), + T (m[2][1]), + T (m[2][2]), + T (m[2][3]), + T (m[3][0]), + T (m[3][1]), + T (m[3][2]), + T (m[3][3])); return *this; } /// @} @@ -781,110 +964,134 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// @name Compatibility with Sb /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE T* getValue() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T* getValue () IMATH_NOEXCEPT; /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE const T* getValue() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const T* getValue () const IMATH_NOEXCEPT; /// Return the value in `v` - template IMATH_HOSTDEVICE void getValue (Matrix44& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void getValue (Matrix44& v) const IMATH_NOEXCEPT; /// Set the value - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44& setValue (const Matrix44& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44& + setValue (const Matrix44& v) IMATH_NOEXCEPT; /// Set the value template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44& setTheMatrix (const Matrix44& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44& + setTheMatrix (const Matrix44& v) IMATH_NOEXCEPT; /// @} /// @{ /// @name Arithmetic and Comparison - + /// Equality - IMATH_HOSTDEVICE constexpr bool operator== (const Matrix44& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator== (const Matrix44& v) const IMATH_NOEXCEPT; /// Inequality - IMATH_HOSTDEVICE constexpr bool operator!= (const Matrix44& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr bool + operator!= (const Matrix44& v) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and `m` are the same /// with an absolute error of no more than e, i.e., for all i, j: /// /// abs (this[i][j] - m[i][j]) <= e - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithAbsError (const Matrix44& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithAbsError (const Matrix44& v, T e) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and m are the same with /// a relative error of no more than e, i.e., for all i, j: /// /// abs (this[i] - v[i][j]) <= e * abs (this[i][j]) - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithRelError (const Matrix44& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithRelError (const Matrix44& v, T e) const IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& operator+= (const Matrix44& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + operator+= (const Matrix44& v) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& operator+= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + operator+= (T a) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE constexpr Matrix44 operator+ (const Matrix44& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix44 + operator+ (const Matrix44& v) const IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& operator-= (const Matrix44& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + operator-= (const Matrix44& v) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& operator-= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + operator-= (T a) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE constexpr Matrix44 operator- (const Matrix44& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix44 + operator- (const Matrix44& v) const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE constexpr Matrix44 operator-() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix44 operator- () const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& negate() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& negate () IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& operator*= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + operator*= (T a) IMATH_NOEXCEPT; /// Component-wise multiplication IMATH_HOSTDEVICE constexpr Matrix44 operator* (T a) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& operator/= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + operator/= (T a) IMATH_NOEXCEPT; /// Component-wise division IMATH_HOSTDEVICE constexpr Matrix44 operator/ (T a) const IMATH_NOEXCEPT; /// Matrix-matrix multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& operator*= (const Matrix44& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + operator*= (const Matrix44& v) IMATH_NOEXCEPT; /// Matrix-matrix multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 operator* (const Matrix44& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 + operator* (const Matrix44& v) const IMATH_NOEXCEPT; /// Matrix-matrix multiplication: compute c = a * b IMATH_HOSTDEVICE - static void multiply (const Matrix44& a, // assumes that - const Matrix44& b, // &a != &c and - Matrix44& c) IMATH_NOEXCEPT; // &b != &c. + static void multiply ( + const Matrix44& a, // assumes that + const Matrix44& b, // &a != &c and + Matrix44& c) IMATH_NOEXCEPT; // &b != &c. /// Matrix-matrix multiplication returning a result. IMATH_HOSTDEVICE - static IMATH_CONSTEXPR14 Matrix44 multiply (const Matrix44& a, const Matrix44& b) IMATH_NOEXCEPT; + static IMATH_CONSTEXPR14 Matrix44 + multiply (const Matrix44& a, const Matrix44& b) IMATH_NOEXCEPT; /// Vector-matrix multiplication: a homogeneous transformation /// by computing Vec3 (src.x, src.y, src.z, 1) * m and dividing by the /// result's third element. /// @param[in] src The input vector /// @param[out] dst The output vector - template IMATH_HOSTDEVICE void multVecMatrix (const Vec3& src, Vec3& dst) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void + multVecMatrix (const Vec3& src, Vec3& dst) const IMATH_NOEXCEPT; /// Vector-matrix multiplication: multiply `src` by the upper left 2x2 /// submatrix, ignoring the rest of matrix. /// @param[in] src The input vector /// @param[out] dst The output vector - template IMATH_HOSTDEVICE void multDirMatrix (const Vec3& src, Vec3& dst) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void + multDirMatrix (const Vec3& src, Vec3& dst) const IMATH_NOEXCEPT; /// @} @@ -892,13 +1099,14 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// @name Maniplation /// Set to the identity matrix - IMATH_HOSTDEVICE void makeIdentity() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void makeIdentity () IMATH_NOEXCEPT; /// Transpose - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& transpose() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + transpose () IMATH_NOEXCEPT; /// Return the transpose - IMATH_HOSTDEVICE constexpr Matrix44 transposed() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix44 transposed () const IMATH_NOEXCEPT; /// Invert in place using the determinant. /// @param singExc If true, throw an exception if the matrix cannot be inverted. @@ -907,14 +1115,15 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// Invert in place using the determinant. /// @return const reference to this - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& invert() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& invert () IMATH_NOEXCEPT; /// Return the inverse using the determinant, leaving this unmodified. /// @param singExc If true, throw an exception if the matrix cannot be inverted. IMATH_CONSTEXPR14 Matrix44 inverse (bool singExc) const; /// Return the inverse using the determinant, leaving this unmodified. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 inverse() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Matrix44 + inverse () const IMATH_NOEXCEPT; /// Invert in place using the Gauss-Jordan method. Significantly slower /// but more accurate than invert(). @@ -925,7 +1134,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// Invert in place using the Gauss-Jordan method. Significantly slower /// but more accurate than invert(). /// @return const reference to this - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& gjInvert() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + gjInvert () IMATH_NOEXCEPT; /// Return the inverse using the Gauss-Jordan method, leaving this /// unmodified. Significantly slower but more accurate than inverse(). @@ -933,64 +1143,77 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// Return the inverse using the Gauss-Jordan method, leaving this /// unmodified Significantly slower but more accurate than inverse(). - IMATH_HOSTDEVICE Matrix44 gjInverse() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Matrix44 gjInverse () const IMATH_NOEXCEPT; /// Calculate the matrix minor of the (r,c) element - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T minorOf (const int r, const int c) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T + minorOf (const int r, const int c) const IMATH_NOEXCEPT; /// Build a minor using the specified rows and columns IMATH_HOSTDEVICE - constexpr T fastMinor (const int r0, - const int r1, - const int r2, - const int c0, - const int c1, - const int c2) const IMATH_NOEXCEPT; + constexpr T fastMinor ( + const int r0, + const int r1, + const int r2, + const int c0, + const int c1, + const int c2) const IMATH_NOEXCEPT; /// Determinant - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T determinant() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T determinant () const IMATH_NOEXCEPT; /// Trace IMATH_HOSTDEVICE constexpr T trace() const IMATH_NOEXCEPT; /// Set matrix to rotation by XYZ euler angles (in radians) /// @return const referenced to this - template IMATH_HOSTDEVICE const Matrix44& setEulerAngles (const Vec3& r) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE const Matrix44& + setEulerAngles (const Vec3& r) IMATH_NOEXCEPT; /// Set matrix to rotation around given axis by given angle (in radians) /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& setAxisAngle (const Vec3& ax, S ang) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + setAxisAngle (const Vec3& ax, S ang) IMATH_NOEXCEPT; /// Rotate the matrix by XYZ euler angles in r (in radians) /// @return const referenced to this - template IMATH_HOSTDEVICE const Matrix44& rotate (const Vec3& r) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE const Matrix44& rotate (const Vec3& r) IMATH_NOEXCEPT; /// Set matrix to scale by given uniform factor /// @return const referenced to this - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& setScale (T s) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + setScale (T s) IMATH_NOEXCEPT; /// Set matrix to scale by given vector /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& setScale (const Vec3& s) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + setScale (const Vec3& s) IMATH_NOEXCEPT; /// Scale the matrix by s /// @return const referenced to this - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& scale (const Vec3& s) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + scale (const Vec3& s) IMATH_NOEXCEPT; /// Set matrix to translation by given vector /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& setTranslation (const Vec3& t) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + setTranslation (const Vec3& t) IMATH_NOEXCEPT; /// Return translation component - IMATH_HOSTDEVICE constexpr const Vec3 translation() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr const Vec3 + translation () const IMATH_NOEXCEPT; /// Translate the matrix by t /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& translate (const Vec3& t) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + translate (const Vec3& t) IMATH_NOEXCEPT; /// Set matrix to shear by given vector h. The resulting matrix /// - will shear x for each y coord. by a factor of h[0] ; @@ -998,7 +1221,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// - will shear y for each z coord. by a factor of h[2] . /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& setShear (const Vec3& h) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + setShear (const Vec3& h) IMATH_NOEXCEPT; /// Set matrix to shear by given factors. The resulting matrix /// - will shear x for each y coord. by a factor of h.xy ; @@ -1009,7 +1233,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// - will shear z for each y coord. by a factor of h.zy . /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& setShear (const Shear6& h) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + setShear (const Shear6& h) IMATH_NOEXCEPT; /// Shear the matrix by given vector. The composed matrix /// will be `shear` * `this`, where the shear matrix ... @@ -1017,7 +1242,9 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// - will shear x for each z coord. by a factor of h[1] ; /// - will shear y for each z coord. by a factor of h[2] . /// @return const referenced to this - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& shear (const Vec3& h) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + shear (const Vec3& h) IMATH_NOEXCEPT; /// Shear the matrix by the given factors. The composed matrix /// will be `shear` * `this`, where the shear matrix ... @@ -1029,29 +1256,45 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// - will shear z for each y coord. by a factor of h.zy . /// @return const referenced to this template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& shear (const Shear6& h) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Matrix44& + shear (const Shear6& h) IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Numeric Limits - + /// Largest possible negative value - IMATH_HOSTDEVICE constexpr static T baseTypeLowest() IMATH_NOEXCEPT { return std::numeric_limits::lowest(); } + IMATH_HOSTDEVICE constexpr static T baseTypeLowest () IMATH_NOEXCEPT + { + return std::numeric_limits::lowest (); + } /// Largest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeMax() IMATH_NOEXCEPT { return std::numeric_limits::max(); } + IMATH_HOSTDEVICE constexpr static T baseTypeMax () IMATH_NOEXCEPT + { + return std::numeric_limits::max (); + } /// Smallest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeSmallest() IMATH_NOEXCEPT { return std::numeric_limits::min(); } + IMATH_HOSTDEVICE constexpr static T baseTypeSmallest () IMATH_NOEXCEPT + { + return std::numeric_limits::min (); + } /// Smallest possible e for which 1+e != 1 - IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon() IMATH_NOEXCEPT { return std::numeric_limits::epsilon(); } + IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon () IMATH_NOEXCEPT + { + return std::numeric_limits::epsilon (); + } /// @} - + /// Return the number of the row and column dimensions, i.e. 4 - IMATH_HOSTDEVICE constexpr static unsigned int dimensions() IMATH_NOEXCEPT { return 4; } + IMATH_HOSTDEVICE constexpr static unsigned int dimensions () IMATH_NOEXCEPT + { + return 4; + } /// The base type: In templates that accept a parameter `V` (could be a Color4), you can refer to `T` as `V::BaseType` typedef T BaseType; @@ -1063,13 +1306,15 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Matrix44 /// Stream output, as: /// (m00 m01 /// m10 m11) -template std::ostream& operator<< (std::ostream& s, const Matrix22& m); +template +std::ostream& operator<< (std::ostream& s, const Matrix22& m); /// Stream output, as: /// (m00 m01 m02 /// m10 m11 m12 /// m20 m21 m22) -template std::ostream& operator<< (std::ostream& s, const Matrix33& m); +template +std::ostream& operator<< (std::ostream& s, const Matrix33& m); /// Stream output, as: /// @@ -1077,7 +1322,8 @@ template std::ostream& operator<< (std::ostream& s, const Matrix33& /// m10 m11 m12 m13 /// m20 m21 m22 m23 /// m30 m31 m32 m33) -template std::ostream& operator<< (std::ostream& s, const Matrix44& m); +template +std::ostream& operator<< (std::ostream& s, const Matrix44& m); //--------------------------------------------- // Vector-times-matrix multiplication operators @@ -1085,43 +1331,53 @@ template std::ostream& operator<< (std::ostream& s, const Matrix44& /// Vector-matrix multiplication: v *= m template -IMATH_HOSTDEVICE inline const Vec2& operator*= (Vec2& v, const Matrix22& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline const Vec2& +operator*= (Vec2& v, const Matrix22& m) IMATH_NOEXCEPT; /// Vector-matrix multiplication: r = v * m template -IMATH_HOSTDEVICE inline Vec2 operator* (const Vec2& v, const Matrix22& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline Vec2 +operator* (const Vec2& v, const Matrix22& m) IMATH_NOEXCEPT; /// Vector-matrix multiplication: v *= m template -IMATH_HOSTDEVICE inline const Vec2& operator*= (Vec2& v, const Matrix33& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline const Vec2& +operator*= (Vec2& v, const Matrix33& m) IMATH_NOEXCEPT; /// Vector-matrix multiplication: r = v * m template -IMATH_HOSTDEVICE inline Vec2 operator* (const Vec2& v, const Matrix33& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline Vec2 +operator* (const Vec2& v, const Matrix33& m) IMATH_NOEXCEPT; /// Vector-matrix multiplication: v *= m template -IMATH_HOSTDEVICE inline const Vec3& operator*= (Vec3& v, const Matrix33& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline const Vec3& +operator*= (Vec3& v, const Matrix33& m) IMATH_NOEXCEPT; /// Vector-matrix multiplication: r = v * m template -IMATH_HOSTDEVICE inline Vec3 operator* (const Vec3& v, const Matrix33& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline Vec3 +operator* (const Vec3& v, const Matrix33& m) IMATH_NOEXCEPT; /// Vector-matrix multiplication: v *= m template -IMATH_HOSTDEVICE inline const Vec3& operator*= (Vec3& v, const Matrix44& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline const Vec3& +operator*= (Vec3& v, const Matrix44& m) IMATH_NOEXCEPT; /// Vector-matrix multiplication: r = v * m template -IMATH_HOSTDEVICE inline Vec3 operator* (const Vec3& v, const Matrix44& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline Vec3 +operator* (const Vec3& v, const Matrix44& m) IMATH_NOEXCEPT; /// Vector-matrix multiplication: v *= m template -IMATH_HOSTDEVICE inline const Vec4& operator*= (Vec4& v, const Matrix44& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline const Vec4& +operator*= (Vec4& v, const Matrix44& m) IMATH_NOEXCEPT; /// Vector-matrix multiplication: r = v * m template -IMATH_HOSTDEVICE inline Vec4 operator* (const Vec4& v, const Matrix44& m) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE inline Vec4 +operator* (const Vec4& v, const Matrix44& m) IMATH_NOEXCEPT; //------------------------- // Typedefs for convenience @@ -1163,7 +1419,9 @@ Matrix22::operator[] (int i) const IMATH_NOEXCEPT return x[i]; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22::Matrix22() IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE + IMATH_CONSTEXPR14 inline Matrix22::Matrix22 () IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -1171,7 +1429,9 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22::Matrix x[1][1] = 1; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22::Matrix22 (T a) IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE + IMATH_CONSTEXPR14 inline Matrix22::Matrix22 (T a) IMATH_NOEXCEPT { x[0][0] = a; x[0][1] = a; @@ -1203,7 +1463,9 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22::Matrix22 ( x[1][1] = d; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22::Matrix22 (const Matrix22& v) IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22::Matrix22 ( + const Matrix22& v) IMATH_NOEXCEPT { // Function calls and aliasing issues can inhibit vectorization versus // straight assignment of data members, so we don't do this: @@ -1217,7 +1479,8 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22::Matrix template template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22::Matrix22 (const Matrix22& v) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22::Matrix22 ( + const Matrix22& v) IMATH_NOEXCEPT { x[0][0] = T (v.x[0][0]); x[0][1] = T (v.x[0][1]); @@ -1260,7 +1523,7 @@ Matrix22::getValue () IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline const T* -Matrix22::getValue() const IMATH_NOEXCEPT +Matrix22::getValue () const IMATH_NOEXCEPT { return (const T*) &x[0][0]; } @@ -1279,7 +1542,7 @@ Matrix22::getValue (Matrix22& v) const IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22& -Matrix22::setValue (const Matrix22& v) IMATH_NOEXCEPT + Matrix22::setValue (const Matrix22& v) IMATH_NOEXCEPT { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; @@ -1291,7 +1554,7 @@ Matrix22::setValue (const Matrix22& v) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22& -Matrix22::setTheMatrix (const Matrix22& v) IMATH_NOEXCEPT + Matrix22::setTheMatrix (const Matrix22& v) IMATH_NOEXCEPT { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; @@ -1302,7 +1565,7 @@ Matrix22::setTheMatrix (const Matrix22& v) IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline void -Matrix22::makeIdentity() IMATH_NOEXCEPT +Matrix22::makeIdentity () IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -1314,16 +1577,16 @@ template IMATH_HOSTDEVICE constexpr inline bool Matrix22::operator== (const Matrix22& v) const IMATH_NOEXCEPT { - return x[0][0] == v.x[0][0] && x[0][1] == v.x[0][1] && x[1][0] == v.x[1][0] && - x[1][1] == v.x[1][1]; + return x[0][0] == v.x[0][0] && x[0][1] == v.x[0][1] && + x[1][0] == v.x[1][0] && x[1][1] == v.x[1][1]; } template IMATH_HOSTDEVICE constexpr inline bool Matrix22::operator!= (const Matrix22& v) const IMATH_NOEXCEPT { - return x[0][0] != v.x[0][0] || x[0][1] != v.x[0][1] || x[1][0] != v.x[1][0] || - x[1][1] != v.x[1][1]; + return x[0][0] != v.x[0][0] || x[0][1] != v.x[0][1] || + x[1][0] != v.x[1][0] || x[1][1] != v.x[1][1]; } template @@ -1332,7 +1595,8 @@ Matrix22::equalWithAbsError (const Matrix22& m, T e) const IMATH_NOEXCEPT { for (int i = 0; i < 2; i++) for (int j = 0; j < 2; j++) - if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ((*this).x[i][j], m.x[i][j], e)) + if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ( + (*this).x[i][j], m.x[i][j], e)) return false; return true; @@ -1344,7 +1608,8 @@ Matrix22::equalWithRelError (const Matrix22& m, T e) const IMATH_NOEXCEPT { for (int i = 0; i < 2; i++) for (int j = 0; j < 2; j++) - if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ((*this).x[i][j], m.x[i][j], e)) + if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ( + (*this).x[i][j], m.x[i][j], e)) return false; return true; @@ -1378,10 +1643,11 @@ template IMATH_HOSTDEVICE constexpr inline Matrix22 Matrix22::operator+ (const Matrix22& v) const IMATH_NOEXCEPT { - return Matrix22 (x[0][0] + v.x[0][0], - x[0][1] + v.x[0][1], - x[1][0] + v.x[1][0], - x[1][1] + v.x[1][1]); + return Matrix22 ( + x[0][0] + v.x[0][0], + x[0][1] + v.x[0][1], + x[1][0] + v.x[1][0], + x[1][1] + v.x[1][1]); } template @@ -1412,22 +1678,23 @@ template IMATH_HOSTDEVICE constexpr inline Matrix22 Matrix22::operator- (const Matrix22& v) const IMATH_NOEXCEPT { - return Matrix22 (x[0][0] - v.x[0][0], - x[0][1] - v.x[0][1], - x[1][0] - v.x[1][0], - x[1][1] - v.x[1][1]); + return Matrix22 ( + x[0][0] - v.x[0][0], + x[0][1] - v.x[0][1], + x[1][0] - v.x[1][0], + x[1][1] - v.x[1][1]); } template IMATH_HOSTDEVICE constexpr inline Matrix22 -Matrix22::operator-() const IMATH_NOEXCEPT +Matrix22::operator- () const IMATH_NOEXCEPT { return Matrix22 (-x[0][0], -x[0][1], -x[1][0], -x[1][1]); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix22& -Matrix22::negate() IMATH_NOEXCEPT + Matrix22::negate () IMATH_NOEXCEPT { x[0][0] = -x[0][0]; x[0][1] = -x[0][1]; @@ -1496,7 +1763,8 @@ Matrix22::operator* (const Matrix22& v) const IMATH_NOEXCEPT template template IMATH_HOSTDEVICE inline void -Matrix22::multDirMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCEPT +Matrix22::multDirMatrix (const Vec2& src, Vec2& dst) const + IMATH_NOEXCEPT { S a, b; @@ -1528,7 +1796,7 @@ Matrix22::operator/ (T a) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix22& -Matrix22::transpose() IMATH_NOEXCEPT + Matrix22::transpose () IMATH_NOEXCEPT { Matrix22 tmp (x[0][0], x[1][0], x[0][1], x[1][1]); *this = tmp; @@ -1537,7 +1805,7 @@ Matrix22::transpose() IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline Matrix22 -Matrix22::transposed() const IMATH_NOEXCEPT +Matrix22::transposed () const IMATH_NOEXCEPT { return Matrix22 (x[0][0], x[1][0], x[0][1], x[1][1]); } @@ -1552,9 +1820,9 @@ Matrix22::invert (bool singExc) template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix22& -Matrix22::invert() IMATH_NOEXCEPT + Matrix22::invert () IMATH_NOEXCEPT { - *this = inverse(); + *this = inverse (); return *this; } @@ -1578,7 +1846,8 @@ Matrix22::inverse (bool singExc) const } else { - T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min(); + T mr = + IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min (); for (int i = 0; i < 2; ++i) { @@ -1593,7 +1862,7 @@ Matrix22::inverse (bool singExc) const if (singExc) throw std::invalid_argument ("Cannot invert " "singular matrix."); - return Matrix22(); + return Matrix22 (); } } } @@ -1603,7 +1872,7 @@ Matrix22::inverse (bool singExc) const template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix22 -Matrix22::inverse() const IMATH_NOEXCEPT + Matrix22::inverse () const IMATH_NOEXCEPT { Matrix22 s (x[1][1], -x[0][1], -x[1][0], x[0][0]); @@ -1621,7 +1890,8 @@ Matrix22::inverse() const IMATH_NOEXCEPT } else { - T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min(); + T mr = + IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min (); for (int i = 0; i < 2; ++i) { @@ -1633,7 +1903,7 @@ Matrix22::inverse() const IMATH_NOEXCEPT } else { - return Matrix22(); + return Matrix22 (); } } } @@ -1643,7 +1913,7 @@ Matrix22::inverse() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline T -Matrix22::determinant() const IMATH_NOEXCEPT +Matrix22::determinant () const IMATH_NOEXCEPT { return x[0][0] * x[1][1] - x[1][0] * x[0][1]; } @@ -1677,9 +1947,9 @@ Matrix22::setRotation (S r) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix22& -Matrix22::rotate (S r) IMATH_NOEXCEPT + Matrix22::rotate (S r) IMATH_NOEXCEPT { - *this *= Matrix22().setRotation (r); + *this *= Matrix22 ().setRotation (r); return *this; } @@ -1704,7 +1974,7 @@ Matrix22::setScale (T s) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix22& -Matrix22::setScale (const Vec2& s) IMATH_NOEXCEPT + Matrix22::setScale (const Vec2& s) IMATH_NOEXCEPT { // // Set the matrix to: @@ -1723,7 +1993,7 @@ Matrix22::setScale (const Vec2& s) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix22& -Matrix22::scale (const Vec2& s) IMATH_NOEXCEPT + Matrix22::scale (const Vec2& s) IMATH_NOEXCEPT { x[0][0] *= s.x; x[0][1] *= s.x; @@ -1754,7 +2024,7 @@ Matrix33::operator[] (int i) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline IMATH_CONSTEXPR14 -Matrix33::Matrix33() IMATH_NOEXCEPT +Matrix33::Matrix33 () IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -1767,7 +2037,9 @@ Matrix33::Matrix33() IMATH_NOEXCEPT x[2][2] = 1; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 (T a) IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE + IMATH_CONSTEXPR14 inline Matrix33::Matrix33 (T a) IMATH_NOEXCEPT { x[0][0] = a; x[0][1] = a; @@ -1800,7 +2072,8 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 ( } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 (T a, T b, T c, T d, T e, T f, T g, T h, T i) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 ( + T a, T b, T c, T d, T e, T f, T g, T h, T i) IMATH_NOEXCEPT { x[0][0] = a; x[0][1] = b; @@ -1814,7 +2087,8 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 (T a, T b, T c, } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 (const Matrix33& v) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 ( + const Matrix33& v) IMATH_NOEXCEPT { // Function calls and aliasing issues can inhibit vectorization versus // straight assignment of data members, so instead of this: @@ -1833,7 +2107,8 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 (const Matrix33& template template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 (const Matrix33& v) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33::Matrix33 ( + const Matrix33& v) IMATH_NOEXCEPT { x[0][0] = T (v.x[0][0]); x[0][1] = T (v.x[0][1]); @@ -1891,7 +2166,7 @@ Matrix33::getValue () IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline const T* -Matrix33::getValue() const IMATH_NOEXCEPT +Matrix33::getValue () const IMATH_NOEXCEPT { return (const T*) &x[0][0]; } @@ -1915,7 +2190,7 @@ Matrix33::getValue (Matrix33& v) const IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33& -Matrix33::setValue (const Matrix33& v) IMATH_NOEXCEPT + Matrix33::setValue (const Matrix33& v) IMATH_NOEXCEPT { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; @@ -1932,7 +2207,7 @@ Matrix33::setValue (const Matrix33& v) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix33& -Matrix33::setTheMatrix (const Matrix33& v) IMATH_NOEXCEPT + Matrix33::setTheMatrix (const Matrix33& v) IMATH_NOEXCEPT { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; @@ -1948,7 +2223,7 @@ Matrix33::setTheMatrix (const Matrix33& v) IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline void -Matrix33::makeIdentity() IMATH_NOEXCEPT +Matrix33::makeIdentity () IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -1965,8 +2240,9 @@ template IMATH_HOSTDEVICE constexpr inline bool Matrix33::operator== (const Matrix33& v) const IMATH_NOEXCEPT { - return x[0][0] == v.x[0][0] && x[0][1] == v.x[0][1] && x[0][2] == v.x[0][2] && - x[1][0] == v.x[1][0] && x[1][1] == v.x[1][1] && x[1][2] == v.x[1][2] && + return x[0][0] == v.x[0][0] && x[0][1] == v.x[0][1] && + x[0][2] == v.x[0][2] && x[1][0] == v.x[1][0] && + x[1][1] == v.x[1][1] && x[1][2] == v.x[1][2] && x[2][0] == v.x[2][0] && x[2][1] == v.x[2][1] && x[2][2] == v.x[2][2]; } @@ -1974,8 +2250,9 @@ template IMATH_HOSTDEVICE constexpr inline bool Matrix33::operator!= (const Matrix33& v) const IMATH_NOEXCEPT { - return x[0][0] != v.x[0][0] || x[0][1] != v.x[0][1] || x[0][2] != v.x[0][2] || - x[1][0] != v.x[1][0] || x[1][1] != v.x[1][1] || x[1][2] != v.x[1][2] || + return x[0][0] != v.x[0][0] || x[0][1] != v.x[0][1] || + x[0][2] != v.x[0][2] || x[1][0] != v.x[1][0] || + x[1][1] != v.x[1][1] || x[1][2] != v.x[1][2] || x[2][0] != v.x[2][0] || x[2][1] != v.x[2][1] || x[2][2] != v.x[2][2]; } @@ -1985,7 +2262,8 @@ Matrix33::equalWithAbsError (const Matrix33& m, T e) const IMATH_NOEXCEPT { for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) - if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ((*this)[i][j], m[i][j], e)) + if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ( + (*this)[i][j], m[i][j], e)) return false; return true; @@ -1997,7 +2275,8 @@ Matrix33::equalWithRelError (const Matrix33& m, T e) const IMATH_NOEXCEPT { for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) - if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ((*this)[i][j], m[i][j], e)) + if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ( + (*this)[i][j], m[i][j], e)) return false; return true; @@ -2041,15 +2320,16 @@ template IMATH_HOSTDEVICE constexpr inline Matrix33 Matrix33::operator+ (const Matrix33& v) const IMATH_NOEXCEPT { - return Matrix33 (x[0][0] + v.x[0][0], - x[0][1] + v.x[0][1], - x[0][2] + v.x[0][2], - x[1][0] + v.x[1][0], - x[1][1] + v.x[1][1], - x[1][2] + v.x[1][2], - x[2][0] + v.x[2][0], - x[2][1] + v.x[2][1], - x[2][2] + v.x[2][2]); + return Matrix33 ( + x[0][0] + v.x[0][0], + x[0][1] + v.x[0][1], + x[0][2] + v.x[0][2], + x[1][0] + v.x[1][0], + x[1][1] + v.x[1][1], + x[1][2] + v.x[1][2], + x[2][0] + v.x[2][0], + x[2][1] + v.x[2][1], + x[2][2] + v.x[2][2]); } template @@ -2090,35 +2370,37 @@ template IMATH_HOSTDEVICE constexpr inline Matrix33 Matrix33::operator- (const Matrix33& v) const IMATH_NOEXCEPT { - return Matrix33 (x[0][0] - v.x[0][0], - x[0][1] - v.x[0][1], - x[0][2] - v.x[0][2], - x[1][0] - v.x[1][0], - x[1][1] - v.x[1][1], - x[1][2] - v.x[1][2], - x[2][0] - v.x[2][0], - x[2][1] - v.x[2][1], - x[2][2] - v.x[2][2]); + return Matrix33 ( + x[0][0] - v.x[0][0], + x[0][1] - v.x[0][1], + x[0][2] - v.x[0][2], + x[1][0] - v.x[1][0], + x[1][1] - v.x[1][1], + x[1][2] - v.x[1][2], + x[2][0] - v.x[2][0], + x[2][1] - v.x[2][1], + x[2][2] - v.x[2][2]); } template IMATH_HOSTDEVICE constexpr inline Matrix33 -Matrix33::operator-() const IMATH_NOEXCEPT +Matrix33::operator- () const IMATH_NOEXCEPT { - return Matrix33 (-x[0][0], - -x[0][1], - -x[0][2], - -x[1][0], - -x[1][1], - -x[1][2], - -x[2][0], - -x[2][1], - -x[2][2]); + return Matrix33 ( + -x[0][0], + -x[0][1], + -x[0][2], + -x[1][0], + -x[1][1], + -x[1][2], + -x[2][0], + -x[2][1], + -x[2][2]); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::negate() IMATH_NOEXCEPT + Matrix33::negate () IMATH_NOEXCEPT { x[0][0] = -x[0][0]; x[0][1] = -x[0][1]; @@ -2154,15 +2436,16 @@ template IMATH_HOSTDEVICE constexpr inline Matrix33 Matrix33::operator* (T a) const IMATH_NOEXCEPT { - return Matrix33 (x[0][0] * a, - x[0][1] * a, - x[0][2] * a, - x[1][0] * a, - x[1][1] * a, - x[1][2] * a, - x[2][0] * a, - x[2][1] * a, - x[2][2] * a); + return Matrix33 ( + x[0][0] * a, + x[0][1] * a, + x[0][2] * a, + x[1][0] * a, + x[1][1] * a, + x[1][2] * a, + x[2][0] * a, + x[2][1] * a, + x[2][2] * a); } /// Matrix-scalar multiplication @@ -2179,19 +2462,28 @@ Matrix33::operator*= (const Matrix33& v) IMATH_NOEXCEPT { // Avoid initializing with 0 values before immediately overwriting them, // and unroll all loops for the best autovectorization. - Matrix33 tmp(IMATH_INTERNAL_NAMESPACE::UNINITIALIZED); - - tmp.x[0][0] = x[0][0] * v.x[0][0] + x[0][1] * v.x[1][0] + x[0][2] * v.x[2][0]; - tmp.x[0][1] = x[0][0] * v.x[0][1] + x[0][1] * v.x[1][1] + x[0][2] * v.x[2][1]; - tmp.x[0][2] = x[0][0] * v.x[0][2] + x[0][1] * v.x[1][2] + x[0][2] * v.x[2][2]; - - tmp.x[1][0] = x[1][0] * v.x[0][0] + x[1][1] * v.x[1][0] + x[1][2] * v.x[2][0]; - tmp.x[1][1] = x[1][0] * v.x[0][1] + x[1][1] * v.x[1][1] + x[1][2] * v.x[2][1]; - tmp.x[1][2] = x[1][0] * v.x[0][2] + x[1][1] * v.x[1][2] + x[1][2] * v.x[2][2]; - - tmp.x[2][0] = x[2][0] * v.x[0][0] + x[2][1] * v.x[1][0] + x[2][2] * v.x[2][0]; - tmp.x[2][1] = x[2][0] * v.x[0][1] + x[2][1] * v.x[1][1] + x[2][2] * v.x[2][1]; - tmp.x[2][2] = x[2][0] * v.x[0][2] + x[2][1] * v.x[1][2] + x[2][2] * v.x[2][2]; + Matrix33 tmp (IMATH_INTERNAL_NAMESPACE::UNINITIALIZED); + + tmp.x[0][0] = + x[0][0] * v.x[0][0] + x[0][1] * v.x[1][0] + x[0][2] * v.x[2][0]; + tmp.x[0][1] = + x[0][0] * v.x[0][1] + x[0][1] * v.x[1][1] + x[0][2] * v.x[2][1]; + tmp.x[0][2] = + x[0][0] * v.x[0][2] + x[0][1] * v.x[1][2] + x[0][2] * v.x[2][2]; + + tmp.x[1][0] = + x[1][0] * v.x[0][0] + x[1][1] * v.x[1][0] + x[1][2] * v.x[2][0]; + tmp.x[1][1] = + x[1][0] * v.x[0][1] + x[1][1] * v.x[1][1] + x[1][2] * v.x[2][1]; + tmp.x[1][2] = + x[1][0] * v.x[0][2] + x[1][1] * v.x[1][2] + x[1][2] * v.x[2][2]; + + tmp.x[2][0] = + x[2][0] * v.x[0][0] + x[2][1] * v.x[1][0] + x[2][2] * v.x[2][0]; + tmp.x[2][1] = + x[2][0] * v.x[0][1] + x[2][1] * v.x[1][1] + x[2][2] * v.x[2][1]; + tmp.x[2][2] = + x[2][0] * v.x[0][2] + x[2][1] * v.x[1][2] + x[2][2] * v.x[2][2]; *this = tmp; return *this; @@ -2203,19 +2495,28 @@ Matrix33::operator* (const Matrix33& v) const IMATH_NOEXCEPT { // Avoid initializing with 0 values before immediately overwriting them, // and unroll all loops for the best autovectorization. - Matrix33 tmp(IMATH_INTERNAL_NAMESPACE::UNINITIALIZED); - - tmp.x[0][0] = x[0][0] * v.x[0][0] + x[0][1] * v.x[1][0] + x[0][2] * v.x[2][0]; - tmp.x[0][1] = x[0][0] * v.x[0][1] + x[0][1] * v.x[1][1] + x[0][2] * v.x[2][1]; - tmp.x[0][2] = x[0][0] * v.x[0][2] + x[0][1] * v.x[1][2] + x[0][2] * v.x[2][2]; - - tmp.x[1][0] = x[1][0] * v.x[0][0] + x[1][1] * v.x[1][0] + x[1][2] * v.x[2][0]; - tmp.x[1][1] = x[1][0] * v.x[0][1] + x[1][1] * v.x[1][1] + x[1][2] * v.x[2][1]; - tmp.x[1][2] = x[1][0] * v.x[0][2] + x[1][1] * v.x[1][2] + x[1][2] * v.x[2][2]; - - tmp.x[2][0] = x[2][0] * v.x[0][0] + x[2][1] * v.x[1][0] + x[2][2] * v.x[2][0]; - tmp.x[2][1] = x[2][0] * v.x[0][1] + x[2][1] * v.x[1][1] + x[2][2] * v.x[2][1]; - tmp.x[2][2] = x[2][0] * v.x[0][2] + x[2][1] * v.x[1][2] + x[2][2] * v.x[2][2]; + Matrix33 tmp (IMATH_INTERNAL_NAMESPACE::UNINITIALIZED); + + tmp.x[0][0] = + x[0][0] * v.x[0][0] + x[0][1] * v.x[1][0] + x[0][2] * v.x[2][0]; + tmp.x[0][1] = + x[0][0] * v.x[0][1] + x[0][1] * v.x[1][1] + x[0][2] * v.x[2][1]; + tmp.x[0][2] = + x[0][0] * v.x[0][2] + x[0][1] * v.x[1][2] + x[0][2] * v.x[2][2]; + + tmp.x[1][0] = + x[1][0] * v.x[0][0] + x[1][1] * v.x[1][0] + x[1][2] * v.x[2][0]; + tmp.x[1][1] = + x[1][0] * v.x[0][1] + x[1][1] * v.x[1][1] + x[1][2] * v.x[2][1]; + tmp.x[1][2] = + x[1][0] * v.x[0][2] + x[1][1] * v.x[1][2] + x[1][2] * v.x[2][2]; + + tmp.x[2][0] = + x[2][0] * v.x[0][0] + x[2][1] * v.x[1][0] + x[2][2] * v.x[2][0]; + tmp.x[2][1] = + x[2][0] * v.x[0][1] + x[2][1] * v.x[1][1] + x[2][2] * v.x[2][1]; + tmp.x[2][2] = + x[2][0] * v.x[0][2] + x[2][1] * v.x[1][2] + x[2][2] * v.x[2][2]; return tmp; } @@ -2223,7 +2524,8 @@ Matrix33::operator* (const Matrix33& v) const IMATH_NOEXCEPT template template IMATH_HOSTDEVICE inline void -Matrix33::multVecMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCEPT +Matrix33::multVecMatrix (const Vec2& src, Vec2& dst) const + IMATH_NOEXCEPT { S a, b, w; @@ -2238,7 +2540,8 @@ Matrix33::multVecMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCE template template IMATH_HOSTDEVICE inline void -Matrix33::multDirMatrix (const Vec2& src, Vec2& dst) const IMATH_NOEXCEPT +Matrix33::multDirMatrix (const Vec2& src, Vec2& dst) const + IMATH_NOEXCEPT { S a, b; @@ -2270,39 +2573,50 @@ template IMATH_HOSTDEVICE constexpr inline Matrix33 Matrix33::operator/ (T a) const IMATH_NOEXCEPT { - return Matrix33 (x[0][0] / a, - x[0][1] / a, - x[0][2] / a, - x[1][0] / a, - x[1][1] / a, - x[1][2] / a, - x[2][0] / a, - x[2][1] / a, - x[2][2] / a); + return Matrix33 ( + x[0][0] / a, + x[0][1] / a, + x[0][2] / a, + x[1][0] / a, + x[1][1] / a, + x[1][2] / a, + x[2][0] / a, + x[2][1] / a, + x[2][2] / a); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::transpose() IMATH_NOEXCEPT -{ - Matrix33 tmp (x[0][0], x[1][0], x[2][0], x[0][1], x[1][1], x[2][1], x[0][2], x[1][2], x[2][2]); + Matrix33::transpose () IMATH_NOEXCEPT +{ + Matrix33 tmp ( + x[0][0], + x[1][0], + x[2][0], + x[0][1], + x[1][1], + x[2][1], + x[0][2], + x[1][2], + x[2][2]); *this = tmp; return *this; } template IMATH_HOSTDEVICE constexpr inline Matrix33 -Matrix33::transposed() const IMATH_NOEXCEPT +Matrix33::transposed () const IMATH_NOEXCEPT { - return Matrix33 (x[0][0], - x[1][0], - x[2][0], - x[0][1], - x[1][1], - x[2][1], - x[0][2], - x[1][2], - x[2][2]); + return Matrix33 ( + x[0][0], + x[1][0], + x[2][0], + x[0][1], + x[1][1], + x[2][1], + x[0][2], + x[1][2], + x[2][2]); } template @@ -2315,9 +2629,9 @@ Matrix33::gjInvert (bool singExc) template IMATH_HOSTDEVICE const inline Matrix33& -Matrix33::gjInvert() IMATH_NOEXCEPT +Matrix33::gjInvert () IMATH_NOEXCEPT { - *this = gjInverse(); + *this = gjInverse (); return *this; } @@ -2325,7 +2639,7 @@ template inline Matrix33 Matrix33::gjInverse (bool singExc) const { - int i, j, k; + int i, j, k; Matrix33 s; Matrix33 t (*this); @@ -2337,15 +2651,13 @@ Matrix33::gjInverse (bool singExc) const T pivotsize = t.x[i][i]; - if (pivotsize < 0) - pivotsize = -pivotsize; + if (pivotsize < 0) pivotsize = -pivotsize; for (j = i + 1; j < 3; j++) { T tmp = t.x[j][i]; - if (tmp < 0) - tmp = -tmp; + if (tmp < 0) tmp = -tmp; if (tmp > pivotsize) { @@ -2359,7 +2671,7 @@ Matrix33::gjInverse (bool singExc) const if (singExc) throw std::invalid_argument ("Cannot invert singular matrix."); - return Matrix33(); + return Matrix33 (); } if (pivot != i) @@ -2401,7 +2713,7 @@ Matrix33::gjInverse (bool singExc) const if (singExc) throw std::invalid_argument ("Cannot invert singular matrix."); - return Matrix33(); + return Matrix33 (); } for (j = 0; j < 3; j++) @@ -2427,9 +2739,9 @@ Matrix33::gjInverse (bool singExc) const template IMATH_HOSTDEVICE inline Matrix33 -Matrix33::gjInverse() const IMATH_NOEXCEPT +Matrix33::gjInverse () const IMATH_NOEXCEPT { - int i, j, k; + int i, j, k; Matrix33 s; Matrix33 t (*this); @@ -2441,15 +2753,13 @@ Matrix33::gjInverse() const IMATH_NOEXCEPT T pivotsize = t.x[i][i]; - if (pivotsize < 0) - pivotsize = -pivotsize; + if (pivotsize < 0) pivotsize = -pivotsize; for (j = i + 1; j < 3; j++) { T tmp = t.x[j][i]; - if (tmp < 0) - tmp = -tmp; + if (tmp < 0) tmp = -tmp; if (tmp > pivotsize) { @@ -2458,10 +2768,7 @@ Matrix33::gjInverse() const IMATH_NOEXCEPT } } - if (pivotsize == 0) - { - return Matrix33(); - } + if (pivotsize == 0) { return Matrix33 (); } if (pivot != i) { @@ -2497,10 +2804,7 @@ Matrix33::gjInverse() const IMATH_NOEXCEPT { T f; - if ((f = t.x[i][i]) == 0) - { - return Matrix33(); - } + if ((f = t.x[i][i]) == 0) { return Matrix33 (); } for (j = 0; j < 3; j++) { @@ -2533,9 +2837,9 @@ Matrix33::invert (bool singExc) template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::invert() IMATH_NOEXCEPT + Matrix33::invert () IMATH_NOEXCEPT { - *this = inverse(); + *this = inverse (); return *this; } @@ -2545,17 +2849,18 @@ Matrix33::inverse (bool singExc) const { if (x[0][2] != 0 || x[1][2] != 0 || x[2][2] != 1) { - Matrix33 s (x[1][1] * x[2][2] - x[2][1] * x[1][2], - x[2][1] * x[0][2] - x[0][1] * x[2][2], - x[0][1] * x[1][2] - x[1][1] * x[0][2], + Matrix33 s ( + x[1][1] * x[2][2] - x[2][1] * x[1][2], + x[2][1] * x[0][2] - x[0][1] * x[2][2], + x[0][1] * x[1][2] - x[1][1] * x[0][2], - x[2][0] * x[1][2] - x[1][0] * x[2][2], - x[0][0] * x[2][2] - x[2][0] * x[0][2], - x[1][0] * x[0][2] - x[0][0] * x[1][2], + x[2][0] * x[1][2] - x[1][0] * x[2][2], + x[0][0] * x[2][2] - x[2][0] * x[0][2], + x[1][0] * x[0][2] - x[0][0] * x[1][2], - x[1][0] * x[2][1] - x[2][0] * x[1][1], - x[2][0] * x[0][1] - x[0][0] * x[2][1], - x[0][0] * x[1][1] - x[1][0] * x[0][1]); + x[1][0] * x[2][1] - x[2][0] * x[1][1], + x[2][0] * x[0][1] - x[0][0] * x[2][1], + x[0][0] * x[1][1] - x[1][0] * x[0][1]); T r = x[0][0] * s[0][0] + x[0][1] * s[1][0] + x[0][2] * s[2][0]; @@ -2571,7 +2876,8 @@ Matrix33::inverse (bool singExc) const } else { - T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min(); + T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / + std::numeric_limits::min (); for (int i = 0; i < 3; ++i) { @@ -2586,7 +2892,7 @@ Matrix33::inverse (bool singExc) const if (singExc) throw std::invalid_argument ("Cannot invert " "singular matrix."); - return Matrix33(); + return Matrix33 (); } } } @@ -2596,17 +2902,18 @@ Matrix33::inverse (bool singExc) const } else { - Matrix33 s (x[1][1], - -x[0][1], - 0, + Matrix33 s ( + x[1][1], + -x[0][1], + 0, - -x[1][0], - x[0][0], - 0, + -x[1][0], + x[0][0], + 0, - 0, - 0, - 1); + 0, + 0, + 1); T r = x[0][0] * x[1][1] - x[1][0] * x[0][1]; @@ -2622,7 +2929,8 @@ Matrix33::inverse (bool singExc) const } else { - T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min(); + T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / + std::numeric_limits::min (); for (int i = 0; i < 2; ++i) { @@ -2637,7 +2945,7 @@ Matrix33::inverse (bool singExc) const if (singExc) throw std::invalid_argument ("Cannot invert " "singular matrix."); - return Matrix33(); + return Matrix33 (); } } } @@ -2656,17 +2964,18 @@ Matrix33::inverse () const IMATH_NOEXCEPT { if (x[0][2] != 0 || x[1][2] != 0 || x[2][2] != 1) { - Matrix33 s (x[1][1] * x[2][2] - x[2][1] * x[1][2], - x[2][1] * x[0][2] - x[0][1] * x[2][2], - x[0][1] * x[1][2] - x[1][1] * x[0][2], + Matrix33 s ( + x[1][1] * x[2][2] - x[2][1] * x[1][2], + x[2][1] * x[0][2] - x[0][1] * x[2][2], + x[0][1] * x[1][2] - x[1][1] * x[0][2], - x[2][0] * x[1][2] - x[1][0] * x[2][2], - x[0][0] * x[2][2] - x[2][0] * x[0][2], - x[1][0] * x[0][2] - x[0][0] * x[1][2], + x[2][0] * x[1][2] - x[1][0] * x[2][2], + x[0][0] * x[2][2] - x[2][0] * x[0][2], + x[1][0] * x[0][2] - x[0][0] * x[1][2], - x[1][0] * x[2][1] - x[2][0] * x[1][1], - x[2][0] * x[0][1] - x[0][0] * x[2][1], - x[0][0] * x[1][1] - x[1][0] * x[0][1]); + x[1][0] * x[2][1] - x[2][0] * x[1][1], + x[2][0] * x[0][1] - x[0][0] * x[2][1], + x[0][0] * x[1][1] - x[1][0] * x[0][1]); T r = x[0][0] * s.x[0][0] + x[0][1] * s.x[1][0] + x[0][2] * s.x[2][0]; @@ -2682,7 +2991,8 @@ Matrix33::inverse () const IMATH_NOEXCEPT } else { - T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min(); + T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / + std::numeric_limits::min (); for (int i = 0; i < 3; ++i) { @@ -2694,7 +3004,7 @@ Matrix33::inverse () const IMATH_NOEXCEPT } else { - return Matrix33(); + return Matrix33 (); } } } @@ -2704,17 +3014,18 @@ Matrix33::inverse () const IMATH_NOEXCEPT } else { - Matrix33 s (x[1][1], - -x[0][1], - 0, + Matrix33 s ( + x[1][1], + -x[0][1], + 0, - -x[1][0], - x[0][0], - 0, + -x[1][0], + x[0][0], + 0, - 0, - 0, - 1); + 0, + 0, + 1); T r = x[0][0] * x[1][1] - x[1][0] * x[0][1]; @@ -2730,7 +3041,8 @@ Matrix33::inverse () const IMATH_NOEXCEPT } else { - T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min(); + T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / + std::numeric_limits::min (); for (int i = 0; i < 2; ++i) { @@ -2742,7 +3054,7 @@ Matrix33::inverse () const IMATH_NOEXCEPT } else { - return Matrix33(); + return Matrix33 (); } } } @@ -2769,14 +3081,15 @@ Matrix33::minorOf (const int r, const int c) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline T -Matrix33::fastMinor (const int r0, const int r1, const int c0, const int c1) const IMATH_NOEXCEPT +Matrix33::fastMinor ( + const int r0, const int r1, const int c0, const int c1) const IMATH_NOEXCEPT { return x[r0][c0] * x[r1][c1] - x[r0][c1] * x[r1][c0]; } template IMATH_HOSTDEVICE constexpr inline T -Matrix33::determinant() const IMATH_NOEXCEPT +Matrix33::determinant () const IMATH_NOEXCEPT { return x[0][0] * (x[1][1] * x[2][2] - x[1][2] * x[2][1]) + x[0][1] * (x[1][2] * x[2][0] - x[1][0] * x[2][2]) + @@ -2818,15 +3131,15 @@ Matrix33::setRotation (S r) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::rotate (S r) IMATH_NOEXCEPT + Matrix33::rotate (S r) IMATH_NOEXCEPT { - *this *= Matrix33().setRotation (r); + *this *= Matrix33 ().setRotation (r); return *this; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::setScale (T s) IMATH_NOEXCEPT + Matrix33::setScale (T s) IMATH_NOEXCEPT { // // Set the matrix to a 2D homogeneous transform scale: @@ -2850,7 +3163,7 @@ Matrix33::setScale (T s) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::setScale (const Vec2& s) IMATH_NOEXCEPT + Matrix33::setScale (const Vec2& s) IMATH_NOEXCEPT { // // Set the matrix to a 2D homogeneous transform scale: @@ -2874,7 +3187,7 @@ Matrix33::setScale (const Vec2& s) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::scale (const Vec2& s) IMATH_NOEXCEPT + Matrix33::scale (const Vec2& s) IMATH_NOEXCEPT { x[0][0] *= s.x; x[0][1] *= s.x; @@ -2890,7 +3203,7 @@ Matrix33::scale (const Vec2& s) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::setTranslation (const Vec2& t) IMATH_NOEXCEPT + Matrix33::setTranslation (const Vec2& t) IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -2909,7 +3222,7 @@ Matrix33::setTranslation (const Vec2& t) IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline Vec2 -Matrix33::translation() const IMATH_NOEXCEPT +Matrix33::translation () const IMATH_NOEXCEPT { return Vec2 (x[2][0], x[2][1]); } @@ -2917,7 +3230,7 @@ Matrix33::translation() const IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::translate (const Vec2& t) IMATH_NOEXCEPT + Matrix33::translate (const Vec2& t) IMATH_NOEXCEPT { x[2][0] += t.x * x[0][0] + t.y * x[1][0]; x[2][1] += t.x * x[0][1] + t.y * x[1][1]; @@ -2929,7 +3242,7 @@ Matrix33::translate (const Vec2& t) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::setShear (const S& xy) IMATH_NOEXCEPT + Matrix33::setShear (const S& xy) IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -2949,7 +3262,7 @@ Matrix33::setShear (const S& xy) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::setShear (const Vec2& h) IMATH_NOEXCEPT + Matrix33::setShear (const Vec2& h) IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = h.y; @@ -2969,7 +3282,7 @@ Matrix33::setShear (const Vec2& h) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::shear (const S& xy) IMATH_NOEXCEPT + Matrix33::shear (const S& xy) IMATH_NOEXCEPT { // // In this case, we don't need a temp. copy of the matrix @@ -2987,7 +3300,7 @@ Matrix33::shear (const S& xy) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix33& -Matrix33::shear (const Vec2& h) IMATH_NOEXCEPT + Matrix33::shear (const Vec2& h) IMATH_NOEXCEPT { Matrix33 P (*this); @@ -3020,7 +3333,9 @@ Matrix44::operator[] (int i) const IMATH_NOEXCEPT return x[i]; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44() IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE + IMATH_CONSTEXPR14 inline Matrix44::Matrix44 () IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -3040,7 +3355,9 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix x[3][3] = 1; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44 (T a) IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE + IMATH_CONSTEXPR14 inline Matrix44::Matrix44 (T a) IMATH_NOEXCEPT { x[0][0] = a; x[0][1] = a; @@ -3083,8 +3400,23 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44 ( } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44< - T>::Matrix44 (T a, T b, T c, T d, T e, T f, T g, T h, T i, T j, T k, T l, T m, T n, T o, T p) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44 ( + T a, + T b, + T c, + T d, + T e, + T f, + T g, + T h, + T i, + T j, + T k, + T l, + T m, + T n, + T o, + T p) IMATH_NOEXCEPT { x[0][0] = a; x[0][1] = b; @@ -3104,7 +3436,9 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44< x[3][3] = p; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44 (Matrix33 r, Vec3 t) IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44 ( + Matrix33 r, Vec3 t) IMATH_NOEXCEPT { x[0][0] = r.x[0][0]; x[0][1] = r.x[0][1]; @@ -3124,7 +3458,9 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix x[3][3] = 1; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44 (const Matrix44& v) IMATH_NOEXCEPT +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44 ( + const Matrix44& v) IMATH_NOEXCEPT { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; @@ -3146,7 +3482,8 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix template template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44 (const Matrix44& v) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44::Matrix44 ( + const Matrix44& v) IMATH_NOEXCEPT { x[0][0] = T (v.x[0][0]); x[0][1] = T (v.x[0][1]); @@ -3221,7 +3558,7 @@ Matrix44::getValue () IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline const T* -Matrix44::getValue() const IMATH_NOEXCEPT +Matrix44::getValue () const IMATH_NOEXCEPT { return (const T*) &x[0][0]; } @@ -3252,7 +3589,7 @@ Matrix44::getValue (Matrix44& v) const IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44& -Matrix44::setValue (const Matrix44& v) IMATH_NOEXCEPT + Matrix44::setValue (const Matrix44& v) IMATH_NOEXCEPT { x[0][0] = T(v.x[0][0]); x[0][1] = T(v.x[0][1]); @@ -3276,7 +3613,7 @@ Matrix44::setValue (const Matrix44& v) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44& -Matrix44::setTheMatrix (const Matrix44& v) IMATH_NOEXCEPT + Matrix44::setTheMatrix (const Matrix44& v) IMATH_NOEXCEPT { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; @@ -3299,7 +3636,7 @@ Matrix44::setTheMatrix (const Matrix44& v) IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline void -Matrix44::makeIdentity() IMATH_NOEXCEPT +Matrix44::makeIdentity () IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -3323,24 +3660,28 @@ template IMATH_HOSTDEVICE constexpr inline bool Matrix44::operator== (const Matrix44& v) const IMATH_NOEXCEPT { - return x[0][0] == v.x[0][0] && x[0][1] == v.x[0][1] && x[0][2] == v.x[0][2] && - x[0][3] == v.x[0][3] && x[1][0] == v.x[1][0] && x[1][1] == v.x[1][1] && - x[1][2] == v.x[1][2] && x[1][3] == v.x[1][3] && x[2][0] == v.x[2][0] && - x[2][1] == v.x[2][1] && x[2][2] == v.x[2][2] && x[2][3] == v.x[2][3] && - x[3][0] == v.x[3][0] && x[3][1] == v.x[3][1] && x[3][2] == v.x[3][2] && - x[3][3] == v.x[3][3]; + return x[0][0] == v.x[0][0] && x[0][1] == v.x[0][1] && + x[0][2] == v.x[0][2] && x[0][3] == v.x[0][3] && + x[1][0] == v.x[1][0] && x[1][1] == v.x[1][1] && + x[1][2] == v.x[1][2] && x[1][3] == v.x[1][3] && + x[2][0] == v.x[2][0] && x[2][1] == v.x[2][1] && + x[2][2] == v.x[2][2] && x[2][3] == v.x[2][3] && + x[3][0] == v.x[3][0] && x[3][1] == v.x[3][1] && + x[3][2] == v.x[3][2] && x[3][3] == v.x[3][3]; } template IMATH_HOSTDEVICE constexpr inline bool Matrix44::operator!= (const Matrix44& v) const IMATH_NOEXCEPT { - return x[0][0] != v.x[0][0] || x[0][1] != v.x[0][1] || x[0][2] != v.x[0][2] || - x[0][3] != v.x[0][3] || x[1][0] != v.x[1][0] || x[1][1] != v.x[1][1] || - x[1][2] != v.x[1][2] || x[1][3] != v.x[1][3] || x[2][0] != v.x[2][0] || - x[2][1] != v.x[2][1] || x[2][2] != v.x[2][2] || x[2][3] != v.x[2][3] || - x[3][0] != v.x[3][0] || x[3][1] != v.x[3][1] || x[3][2] != v.x[3][2] || - x[3][3] != v.x[3][3]; + return x[0][0] != v.x[0][0] || x[0][1] != v.x[0][1] || + x[0][2] != v.x[0][2] || x[0][3] != v.x[0][3] || + x[1][0] != v.x[1][0] || x[1][1] != v.x[1][1] || + x[1][2] != v.x[1][2] || x[1][3] != v.x[1][3] || + x[2][0] != v.x[2][0] || x[2][1] != v.x[2][1] || + x[2][2] != v.x[2][2] || x[2][3] != v.x[2][3] || + x[3][0] != v.x[3][0] || x[3][1] != v.x[3][1] || + x[3][2] != v.x[3][2] || x[3][3] != v.x[3][3]; } template @@ -3349,7 +3690,8 @@ Matrix44::equalWithAbsError (const Matrix44& m, T e) const IMATH_NOEXCEPT { for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) - if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ((*this).x[i][j], m.x[i][j], e)) + if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ( + (*this).x[i][j], m.x[i][j], e)) return false; return true; @@ -3361,7 +3703,8 @@ Matrix44::equalWithRelError (const Matrix44& m, T e) const IMATH_NOEXCEPT { for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) - if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ((*this).x[i][j], m.x[i][j], e)) + if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ( + (*this).x[i][j], m.x[i][j], e)) return false; return true; @@ -3419,22 +3762,23 @@ template IMATH_HOSTDEVICE constexpr inline Matrix44 Matrix44::operator+ (const Matrix44& v) const IMATH_NOEXCEPT { - return Matrix44 (x[0][0] + v.x[0][0], - x[0][1] + v.x[0][1], - x[0][2] + v.x[0][2], - x[0][3] + v.x[0][3], - x[1][0] + v.x[1][0], - x[1][1] + v.x[1][1], - x[1][2] + v.x[1][2], - x[1][3] + v.x[1][3], - x[2][0] + v.x[2][0], - x[2][1] + v.x[2][1], - x[2][2] + v.x[2][2], - x[2][3] + v.x[2][3], - x[3][0] + v.x[3][0], - x[3][1] + v.x[3][1], - x[3][2] + v.x[3][2], - x[3][3] + v.x[3][3]); + return Matrix44 ( + x[0][0] + v.x[0][0], + x[0][1] + v.x[0][1], + x[0][2] + v.x[0][2], + x[0][3] + v.x[0][3], + x[1][0] + v.x[1][0], + x[1][1] + v.x[1][1], + x[1][2] + v.x[1][2], + x[1][3] + v.x[1][3], + x[2][0] + v.x[2][0], + x[2][1] + v.x[2][1], + x[2][2] + v.x[2][2], + x[2][3] + v.x[2][3], + x[3][0] + v.x[3][0], + x[3][1] + v.x[3][1], + x[3][2] + v.x[3][2], + x[3][3] + v.x[3][3]); } template @@ -3489,49 +3833,51 @@ template IMATH_HOSTDEVICE constexpr inline Matrix44 Matrix44::operator- (const Matrix44& v) const IMATH_NOEXCEPT { - return Matrix44 (x[0][0] - v.x[0][0], - x[0][1] - v.x[0][1], - x[0][2] - v.x[0][2], - x[0][3] - v.x[0][3], - x[1][0] - v.x[1][0], - x[1][1] - v.x[1][1], - x[1][2] - v.x[1][2], - x[1][3] - v.x[1][3], - x[2][0] - v.x[2][0], - x[2][1] - v.x[2][1], - x[2][2] - v.x[2][2], - x[2][3] - v.x[2][3], - x[3][0] - v.x[3][0], - x[3][1] - v.x[3][1], - x[3][2] - v.x[3][2], - x[3][3] - v.x[3][3]); + return Matrix44 ( + x[0][0] - v.x[0][0], + x[0][1] - v.x[0][1], + x[0][2] - v.x[0][2], + x[0][3] - v.x[0][3], + x[1][0] - v.x[1][0], + x[1][1] - v.x[1][1], + x[1][2] - v.x[1][2], + x[1][3] - v.x[1][3], + x[2][0] - v.x[2][0], + x[2][1] - v.x[2][1], + x[2][2] - v.x[2][2], + x[2][3] - v.x[2][3], + x[3][0] - v.x[3][0], + x[3][1] - v.x[3][1], + x[3][2] - v.x[3][2], + x[3][3] - v.x[3][3]); } template IMATH_HOSTDEVICE constexpr inline Matrix44 -Matrix44::operator-() const IMATH_NOEXCEPT -{ - return Matrix44 (-x[0][0], - -x[0][1], - -x[0][2], - -x[0][3], - -x[1][0], - -x[1][1], - -x[1][2], - -x[1][3], - -x[2][0], - -x[2][1], - -x[2][2], - -x[2][3], - -x[3][0], - -x[3][1], - -x[3][2], - -x[3][3]); +Matrix44::operator- () const IMATH_NOEXCEPT +{ + return Matrix44 ( + -x[0][0], + -x[0][1], + -x[0][2], + -x[0][3], + -x[1][0], + -x[1][1], + -x[1][2], + -x[1][3], + -x[2][0], + -x[2][1], + -x[2][2], + -x[2][3], + -x[3][0], + -x[3][1], + -x[3][2], + -x[3][3]); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::negate() IMATH_NOEXCEPT + Matrix44::negate () IMATH_NOEXCEPT { x[0][0] = -x[0][0]; x[0][1] = -x[0][1]; @@ -3581,22 +3927,23 @@ template IMATH_HOSTDEVICE constexpr inline Matrix44 Matrix44::operator* (T a) const IMATH_NOEXCEPT { - return Matrix44 (x[0][0] * a, - x[0][1] * a, - x[0][2] * a, - x[0][3] * a, - x[1][0] * a, - x[1][1] * a, - x[1][2] * a, - x[1][3] * a, - x[2][0] * a, - x[2][1] * a, - x[2][2] * a, - x[2][3] * a, - x[3][0] * a, - x[3][1] * a, - x[3][2] * a, - x[3][3] * a); + return Matrix44 ( + x[0][0] * a, + x[0][1] * a, + x[0][2] * a, + x[0][3] * a, + x[1][0] * a, + x[1][1] * a, + x[1][2] * a, + x[1][3] * a, + x[2][0] * a, + x[2][1] * a, + x[2][2] * a, + x[2][3] * a, + x[3][0] * a, + x[3][1] * a, + x[3][2] * a, + x[3][3] * a); } /// Matrix-scalar multiplication @@ -3607,62 +3954,89 @@ operator* (T a, const Matrix44& v) IMATH_NOEXCEPT return v * a; } - template IMATH_HOSTDEVICE inline IMATH_CONSTEXPR14 Matrix44 -Matrix44::multiply (const Matrix44 &a, const Matrix44 &b) IMATH_NOEXCEPT +Matrix44::multiply (const Matrix44& a, const Matrix44& b) IMATH_NOEXCEPT { const auto a00 = a.x[0][0]; const auto a01 = a.x[0][1]; const auto a02 = a.x[0][2]; const auto a03 = a.x[0][3]; - const auto c00 = a00 * b.x[0][0] + a01 * b.x[1][0] + a02 * b.x[2][0] + a03 * b.x[3][0]; - const auto c01 = a00 * b.x[0][1] + a01 * b.x[1][1] + a02 * b.x[2][1] + a03 * b.x[3][1]; - const auto c02 = a00 * b.x[0][2] + a01 * b.x[1][2] + a02 * b.x[2][2] + a03 * b.x[3][2]; - const auto c03 = a00 * b.x[0][3] + a01 * b.x[1][3] + a02 * b.x[2][3] + a03 * b.x[3][3]; + const auto c00 = + a00 * b.x[0][0] + a01 * b.x[1][0] + a02 * b.x[2][0] + a03 * b.x[3][0]; + const auto c01 = + a00 * b.x[0][1] + a01 * b.x[1][1] + a02 * b.x[2][1] + a03 * b.x[3][1]; + const auto c02 = + a00 * b.x[0][2] + a01 * b.x[1][2] + a02 * b.x[2][2] + a03 * b.x[3][2]; + const auto c03 = + a00 * b.x[0][3] + a01 * b.x[1][3] + a02 * b.x[2][3] + a03 * b.x[3][3]; const auto a10 = a.x[1][0]; const auto a11 = a.x[1][1]; const auto a12 = a.x[1][2]; const auto a13 = a.x[1][3]; - const auto c10 = a10 * b.x[0][0] + a11 * b.x[1][0] + a12 * b.x[2][0] + a13 * b.x[3][0]; - const auto c11 = a10 * b.x[0][1] + a11 * b.x[1][1] + a12 * b.x[2][1] + a13 * b.x[3][1]; - const auto c12 = a10 * b.x[0][2] + a11 * b.x[1][2] + a12 * b.x[2][2] + a13 * b.x[3][2]; - const auto c13 = a10 * b.x[0][3] + a11 * b.x[1][3] + a12 * b.x[2][3] + a13 * b.x[3][3]; + const auto c10 = + a10 * b.x[0][0] + a11 * b.x[1][0] + a12 * b.x[2][0] + a13 * b.x[3][0]; + const auto c11 = + a10 * b.x[0][1] + a11 * b.x[1][1] + a12 * b.x[2][1] + a13 * b.x[3][1]; + const auto c12 = + a10 * b.x[0][2] + a11 * b.x[1][2] + a12 * b.x[2][2] + a13 * b.x[3][2]; + const auto c13 = + a10 * b.x[0][3] + a11 * b.x[1][3] + a12 * b.x[2][3] + a13 * b.x[3][3]; const auto a20 = a.x[2][0]; const auto a21 = a.x[2][1]; const auto a22 = a.x[2][2]; const auto a23 = a.x[2][3]; - const auto c20 = a20 * b.x[0][0] + a21 * b.x[1][0] + a22 * b.x[2][0] + a23 * b.x[3][0]; - const auto c21 = a20 * b.x[0][1] + a21 * b.x[1][1] + a22 * b.x[2][1] + a23 * b.x[3][1]; - const auto c22 = a20 * b.x[0][2] + a21 * b.x[1][2] + a22 * b.x[2][2] + a23 * b.x[3][2]; - const auto c23 = a20 * b.x[0][3] + a21 * b.x[1][3] + a22 * b.x[2][3] + a23 * b.x[3][3]; + const auto c20 = + a20 * b.x[0][0] + a21 * b.x[1][0] + a22 * b.x[2][0] + a23 * b.x[3][0]; + const auto c21 = + a20 * b.x[0][1] + a21 * b.x[1][1] + a22 * b.x[2][1] + a23 * b.x[3][1]; + const auto c22 = + a20 * b.x[0][2] + a21 * b.x[1][2] + a22 * b.x[2][2] + a23 * b.x[3][2]; + const auto c23 = + a20 * b.x[0][3] + a21 * b.x[1][3] + a22 * b.x[2][3] + a23 * b.x[3][3]; const auto a30 = a.x[3][0]; const auto a31 = a.x[3][1]; const auto a32 = a.x[3][2]; const auto a33 = a.x[3][3]; - const auto c30 = a30 * b.x[0][0] + a31 * b.x[1][0] + a32 * b.x[2][0] + a33 * b.x[3][0]; - const auto c31 = a30 * b.x[0][1] + a31 * b.x[1][1] + a32 * b.x[2][1] + a33 * b.x[3][1]; - const auto c32 = a30 * b.x[0][2] + a31 * b.x[1][2] + a32 * b.x[2][2] + a33 * b.x[3][2]; - const auto c33 = a30 * b.x[0][3] + a31 * b.x[1][3] + a32 * b.x[2][3] + a33 * b.x[3][3]; - return Matrix44(c00, c01, c02, c03, - c10, c11, c12, c13, - c20, c21, c22, c23, - c30, c31, c32, c33); + const auto c30 = + a30 * b.x[0][0] + a31 * b.x[1][0] + a32 * b.x[2][0] + a33 * b.x[3][0]; + const auto c31 = + a30 * b.x[0][1] + a31 * b.x[1][1] + a32 * b.x[2][1] + a33 * b.x[3][1]; + const auto c32 = + a30 * b.x[0][2] + a31 * b.x[1][2] + a32 * b.x[2][2] + a33 * b.x[3][2]; + const auto c33 = + a30 * b.x[0][3] + a31 * b.x[1][3] + a32 * b.x[2][3] + a33 * b.x[3][3]; + return Matrix44 ( + c00, + c01, + c02, + c03, + c10, + c11, + c12, + c13, + c20, + c21, + c22, + c23, + c30, + c31, + c32, + c33); } - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& Matrix44::operator*= (const Matrix44& v) IMATH_NOEXCEPT { - *this = multiply(*this, v); + *this = multiply (*this, v); return *this; } @@ -3670,20 +4044,22 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44 Matrix44::operator* (const Matrix44& v) const IMATH_NOEXCEPT { - return multiply(*this, v); + return multiply (*this, v); } template IMATH_HOSTDEVICE inline void -Matrix44::multiply (const Matrix44& a, const Matrix44& b, Matrix44& c) IMATH_NOEXCEPT +Matrix44::multiply ( + const Matrix44& a, const Matrix44& b, Matrix44& c) IMATH_NOEXCEPT { - c = multiply(a, b); + c = multiply (a, b); } template template IMATH_HOSTDEVICE inline void -Matrix44::multVecMatrix (const Vec3& src, Vec3& dst) const IMATH_NOEXCEPT +Matrix44::multVecMatrix (const Vec3& src, Vec3& dst) const + IMATH_NOEXCEPT { S a, b, c, w; @@ -3700,7 +4076,8 @@ Matrix44::multVecMatrix (const Vec3& src, Vec3& dst) const IMATH_NOEXCE template template IMATH_HOSTDEVICE inline void -Matrix44::multDirMatrix (const Vec3& src, Vec3& dst) const IMATH_NOEXCEPT +Matrix44::multDirMatrix (const Vec3& src, Vec3& dst) const + IMATH_NOEXCEPT { S a, b, c; @@ -3741,68 +4118,71 @@ template IMATH_HOSTDEVICE constexpr inline Matrix44 Matrix44::operator/ (T a) const IMATH_NOEXCEPT { - return Matrix44 (x[0][0] / a, - x[0][1] / a, - x[0][2] / a, - x[0][3] / a, - x[1][0] / a, - x[1][1] / a, - x[1][2] / a, - x[1][3] / a, - x[2][0] / a, - x[2][1] / a, - x[2][2] / a, - x[2][3] / a, - x[3][0] / a, - x[3][1] / a, - x[3][2] / a, - x[3][3] / a); + return Matrix44 ( + x[0][0] / a, + x[0][1] / a, + x[0][2] / a, + x[0][3] / a, + x[1][0] / a, + x[1][1] / a, + x[1][2] / a, + x[1][3] / a, + x[2][0] / a, + x[2][1] / a, + x[2][2] / a, + x[2][3] / a, + x[3][0] / a, + x[3][1] / a, + x[3][2] / a, + x[3][3] / a); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::transpose() IMATH_NOEXCEPT -{ - Matrix44 tmp (x[0][0], - x[1][0], - x[2][0], - x[3][0], - x[0][1], - x[1][1], - x[2][1], - x[3][1], - x[0][2], - x[1][2], - x[2][2], - x[3][2], - x[0][3], - x[1][3], - x[2][3], - x[3][3]); + Matrix44::transpose () IMATH_NOEXCEPT +{ + Matrix44 tmp ( + x[0][0], + x[1][0], + x[2][0], + x[3][0], + x[0][1], + x[1][1], + x[2][1], + x[3][1], + x[0][2], + x[1][2], + x[2][2], + x[3][2], + x[0][3], + x[1][3], + x[2][3], + x[3][3]); *this = tmp; return *this; } template IMATH_HOSTDEVICE constexpr inline Matrix44 -Matrix44::transposed() const IMATH_NOEXCEPT -{ - return Matrix44 (x[0][0], - x[1][0], - x[2][0], - x[3][0], - x[0][1], - x[1][1], - x[2][1], - x[3][1], - x[0][2], - x[1][2], - x[2][2], - x[3][2], - x[0][3], - x[1][3], - x[2][3], - x[3][3]); +Matrix44::transposed () const IMATH_NOEXCEPT +{ + return Matrix44 ( + x[0][0], + x[1][0], + x[2][0], + x[3][0], + x[0][1], + x[1][1], + x[2][1], + x[3][1], + x[0][2], + x[1][2], + x[2][2], + x[3][2], + x[0][3], + x[1][3], + x[2][3], + x[3][3]); } template @@ -3815,9 +4195,9 @@ Matrix44::gjInvert (bool singExc) template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::gjInvert() IMATH_NOEXCEPT + Matrix44::gjInvert () IMATH_NOEXCEPT { - *this = gjInverse(); + *this = gjInverse (); return *this; } @@ -3825,7 +4205,7 @@ template inline Matrix44 Matrix44::gjInverse (bool singExc) const { - int i, j, k; + int i, j, k; Matrix44 s; Matrix44 t (*this); @@ -3837,15 +4217,13 @@ Matrix44::gjInverse (bool singExc) const T pivotsize = t.x[i][i]; - if (pivotsize < 0) - pivotsize = -pivotsize; + if (pivotsize < 0) pivotsize = -pivotsize; for (j = i + 1; j < 4; j++) { T tmp = t.x[j][i]; - if (tmp < 0) - tmp = -tmp; + if (tmp < 0) tmp = -tmp; if (tmp > pivotsize) { @@ -3859,7 +4237,7 @@ Matrix44::gjInverse (bool singExc) const if (singExc) throw std::invalid_argument ("Cannot invert singular matrix."); - return Matrix44(); + return Matrix44 (); } if (pivot != i) @@ -3901,7 +4279,7 @@ Matrix44::gjInverse (bool singExc) const if (singExc) throw std::invalid_argument ("Cannot invert singular matrix."); - return Matrix44(); + return Matrix44 (); } for (j = 0; j < 4; j++) @@ -3927,9 +4305,9 @@ Matrix44::gjInverse (bool singExc) const template IMATH_HOSTDEVICE inline Matrix44 -Matrix44::gjInverse() const IMATH_NOEXCEPT +Matrix44::gjInverse () const IMATH_NOEXCEPT { - int i, j, k; + int i, j, k; Matrix44 s; Matrix44 t (*this); @@ -3941,15 +4319,13 @@ Matrix44::gjInverse() const IMATH_NOEXCEPT T pivotsize = t.x[i][i]; - if (pivotsize < 0) - pivotsize = -pivotsize; + if (pivotsize < 0) pivotsize = -pivotsize; for (j = i + 1; j < 4; j++) { T tmp = t.x[j][i]; - if (tmp < 0) - tmp = -tmp; + if (tmp < 0) tmp = -tmp; if (tmp > pivotsize) { @@ -3958,10 +4334,7 @@ Matrix44::gjInverse() const IMATH_NOEXCEPT } } - if (pivotsize == 0) - { - return Matrix44(); - } + if (pivotsize == 0) { return Matrix44 (); } if (pivot != i) { @@ -3997,10 +4370,7 @@ Matrix44::gjInverse() const IMATH_NOEXCEPT { T f; - if ((f = t.x[i][i]) == 0) - { - return Matrix44(); - } + if ((f = t.x[i][i]) == 0) { return Matrix44 (); } for (j = 0; j < 4; j++) { @@ -4033,9 +4403,9 @@ Matrix44::invert (bool singExc) template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::invert() IMATH_NOEXCEPT + Matrix44::invert () IMATH_NOEXCEPT { - *this = inverse(); + *this = inverse (); return *this; } @@ -4046,25 +4416,26 @@ Matrix44::inverse (bool singExc) const if (x[0][3] != 0 || x[1][3] != 0 || x[2][3] != 0 || x[3][3] != 1) return gjInverse (singExc); - Matrix44 s (x[1][1] * x[2][2] - x[2][1] * x[1][2], - x[2][1] * x[0][2] - x[0][1] * x[2][2], - x[0][1] * x[1][2] - x[1][1] * x[0][2], - 0, + Matrix44 s ( + x[1][1] * x[2][2] - x[2][1] * x[1][2], + x[2][1] * x[0][2] - x[0][1] * x[2][2], + x[0][1] * x[1][2] - x[1][1] * x[0][2], + 0, - x[2][0] * x[1][2] - x[1][0] * x[2][2], - x[0][0] * x[2][2] - x[2][0] * x[0][2], - x[1][0] * x[0][2] - x[0][0] * x[1][2], - 0, + x[2][0] * x[1][2] - x[1][0] * x[2][2], + x[0][0] * x[2][2] - x[2][0] * x[0][2], + x[1][0] * x[0][2] - x[0][0] * x[1][2], + 0, - x[1][0] * x[2][1] - x[2][0] * x[1][1], - x[2][0] * x[0][1] - x[0][0] * x[2][1], - x[0][0] * x[1][1] - x[1][0] * x[0][1], - 0, + x[1][0] * x[2][1] - x[2][0] * x[1][1], + x[2][0] * x[0][1] - x[0][0] * x[2][1], + x[0][0] * x[1][1] - x[1][0] * x[0][1], + 0, - 0, - 0, - 0, - 1); + 0, + 0, + 0, + 1); T r = x[0][0] * s.x[0][0] + x[0][1] * s.x[1][0] + x[0][2] * s.x[2][0]; @@ -4080,7 +4451,8 @@ Matrix44::inverse (bool singExc) const } else { - T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min(); + T mr = + IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min (); for (int i = 0; i < 3; ++i) { @@ -4093,47 +4465,52 @@ Matrix44::inverse (bool singExc) const else { if (singExc) - throw std::invalid_argument ("Cannot invert singular matrix."); + throw std::invalid_argument ( + "Cannot invert singular matrix."); - return Matrix44(); + return Matrix44 (); } } } } - s.x[3][0] = -x[3][0] * s.x[0][0] - x[3][1] * s.x[1][0] - x[3][2] * s.x[2][0]; - s.x[3][1] = -x[3][0] * s.x[0][1] - x[3][1] * s.x[1][1] - x[3][2] * s.x[2][1]; - s.x[3][2] = -x[3][0] * s.x[0][2] - x[3][1] * s.x[1][2] - x[3][2] * s.x[2][2]; + s.x[3][0] = + -x[3][0] * s.x[0][0] - x[3][1] * s.x[1][0] - x[3][2] * s.x[2][0]; + s.x[3][1] = + -x[3][0] * s.x[0][1] - x[3][1] * s.x[1][1] - x[3][2] * s.x[2][1]; + s.x[3][2] = + -x[3][0] * s.x[0][2] - x[3][1] * s.x[1][2] - x[3][2] * s.x[2][2]; return s; } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Matrix44 -Matrix44::inverse() const IMATH_NOEXCEPT + Matrix44::inverse () const IMATH_NOEXCEPT { if (x[0][3] != 0 || x[1][3] != 0 || x[2][3] != 0 || x[3][3] != 1) - return gjInverse(); + return gjInverse (); - Matrix44 s (x[1][1] * x[2][2] - x[2][1] * x[1][2], - x[2][1] * x[0][2] - x[0][1] * x[2][2], - x[0][1] * x[1][2] - x[1][1] * x[0][2], - 0, + Matrix44 s ( + x[1][1] * x[2][2] - x[2][1] * x[1][2], + x[2][1] * x[0][2] - x[0][1] * x[2][2], + x[0][1] * x[1][2] - x[1][1] * x[0][2], + 0, - x[2][0] * x[1][2] - x[1][0] * x[2][2], - x[0][0] * x[2][2] - x[2][0] * x[0][2], - x[1][0] * x[0][2] - x[0][0] * x[1][2], - 0, + x[2][0] * x[1][2] - x[1][0] * x[2][2], + x[0][0] * x[2][2] - x[2][0] * x[0][2], + x[1][0] * x[0][2] - x[0][0] * x[1][2], + 0, - x[1][0] * x[2][1] - x[2][0] * x[1][1], - x[2][0] * x[0][1] - x[0][0] * x[2][1], - x[0][0] * x[1][1] - x[1][0] * x[0][1], - 0, + x[1][0] * x[2][1] - x[2][0] * x[1][1], + x[2][0] * x[0][1] - x[0][0] * x[2][1], + x[0][0] * x[1][1] - x[1][0] * x[0][1], + 0, - 0, - 0, - 0, - 1); + 0, + 0, + 0, + 1); T r = x[0][0] * s.x[0][0] + x[0][1] * s.x[1][0] + x[0][2] * s.x[2][0]; @@ -4149,7 +4526,8 @@ Matrix44::inverse() const IMATH_NOEXCEPT } else { - T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min(); + T mr = + IMATH_INTERNAL_NAMESPACE::abs (r) / std::numeric_limits::min (); for (int i = 0; i < 3; ++i) { @@ -4161,27 +4539,31 @@ Matrix44::inverse() const IMATH_NOEXCEPT } else { - return Matrix44(); + return Matrix44 (); } } } } - s.x[3][0] = -x[3][0] * s.x[0][0] - x[3][1] * s.x[1][0] - x[3][2] * s.x[2][0]; - s.x[3][1] = -x[3][0] * s.x[0][1] - x[3][1] * s.x[1][1] - x[3][2] * s.x[2][1]; - s.x[3][2] = -x[3][0] * s.x[0][2] - x[3][1] * s.x[1][2] - x[3][2] * s.x[2][2]; + s.x[3][0] = + -x[3][0] * s.x[0][0] - x[3][1] * s.x[1][0] - x[3][2] * s.x[2][0]; + s.x[3][1] = + -x[3][0] * s.x[0][1] - x[3][1] * s.x[1][1] - x[3][2] * s.x[2][1]; + s.x[3][2] = + -x[3][0] * s.x[0][2] - x[3][1] * s.x[1][2] - x[3][2] * s.x[2][2]; return s; } template IMATH_HOSTDEVICE constexpr inline T -Matrix44::fastMinor (const int r0, - const int r1, - const int r2, - const int c0, - const int c1, - const int c2) const IMATH_NOEXCEPT +Matrix44::fastMinor ( + const int r0, + const int r1, + const int r2, + const int c0, + const int c1, + const int c2) const IMATH_NOEXCEPT { return x[r0][c0] * (x[r1][c1] * x[r2][c2] - x[r1][c2] * x[r2][c1]) + x[r0][c1] * (x[r1][c2] * x[r2][c0] - x[r1][c0] * x[r2][c2]) + @@ -4199,33 +4581,30 @@ Matrix44::minorOf (const int r, const int c) const IMATH_NOEXCEPT int c1 = 1 + (c < 2 ? 1 : 0); int c2 = 2 + (c < 3 ? 1 : 0); - Matrix33 working (x[r0][c0], - x[r1][c0], - x[r2][c0], - x[r0][c1], - x[r1][c1], - x[r2][c1], - x[r0][c2], - x[r1][c2], - x[r2][c2]); + Matrix33 working ( + x[r0][c0], + x[r1][c0], + x[r2][c0], + x[r0][c1], + x[r1][c1], + x[r2][c1], + x[r0][c2], + x[r1][c2], + x[r2][c2]); - return working.determinant(); + return working.determinant (); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline T -Matrix44::determinant() const IMATH_NOEXCEPT +Matrix44::determinant () const IMATH_NOEXCEPT { T sum = (T) 0; - if (x[0][3] != 0.) - sum -= x[0][3] * fastMinor (1, 2, 3, 0, 1, 2); - if (x[1][3] != 0.) - sum += x[1][3] * fastMinor (0, 2, 3, 0, 1, 2); - if (x[2][3] != 0.) - sum -= x[2][3] * fastMinor (0, 1, 3, 0, 1, 2); - if (x[3][3] != 0.) - sum += x[3][3] * fastMinor (0, 1, 2, 0, 1, 2); + if (x[0][3] != 0.) sum -= x[0][3] * fastMinor (1, 2, 3, 0, 1, 2); + if (x[1][3] != 0.) sum += x[1][3] * fastMinor (0, 2, 3, 0, 1, 2); + if (x[2][3] != 0.) sum -= x[2][3] * fastMinor (0, 1, 3, 0, 1, 2); + if (x[3][3] != 0.) sum += x[3][3] * fastMinor (0, 1, 2, 0, 1, 2); return sum; } @@ -4280,9 +4659,9 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& Matrix44::setAxisAngle (const Vec3& axis, S angle) IMATH_NOEXCEPT { - Vec3 unit (axis.normalized()); - S sine = std::sin (angle); - S cosine = std::cos (angle); + Vec3 unit (axis.normalized ()); + S sine = std::sin (angle); + S cosine = std::cos (angle); x[0][0] = unit.x * unit.x * (1 - cosine) + cosine; x[0][1] = unit.x * unit.y * (1 - cosine) + unit.z * sine; @@ -4357,7 +4736,7 @@ Matrix44::rotate (const Vec3& r) IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::setScale (T s) IMATH_NOEXCEPT + Matrix44::setScale (T s) IMATH_NOEXCEPT { // // Set the matrix to a 3D homogeneous transform scale: @@ -4389,7 +4768,7 @@ Matrix44::setScale (T s) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::setScale (const Vec3& s) IMATH_NOEXCEPT + Matrix44::setScale (const Vec3& s) IMATH_NOEXCEPT { // // Set the matrix to a 3D homogeneous transform scale: @@ -4421,7 +4800,7 @@ Matrix44::setScale (const Vec3& s) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::scale (const Vec3& s) IMATH_NOEXCEPT + Matrix44::scale (const Vec3& s) IMATH_NOEXCEPT { x[0][0] *= s.x; x[0][1] *= s.x; @@ -4444,7 +4823,7 @@ Matrix44::scale (const Vec3& s) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::setTranslation (const Vec3& t) IMATH_NOEXCEPT + Matrix44::setTranslation (const Vec3& t) IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -4471,7 +4850,7 @@ Matrix44::setTranslation (const Vec3& t) IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline const Vec3 -Matrix44::translation() const IMATH_NOEXCEPT +Matrix44::translation () const IMATH_NOEXCEPT { return Vec3 (x[3][0], x[3][1], x[3][2]); } @@ -4479,7 +4858,7 @@ Matrix44::translation() const IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::translate (const Vec3& t) IMATH_NOEXCEPT + Matrix44::translate (const Vec3& t) IMATH_NOEXCEPT { x[3][0] += t.x * x[0][0] + t.y * x[1][0] + t.z * x[2][0]; x[3][1] += t.x * x[0][1] + t.y * x[1][1] + t.z * x[2][1]; @@ -4492,7 +4871,7 @@ Matrix44::translate (const Vec3& t) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::setShear (const Vec3& h) IMATH_NOEXCEPT + Matrix44::setShear (const Vec3& h) IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = 0; @@ -4520,7 +4899,7 @@ Matrix44::setShear (const Vec3& h) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::setShear (const Shear6& h) IMATH_NOEXCEPT + Matrix44::setShear (const Shear6& h) IMATH_NOEXCEPT { x[0][0] = 1; x[0][1] = h.yx; @@ -4548,7 +4927,7 @@ Matrix44::setShear (const Shear6& h) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::shear (const Vec3& h) IMATH_NOEXCEPT + Matrix44::shear (const Vec3& h) IMATH_NOEXCEPT { // // In this case, we don't need a temp. copy of the matrix @@ -4568,7 +4947,7 @@ Matrix44::shear (const Vec3& h) IMATH_NOEXCEPT template template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Matrix44& -Matrix44::shear (const Shear6& h) IMATH_NOEXCEPT + Matrix44::shear (const Shear6& h) IMATH_NOEXCEPT { Matrix44 P (*this); @@ -4590,25 +4969,27 @@ template std::ostream& operator<< (std::ostream& s, const Matrix22& m) { - std::ios_base::fmtflags oldFlags = s.flags(); - int width; + std::ios_base::fmtflags oldFlags = s.flags (); + int width; - if (s.flags() & std::ios_base::fixed) + if (s.flags () & std::ios_base::fixed) { s.setf (std::ios_base::showpoint); - width = static_cast (s.precision()) + 5; + width = static_cast (s.precision ()) + 5; } else { s.setf (std::ios_base::scientific); s.setf (std::ios_base::showpoint); - width = static_cast (s.precision()) + 8; + width = static_cast (s.precision ()) + 8; } - s << "(" << std::setw (width) << m[0][0] << " " << std::setw (width) << m[0][1] << "\n" + s << "(" << std::setw (width) << m[0][0] << " " << std::setw (width) + << m[0][1] << "\n" << - " " << std::setw (width) << m[1][0] << " " << std::setw (width) << m[1][1] << ")\n"; + " " << std::setw (width) << m[1][0] << " " << std::setw (width) + << m[1][1] << ")\n"; s.flags (oldFlags); return s; @@ -4618,31 +4999,31 @@ template std::ostream& operator<< (std::ostream& s, const Matrix33& m) { - std::ios_base::fmtflags oldFlags = s.flags(); - int width; + std::ios_base::fmtflags oldFlags = s.flags (); + int width; - if (s.flags() & std::ios_base::fixed) + if (s.flags () & std::ios_base::fixed) { s.setf (std::ios_base::showpoint); - width = static_cast (s.precision()) + 5; + width = static_cast (s.precision ()) + 5; } else { s.setf (std::ios_base::scientific); s.setf (std::ios_base::showpoint); - width = static_cast (s.precision()) + 8; + width = static_cast (s.precision ()) + 8; } - s << "(" << std::setw (width) << m[0][0] << " " << std::setw (width) << m[0][1] << " " - << std::setw (width) << m[0][2] << "\n" + s << "(" << std::setw (width) << m[0][0] << " " << std::setw (width) + << m[0][1] << " " << std::setw (width) << m[0][2] << "\n" << - " " << std::setw (width) << m[1][0] << " " << std::setw (width) << m[1][1] << " " - << std::setw (width) << m[1][2] << "\n" + " " << std::setw (width) << m[1][0] << " " << std::setw (width) + << m[1][1] << " " << std::setw (width) << m[1][2] << "\n" << - " " << std::setw (width) << m[2][0] << " " << std::setw (width) << m[2][1] << " " - << std::setw (width) << m[2][2] << ")\n"; + " " << std::setw (width) << m[2][0] << " " << std::setw (width) + << m[2][1] << " " << std::setw (width) << m[2][2] << ")\n"; s.flags (oldFlags); return s; @@ -4652,35 +5033,39 @@ template std::ostream& operator<< (std::ostream& s, const Matrix44& m) { - std::ios_base::fmtflags oldFlags = s.flags(); - int width; + std::ios_base::fmtflags oldFlags = s.flags (); + int width; - if (s.flags() & std::ios_base::fixed) + if (s.flags () & std::ios_base::fixed) { s.setf (std::ios_base::showpoint); - width = static_cast (s.precision()) + 5; + width = static_cast (s.precision ()) + 5; } else { s.setf (std::ios_base::scientific); s.setf (std::ios_base::showpoint); - width = static_cast (s.precision()) + 8; + width = static_cast (s.precision ()) + 8; } - s << "(" << std::setw (width) << m[0][0] << " " << std::setw (width) << m[0][1] << " " - << std::setw (width) << m[0][2] << " " << std::setw (width) << m[0][3] << "\n" + s << "(" << std::setw (width) << m[0][0] << " " << std::setw (width) + << m[0][1] << " " << std::setw (width) << m[0][2] << " " + << std::setw (width) << m[0][3] << "\n" << - " " << std::setw (width) << m[1][0] << " " << std::setw (width) << m[1][1] << " " - << std::setw (width) << m[1][2] << " " << std::setw (width) << m[1][3] << "\n" + " " << std::setw (width) << m[1][0] << " " << std::setw (width) + << m[1][1] << " " << std::setw (width) << m[1][2] << " " + << std::setw (width) << m[1][3] << "\n" << - " " << std::setw (width) << m[2][0] << " " << std::setw (width) << m[2][1] << " " - << std::setw (width) << m[2][2] << " " << std::setw (width) << m[2][3] << "\n" + " " << std::setw (width) << m[2][0] << " " << std::setw (width) + << m[2][1] << " " << std::setw (width) << m[2][2] << " " + << std::setw (width) << m[2][3] << "\n" << - " " << std::setw (width) << m[3][0] << " " << std::setw (width) << m[3][1] << " " - << std::setw (width) << m[3][2] << " " << std::setw (width) << m[3][3] << ")\n"; + " " << std::setw (width) << m[3][0] << " " << std::setw (width) + << m[3][1] << " " << std::setw (width) << m[3][2] << " " + << std::setw (width) << m[3][3] << ")\n"; s.flags (oldFlags); return s; @@ -4782,7 +5167,7 @@ operator*= (Vec3& v, const Matrix44& m) IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline Vec3 -IMATH_HOSTDEVICE operator* (const Vec3& v, const Matrix44& m) IMATH_NOEXCEPT +operator* (const Vec3& v, const Matrix44& m) IMATH_NOEXCEPT { S x = S (v.x * m.x[0][0] + v.y * m.x[1][0] + v.z * m.x[2][0] + m.x[3][0]); S y = S (v.x * m.x[0][1] + v.y * m.x[1][1] + v.z * m.x[2][1] + m.x[3][1]); @@ -4794,12 +5179,16 @@ IMATH_HOSTDEVICE operator* (const Vec3& v, const Matrix44& m) IMATH_NOEXCE template IMATH_HOSTDEVICE inline const Vec4& -IMATH_HOSTDEVICE operator*= (Vec4& v, const Matrix44& m) IMATH_NOEXCEPT +operator*= (Vec4& v, const Matrix44& m) IMATH_NOEXCEPT { - S x = S (v.x * m.x[0][0] + v.y * m.x[1][0] + v.z * m.x[2][0] + v.w * m.x[3][0]); - S y = S (v.x * m.x[0][1] + v.y * m.x[1][1] + v.z * m.x[2][1] + v.w * m.x[3][1]); - S z = S (v.x * m.x[0][2] + v.y * m.x[1][2] + v.z * m.x[2][2] + v.w * m.x[3][2]); - S w = S (v.x * m.x[0][3] + v.y * m.x[1][3] + v.z * m.x[2][3] + v.w * m.x[3][3]); + S x = S ( + v.x * m.x[0][0] + v.y * m.x[1][0] + v.z * m.x[2][0] + v.w * m.x[3][0]); + S y = S ( + v.x * m.x[0][1] + v.y * m.x[1][1] + v.z * m.x[2][1] + v.w * m.x[3][1]); + S z = S ( + v.x * m.x[0][2] + v.y * m.x[1][2] + v.z * m.x[2][2] + v.w * m.x[3][2]); + S w = S ( + v.x * m.x[0][3] + v.y * m.x[1][3] + v.z * m.x[2][3] + v.w * m.x[3][3]); v.x = x; v.y = y; @@ -4811,12 +5200,16 @@ IMATH_HOSTDEVICE operator*= (Vec4& v, const Matrix44& m) IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline Vec4 -IMATH_HOSTDEVICE operator* (const Vec4& v, const Matrix44& m) IMATH_NOEXCEPT -{ - S x = S (v.x * m.x[0][0] + v.y * m.x[1][0] + v.z * m.x[2][0] + v.w * m.x[3][0]); - S y = S (v.x * m.x[0][1] + v.y * m.x[1][1] + v.z * m.x[2][1] + v.w * m.x[3][1]); - S z = S (v.x * m.x[0][2] + v.y * m.x[1][2] + v.z * m.x[2][2] + v.w * m.x[3][2]); - S w = S (v.x * m.x[0][3] + v.y * m.x[1][3] + v.z * m.x[2][3] + v.w * m.x[3][3]); +operator* (const Vec4& v, const Matrix44& m) IMATH_NOEXCEPT +{ + S x = S ( + v.x * m.x[0][0] + v.y * m.x[1][0] + v.z * m.x[2][0] + v.w * m.x[3][0]); + S y = S ( + v.x * m.x[0][1] + v.y * m.x[1][1] + v.z * m.x[2][1] + v.w * m.x[3][1]); + S z = S ( + v.x * m.x[0][2] + v.y * m.x[1][2] + v.z * m.x[2][2] + v.w * m.x[3][2]); + S w = S ( + v.x * m.x[0][3] + v.y * m.x[1][3] + v.z * m.x[2][3] + v.w * m.x[3][3]); return Vec4 (x, y, z, w); } diff --git a/third_party/Imath-3.1.9/src/Imath/ImathMatrixAlgo.cpp b/third_party/Imath/src/Imath/ImathMatrixAlgo.cpp similarity index 68% rename from third_party/Imath-3.1.9/src/Imath/ImathMatrixAlgo.cpp rename to third_party/Imath/src/Imath/ImathMatrixAlgo.cpp index 746751f1..0603fa77 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathMatrixAlgo.cpp +++ b/third_party/Imath/src/Imath/ImathMatrixAlgo.cpp @@ -50,8 +50,8 @@ namespace class KahanSum { - public: - KahanSum() : _total (0), _correction (0) {} +public: + KahanSum () : _total (0), _correction (0) {} void operator+= (const double val) { @@ -61,9 +61,9 @@ class KahanSum _total = t; } - double get() const { return _total; } + double get () const { return _total; } - private: +private: double _total; double _correction; }; @@ -72,18 +72,18 @@ class KahanSum template M44d -procrustesRotationAndTranslation (const Vec3* A, - const Vec3* B, - const T* weights, - const size_t numPoints, - const bool doScale) +procrustesRotationAndTranslation ( + const Vec3* A, + const Vec3* B, + const T* weights, + const size_t numPoints, + const bool doScale) { - if (numPoints == 0) - return M44d(); + if (numPoints == 0) return M44d (); // Always do the accumulation in double precision: - V3d Acenter (0.0); - V3d Bcenter (0.0); + V3d Acenter (0.0); + V3d Bcenter (0.0); double weightsSum = 0.0; if (weights == 0) @@ -107,8 +107,7 @@ procrustesRotationAndTranslation (const Vec3* A, } } - if (weightsSum == 0) - return M44d(); + if (weightsSum == 0) return M44d (); Acenter /= weightsSum; Bcenter /= weightsSum; @@ -133,17 +132,18 @@ procrustesRotationAndTranslation (const Vec3* A, for (size_t i = 0; i < numPoints; ++i) { const double w = weights[i]; - C += outerProduct (w * ((V3d) B[i] - Bcenter), (V3d) A[i] - Acenter); + C += + outerProduct (w * ((V3d) B[i] - Bcenter), (V3d) A[i] - Acenter); } } M33d U, V; - V3d S; - jacobiSVD (C, U, S, V, std::numeric_limits::epsilon(), true); + V3d S; + jacobiSVD (C, U, S, V, std::numeric_limits::epsilon (), true); // We want Q.transposed() here since we are going to be using it in the // Imath style (multiplying vectors on the right, v' = v*A^T): - const M33d Qt = V * U.transposed(); + const M33d Qt = V * U.transposed (); double s = 1.0; if (doScale && numPoints > 1) @@ -171,12 +171,13 @@ procrustesRotationAndTranslation (const Vec3* A, if (weights == 0) { for (size_t i = 0; i < numPoints; ++i) - traceATA += ((V3d) A[i] - Acenter).length2(); + traceATA += ((V3d) A[i] - Acenter).length2 (); } else { for (size_t i = 0; i < numPoints; ++i) - traceATA += ((double) weights[i]) * ((V3d) A[i] - Acenter).length2(); + traceATA += + ((double) weights[i]) * ((V3d) A[i] - Acenter).length2 (); } KahanSum traceBATQ; @@ -184,7 +185,7 @@ procrustesRotationAndTranslation (const Vec3* A, for (int j = 0; j < 3; ++j) traceBATQ += Qt[j][i] * C[i][j]; - s = traceBATQ.get() / traceATA.get(); + s = traceBATQ.get () / traceATA.get (); } // Q is the rotation part of what we want to return. @@ -208,22 +209,23 @@ procrustesRotationAndTranslation (const Vec3* A, // (ofc the whole thing is transposed for Imath). const V3d translate = Bcenter - s * Acenter * Qt; - return M44d (s * Qt.x[0][0], - s * Qt.x[0][1], - s * Qt.x[0][2], - T (0), - s * Qt.x[1][0], - s * Qt.x[1][1], - s * Qt.x[1][2], - T (0), - s * Qt.x[2][0], - s * Qt.x[2][1], - s * Qt.x[2][2], - T (0), - translate.x, - translate.y, - translate.z, - T (1)); + return M44d ( + s * Qt.x[0][0], + s * Qt.x[0][1], + s * Qt.x[0][2], + T (0), + s * Qt.x[1][0], + s * Qt.x[1][1], + s * Qt.x[1][2], + T (0), + s * Qt.x[2][0], + s * Qt.x[2][1], + s * Qt.x[2][2], + T (0), + translate.x, + translate.y, + translate.z, + T (1)); } // procrustesRotationAndTranslation /// @@ -235,36 +237,36 @@ procrustesRotationAndTranslation (const Vec3* A, template M44d -procrustesRotationAndTranslation (const Vec3* A, - const Vec3* B, - const size_t numPoints, - const bool doScale) +procrustesRotationAndTranslation ( + const Vec3* A, + const Vec3* B, + const size_t numPoints, + const bool doScale) { - return procrustesRotationAndTranslation (A, B, (const T*) 0, numPoints, doScale); + return procrustesRotationAndTranslation ( + A, B, (const T*) 0, numPoints, doScale); } // procrustesRotationAndTranslation /// TODO -template IMATH_EXPORT M44d procrustesRotationAndTranslation (const V3d* from, - const V3d* to, - const size_t numPoints, - const bool doScale); +template IMATH_EXPORT M44d procrustesRotationAndTranslation ( + const V3d* from, const V3d* to, const size_t numPoints, const bool doScale); /// TODO -template IMATH_EXPORT M44d procrustesRotationAndTranslation (const V3f* from, - const V3f* to, - const size_t numPoints, - const bool doScale); +template IMATH_EXPORT M44d procrustesRotationAndTranslation ( + const V3f* from, const V3f* to, const size_t numPoints, const bool doScale); /// TODO -template IMATH_EXPORT M44d procrustesRotationAndTranslation (const V3d* from, - const V3d* to, - const double* weights, - const size_t numPoints, - const bool doScale); +template IMATH_EXPORT M44d procrustesRotationAndTranslation ( + const V3d* from, + const V3d* to, + const double* weights, + const size_t numPoints, + const bool doScale); /// TODO -template IMATH_EXPORT M44d procrustesRotationAndTranslation (const V3f* from, - const V3f* to, - const float* weights, - const size_t numPoints, - const bool doScale); +template IMATH_EXPORT M44d procrustesRotationAndTranslation ( + const V3f* from, + const V3f* to, + const float* weights, + const size_t numPoints, + const bool doScale); namespace { @@ -280,7 +282,8 @@ namespace // need to explicitly construct the J matrix. template void -jacobiRotateRight (IMATH_INTERNAL_NAMESPACE::Matrix33& A, const T c, const T s) +jacobiRotateRight ( + IMATH_INTERNAL_NAMESPACE::Matrix33& A, const T c, const T s) { for (int i = 0; i < 3; ++i) { @@ -293,11 +296,12 @@ jacobiRotateRight (IMATH_INTERNAL_NAMESPACE::Matrix33& A, const T c, const T template void -jacobiRotateRight (IMATH_INTERNAL_NAMESPACE::Matrix44& A, - const int j, - const int k, - const T c, - const T s) +jacobiRotateRight ( + IMATH_INTERNAL_NAMESPACE::Matrix44& A, + const int j, + const int k, + const T c, + const T s) { for (int i = 0; i < 4; ++i) { @@ -325,10 +329,11 @@ jacobiRotateRight (IMATH_INTERNAL_NAMESPACE::Matrix44& A, // and the second diagonalizes the symmetric matrix. template bool -twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix33& A, - IMATH_INTERNAL_NAMESPACE::Matrix33& U, - IMATH_INTERNAL_NAMESPACE::Matrix33& V, - const T tol) +twoSidedJacobiRotation ( + IMATH_INTERNAL_NAMESPACE::Matrix33& A, + IMATH_INTERNAL_NAMESPACE::Matrix33& U, + IMATH_INTERNAL_NAMESPACE::Matrix33& V, + const T tol) { // Load everything into local variables to make things easier on the // optimizer: @@ -349,10 +354,11 @@ twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix33& A, T mu_2 = x - y; T c, s; - if (std::abs (mu_2) <= tol * std::abs (mu_1)) // Already symmetric (to tolerance) - { // Note that the <= is important here - c = T (1); // because we want to bypass the computation - s = T (0); // of rho if mu_1 = mu_2 = 0. + if (std::abs (mu_2) <= + tol * std::abs (mu_1)) // Already symmetric (to tolerance) + { // Note that the <= is important here + c = T (1); // because we want to bypass the computation + s = T (0); // of rho if mu_1 = mu_2 = 0. const T p = w; const T r = z; @@ -365,8 +371,7 @@ twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix33& A, const T rho = mu_1 / mu_2; s = T (1) / std::sqrt (T (1) + rho * rho); - if (rho < 0) - s = -s; + if (rho < 0) s = -s; c = s * rho; mu_1 = s * (x + y) + c * (z - w); // = r - p @@ -387,9 +392,8 @@ twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix33& A, else { const T rho_2 = mu_1 / mu_2; - T t_2 = T (1) / (std::abs (rho_2) + std::sqrt (1 + rho_2 * rho_2)); - if (rho_2 < 0) - t_2 = -t_2; + T t_2 = T (1) / (std::abs (rho_2) + std::sqrt (1 + rho_2 * rho_2)); + if (rho_2 < 0) t_2 = -t_2; c_2 = T (1) / std::sqrt (T (1) + t_2 * t_2); s_2 = c_2 * t_2; @@ -466,12 +470,13 @@ twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix33& A, template bool -twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix44& A, - int j, - int k, - IMATH_INTERNAL_NAMESPACE::Matrix44& U, - IMATH_INTERNAL_NAMESPACE::Matrix44& V, - const T tol) +twoSidedJacobiRotation ( + IMATH_INTERNAL_NAMESPACE::Matrix44& A, + int j, + int k, + IMATH_INTERNAL_NAMESPACE::Matrix44& U, + IMATH_INTERNAL_NAMESPACE::Matrix44& V, + const T tol) { // Load everything into local variables to make things easier on the // optimizer: @@ -492,10 +497,11 @@ twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix44& A, T mu_2 = x - y; T c, s; - if (std::abs (mu_2) <= tol * std::abs (mu_1)) // Already symmetric (to tolerance) - { // Note that the <= is important here - c = T (1); // because we want to bypass the computation - s = T (0); // of rho if mu_1 = mu_2 = 0. + if (std::abs (mu_2) <= + tol * std::abs (mu_1)) // Already symmetric (to tolerance) + { // Note that the <= is important here + c = T (1); // because we want to bypass the computation + s = T (0); // of rho if mu_1 = mu_2 = 0. const T p = w; const T r = z; @@ -508,8 +514,7 @@ twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix44& A, const T rho = mu_1 / mu_2; s = T (1) / std::sqrt (T (1) + rho * rho); - if (rho < 0) - s = -s; + if (rho < 0) s = -s; c = s * rho; mu_1 = s * (x + y) + c * (z - w); // = r - p @@ -530,9 +535,8 @@ twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix44& A, else { const T rho_2 = mu_1 / mu_2; - T t_2 = T (1) / (std::abs (rho_2) + std::sqrt (1 + rho_2 * rho_2)); - if (rho_2 < 0) - t_2 = -t_2; + T t_2 = T (1) / (std::abs (rho_2) + std::sqrt (1 + rho_2 * rho_2)); + if (rho_2 < 0) t_2 = -t_2; c_2 = T (1) / std::sqrt (T (1) + t_2 * t_2); s_2 = c_2 * t_2; @@ -566,8 +570,7 @@ twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix44& A, // Rotate the entries that _weren't_ involved in the 2x2 SVD: for (int l = 0; l < 4; ++l) { - if (l == j || l == k) - continue; + if (l == j || l == k) continue; // Rotate on the left by // [ 1 ] @@ -590,8 +593,7 @@ twoSidedJacobiRotation (IMATH_INTERNAL_NAMESPACE::Matrix44& A, for (int l = 0; l < 4; ++l) { // We set the A[j/k][j/k] entries already - if (l == j || l == k) - continue; + if (l == j || l == k) continue; // Rotate on the right by // [ 1 ] @@ -659,8 +661,7 @@ maxOffDiag (const IMATH_INTERNAL_NAMESPACE::Matrix44& A) { for (int j = 0; j < 4; ++j) { - if (i != j) - result = std::max (result, std::abs (A[i][j])); + if (i != j) result = std::max (result, std::abs (A[i][j])); } } @@ -669,12 +670,13 @@ maxOffDiag (const IMATH_INTERNAL_NAMESPACE::Matrix44& A) template void -twoSidedJacobiSVD (IMATH_INTERNAL_NAMESPACE::Matrix33 A, - IMATH_INTERNAL_NAMESPACE::Matrix33& U, - IMATH_INTERNAL_NAMESPACE::Vec3& S, - IMATH_INTERNAL_NAMESPACE::Matrix33& V, - const T tol, - const bool forcePositiveDeterminant) +twoSidedJacobiSVD ( + IMATH_INTERNAL_NAMESPACE::Matrix33 A, + IMATH_INTERNAL_NAMESPACE::Matrix33& U, + IMATH_INTERNAL_NAMESPACE::Vec3& S, + IMATH_INTERNAL_NAMESPACE::Matrix33& V, + const T tol, + const bool forcePositiveDeterminant) { // The two-sided Jacobi SVD works by repeatedly zeroing out // off-diagonal entries of the matrix, 2 at a time. Basically, @@ -705,22 +707,25 @@ twoSidedJacobiSVD (IMATH_INTERNAL_NAMESPACE::Matrix33 A, // works so well, FWIW) and because (2) by applying everything to the original // matrix A instead of computing (A^T * A) we avoid any precision loss that // would result from that. - U.makeIdentity(); - V.makeIdentity(); - - const int maxIter = 20; // In case we get really unlucky, prevents infinite loops - const T absTol = tol * maxOffDiag (A); // Tolerance is in terms of the maximum - if (absTol != 0) // _off-diagonal_ entry. + U.makeIdentity (); + V.makeIdentity (); + + const int maxIter = + 20; // In case we get really unlucky, prevents infinite loops + const T absTol = + tol * maxOffDiag (A); // Tolerance is in terms of the maximum + if (absTol != 0) // _off-diagonal_ entry. { int numIter = 0; do { ++numIter; bool changed = twoSidedJacobiRotation (A, U, V, tol); - changed = twoSidedJacobiRotation (A, U, V, tol) || changed; - changed = twoSidedJacobiRotation (A, U, V, tol) || changed; - if (!changed) - break; + changed = twoSidedJacobiRotation (A, U, V, tol) || + changed; + changed = twoSidedJacobiRotation (A, U, V, tol) || + changed; + if (!changed) break; } while (maxOffDiag (A) > absTol && numIter < maxIter); } @@ -777,14 +782,14 @@ twoSidedJacobiSVD (IMATH_INTERNAL_NAMESPACE::Matrix33 A, // if U has a negative determinant, and // U*S*L*L*V = U*(S*L)*(L*V) // if V has a neg. determinant. - if (U.determinant() < 0) + if (U.determinant () < 0) { for (int i = 0; i < 3; ++i) U[i][2] = -U[i][2]; S.z = -S.z; } - if (V.determinant() < 0) + if (V.determinant () < 0) { for (int i = 0; i < 3; ++i) V[i][2] = -V[i][2]; @@ -795,33 +800,35 @@ twoSidedJacobiSVD (IMATH_INTERNAL_NAMESPACE::Matrix33 A, template void -twoSidedJacobiSVD (IMATH_INTERNAL_NAMESPACE::Matrix44 A, - IMATH_INTERNAL_NAMESPACE::Matrix44& U, - IMATH_INTERNAL_NAMESPACE::Vec4& S, - IMATH_INTERNAL_NAMESPACE::Matrix44& V, - const T tol, - const bool forcePositiveDeterminant) +twoSidedJacobiSVD ( + IMATH_INTERNAL_NAMESPACE::Matrix44 A, + IMATH_INTERNAL_NAMESPACE::Matrix44& U, + IMATH_INTERNAL_NAMESPACE::Vec4& S, + IMATH_INTERNAL_NAMESPACE::Matrix44& V, + const T tol, + const bool forcePositiveDeterminant) { // Please see the Matrix33 version for a detailed description of the algorithm. - U.makeIdentity(); - V.makeIdentity(); - - const int maxIter = 20; // In case we get really unlucky, prevents infinite loops - const T absTol = tol * maxOffDiag (A); // Tolerance is in terms of the maximum - if (absTol != 0) // _off-diagonal_ entry. + U.makeIdentity (); + V.makeIdentity (); + + const int maxIter = + 20; // In case we get really unlucky, prevents infinite loops + const T absTol = + tol * maxOffDiag (A); // Tolerance is in terms of the maximum + if (absTol != 0) // _off-diagonal_ entry. { int numIter = 0; do { ++numIter; bool changed = twoSidedJacobiRotation (A, 0, 1, U, V, tol); - changed = twoSidedJacobiRotation (A, 0, 2, U, V, tol) || changed; - changed = twoSidedJacobiRotation (A, 0, 3, U, V, tol) || changed; - changed = twoSidedJacobiRotation (A, 1, 2, U, V, tol) || changed; - changed = twoSidedJacobiRotation (A, 1, 3, U, V, tol) || changed; - changed = twoSidedJacobiRotation (A, 2, 3, U, V, tol) || changed; - if (!changed) - break; + changed = twoSidedJacobiRotation (A, 0, 2, U, V, tol) || changed; + changed = twoSidedJacobiRotation (A, 0, 3, U, V, tol) || changed; + changed = twoSidedJacobiRotation (A, 1, 2, U, V, tol) || changed; + changed = twoSidedJacobiRotation (A, 1, 3, U, V, tol) || changed; + changed = twoSidedJacobiRotation (A, 2, 3, U, V, tol) || changed; + if (!changed) break; } while (maxOffDiag (A) > absTol && numIter < maxIter); } @@ -850,8 +857,10 @@ twoSidedJacobiSVD (IMATH_INTERNAL_NAMESPACE::Matrix44 A, // Order the singular values from largest to smallest using insertion sort: for (int i = 1; i < 4; ++i) { - const IMATH_INTERNAL_NAMESPACE::Vec4 uCol (U[0][i], U[1][i], U[2][i], U[3][i]); - const IMATH_INTERNAL_NAMESPACE::Vec4 vCol (V[0][i], V[1][i], V[2][i], V[3][i]); + const IMATH_INTERNAL_NAMESPACE::Vec4 uCol ( + U[0][i], U[1][i], U[2][i], U[3][i]); + const IMATH_INTERNAL_NAMESPACE::Vec4 vCol ( + V[0][i], V[1][i], V[2][i], V[3][i]); const T sVal = S[i]; int j = i - 1; @@ -864,8 +873,7 @@ twoSidedJacobiSVD (IMATH_INTERNAL_NAMESPACE::Matrix44 A, S[j + 1] = S[j]; --j; - if (j < 0) - break; + if (j < 0) break; } for (int k = 0; k < 4; ++k) @@ -889,14 +897,14 @@ twoSidedJacobiSVD (IMATH_INTERNAL_NAMESPACE::Matrix44 A, // if U has a negative determinant, and // U*S*L*L*V = U*(S*L)*(L*V) // if V has a neg. determinant. - if (U.determinant() < 0) + if (U.determinant () < 0) { for (int i = 0; i < 4; ++i) U[i][3] = -U[i][3]; S[3] = -S[3]; } - if (V.determinant() < 0) + if (V.determinant () < 0) { for (int i = 0; i < 4; ++i) V[i][3] = -V[i][3]; @@ -910,12 +918,13 @@ twoSidedJacobiSVD (IMATH_INTERNAL_NAMESPACE::Matrix44 A, /// TODO template void -jacobiSVD (const IMATH_INTERNAL_NAMESPACE::Matrix33& A, - IMATH_INTERNAL_NAMESPACE::Matrix33& U, - IMATH_INTERNAL_NAMESPACE::Vec3& S, - IMATH_INTERNAL_NAMESPACE::Matrix33& V, - const T tol, - const bool forcePositiveDeterminant) +jacobiSVD ( + const IMATH_INTERNAL_NAMESPACE::Matrix33& A, + IMATH_INTERNAL_NAMESPACE::Matrix33& U, + IMATH_INTERNAL_NAMESPACE::Vec3& S, + IMATH_INTERNAL_NAMESPACE::Matrix33& V, + const T tol, + const bool forcePositiveDeterminant) { twoSidedJacobiSVD (A, U, S, V, tol, forcePositiveDeterminant); } @@ -923,55 +932,61 @@ jacobiSVD (const IMATH_INTERNAL_NAMESPACE::Matrix33& A, /// TODO template void -jacobiSVD (const IMATH_INTERNAL_NAMESPACE::Matrix44& A, - IMATH_INTERNAL_NAMESPACE::Matrix44& U, - IMATH_INTERNAL_NAMESPACE::Vec4& S, - IMATH_INTERNAL_NAMESPACE::Matrix44& V, - const T tol, - const bool forcePositiveDeterminant) +jacobiSVD ( + const IMATH_INTERNAL_NAMESPACE::Matrix44& A, + IMATH_INTERNAL_NAMESPACE::Matrix44& U, + IMATH_INTERNAL_NAMESPACE::Vec4& S, + IMATH_INTERNAL_NAMESPACE::Matrix44& V, + const T tol, + const bool forcePositiveDeterminant) { twoSidedJacobiSVD (A, U, S, V, tol, forcePositiveDeterminant); } /// TODO -template IMATH_EXPORT void jacobiSVD (const IMATH_INTERNAL_NAMESPACE::Matrix33& A, - IMATH_INTERNAL_NAMESPACE::Matrix33& U, - IMATH_INTERNAL_NAMESPACE::Vec3& S, - IMATH_INTERNAL_NAMESPACE::Matrix33& V, - const float tol, - const bool forcePositiveDeterminant); +template IMATH_EXPORT void jacobiSVD ( + const IMATH_INTERNAL_NAMESPACE::Matrix33& A, + IMATH_INTERNAL_NAMESPACE::Matrix33& U, + IMATH_INTERNAL_NAMESPACE::Vec3& S, + IMATH_INTERNAL_NAMESPACE::Matrix33& V, + const float tol, + const bool forcePositiveDeterminant); /// TODO -template IMATH_EXPORT void jacobiSVD (const IMATH_INTERNAL_NAMESPACE::Matrix33& A, - IMATH_INTERNAL_NAMESPACE::Matrix33& U, - IMATH_INTERNAL_NAMESPACE::Vec3& S, - IMATH_INTERNAL_NAMESPACE::Matrix33& V, - const double tol, - const bool forcePositiveDeterminant); +template IMATH_EXPORT void jacobiSVD ( + const IMATH_INTERNAL_NAMESPACE::Matrix33& A, + IMATH_INTERNAL_NAMESPACE::Matrix33& U, + IMATH_INTERNAL_NAMESPACE::Vec3& S, + IMATH_INTERNAL_NAMESPACE::Matrix33& V, + const double tol, + const bool forcePositiveDeterminant); /// TODO -template IMATH_EXPORT void jacobiSVD (const IMATH_INTERNAL_NAMESPACE::Matrix44& A, - IMATH_INTERNAL_NAMESPACE::Matrix44& U, - IMATH_INTERNAL_NAMESPACE::Vec4& S, - IMATH_INTERNAL_NAMESPACE::Matrix44& V, - const float tol, - const bool forcePositiveDeterminant); +template IMATH_EXPORT void jacobiSVD ( + const IMATH_INTERNAL_NAMESPACE::Matrix44& A, + IMATH_INTERNAL_NAMESPACE::Matrix44& U, + IMATH_INTERNAL_NAMESPACE::Vec4& S, + IMATH_INTERNAL_NAMESPACE::Matrix44& V, + const float tol, + const bool forcePositiveDeterminant); /// TODO -template IMATH_EXPORT void jacobiSVD (const IMATH_INTERNAL_NAMESPACE::Matrix44& A, - IMATH_INTERNAL_NAMESPACE::Matrix44& U, - IMATH_INTERNAL_NAMESPACE::Vec4& S, - IMATH_INTERNAL_NAMESPACE::Matrix44& V, - const double tol, - const bool forcePositiveDeterminant); +template IMATH_EXPORT void jacobiSVD ( + const IMATH_INTERNAL_NAMESPACE::Matrix44& A, + IMATH_INTERNAL_NAMESPACE::Matrix44& U, + IMATH_INTERNAL_NAMESPACE::Vec4& S, + IMATH_INTERNAL_NAMESPACE::Matrix44& V, + const double tol, + const bool forcePositiveDeterminant); namespace { template inline void -jacobiRotateRight (TM& A, const typename TM::BaseType s, const typename TM::BaseType tau) +jacobiRotateRight ( + TM& A, const typename TM::BaseType s, const typename TM::BaseType tau) { typedef typename TM::BaseType T; - for (unsigned int i = 0; i < TM::dimensions(); ++i) + for (unsigned int i = 0; i < TM::dimensions (); ++i) { const T nu1 = A[i][j]; const T nu2 = A[i][k]; @@ -1006,7 +1021,8 @@ jacobiRotation (Matrix33& A, Matrix33& V, Vec3& Z, const T tol) return false; } const T rho = mu1 / mu2; - const T t = (rho < 0 ? T (-1) : T (1)) / (std::abs (rho) + std::sqrt (1 + rho * rho)); + const T t = (rho < 0 ? T (-1) : T (1)) / + (std::abs (rho) + std::sqrt (1 + rho * rho)); const T c = T (1) / std::sqrt (T (1) + t * t); const T s = t * c; const T tau = s / (T (1) + c); @@ -1024,12 +1040,12 @@ jacobiRotation (Matrix33& A, Matrix33& V, Vec3& Z, const T tol) // We only update upper triagnular elements of A, since // A is supposed to be symmetric. - T& offd1 = l < j ? A[l][j] : A[j][l]; - T& offd2 = l < k ? A[l][k] : A[k][l]; - const T nu1 = offd1; - const T nu2 = offd2; - offd1 = nu1 - s * (nu2 + tau * nu1); - offd2 = nu2 + s * (nu1 - tau * nu2); + T& offd1 = l < j ? A[l][j] : A[j][l]; + T& offd2 = l < k ? A[l][k] : A[k][l]; + const T nu1 = offd1; + const T nu2 = offd2; + offd1 = nu1 - s * (nu2 + tau * nu1); + offd2 = nu2 + s * (nu1 - tau * nu2); // Apply rotation to V jacobiRotateRight (V, s, tau); @@ -1058,7 +1074,8 @@ jacobiRotation (Matrix44& A, Matrix44& V, Vec4& Z, const T tol) } const T rho = mu1 / mu2; - const T t = (rho < 0 ? T (-1) : T (1)) / (std::abs (rho) + std::sqrt (1 + rho * rho)); + const T t = (rho < 0 ? T (-1) : T (1)) / + (std::abs (rho) + std::sqrt (1 + rho * rho)); const T c = T (1) / std::sqrt (T (1) + t * t); const T s = c * t; const T tau = s / (T (1) + c); @@ -1071,19 +1088,19 @@ jacobiRotation (Matrix44& A, Matrix44& V, Vec4& Z, const T tol) A[j][k] = 0; { - T& offd1 = l1 < j ? A[l1][j] : A[j][l1]; - T& offd2 = l1 < k ? A[l1][k] : A[k][l1]; - const T nu1 = offd1; - const T nu2 = offd2; + T& offd1 = l1 < j ? A[l1][j] : A[j][l1]; + T& offd2 = l1 < k ? A[l1][k] : A[k][l1]; + const T nu1 = offd1; + const T nu2 = offd2; offd1 -= s * (nu2 + tau * nu1); offd2 += s * (nu1 - tau * nu2); } { - T& offd1 = l2 < j ? A[l2][j] : A[j][l2]; - T& offd2 = l2 < k ? A[l2][k] : A[k][l2]; - const T nu1 = offd1; - const T nu2 = offd2; + T& offd1 = l2 < j ? A[l2][j] : A[j][l2]; + T& offd2 = l2 < k ? A[l2][k] : A[k][l2]; + const T nu1 = offd1; + const T nu2 = offd2; offd1 -= s * (nu2 + tau * nu1); offd2 += s * (nu1 - tau * nu2); } @@ -1098,9 +1115,9 @@ IMATH_CONSTEXPR14 inline typename TM::BaseType maxOffDiagSymm (const TM& A) { typedef typename TM::BaseType T; - T result = 0; - for (unsigned int i = 0; i < TM::dimensions(); ++i) - for (unsigned int j = i + 1; j < TM::dimensions(); ++j) + T result = 0; + for (unsigned int i = 0; i < TM::dimensions (); ++i) + for (unsigned int j = i + 1; j < TM::dimensions (); ++j) result = std::max (result, std::abs (A[i][j])); return result; @@ -1112,15 +1129,17 @@ template void jacobiEigenSolver (Matrix33& A, Vec3& S, Matrix33& V, const T tol) { - V.makeIdentity(); + V.makeIdentity (); for (int i = 0; i < 3; ++i) { S[i] = A[i][i]; } - const int maxIter = 20; // In case we get really unlucky, prevents infinite loops - const T absTol = tol * maxOffDiagSymm (A); // Tolerance is in terms of the maximum - if (absTol != 0) // _off-diagonal_ entry. + const int maxIter = + 20; // In case we get really unlucky, prevents infinite loops + const T absTol = + tol * maxOffDiagSymm (A); // Tolerance is in terms of the maximum + if (absTol != 0) // _off-diagonal_ entry. { int numIter = 0; do @@ -1141,8 +1160,7 @@ jacobiEigenSolver (Matrix33& A, Vec3& S, Matrix33& V, const T tol) { A[i][i] = S[i] += Z[i]; } - if (!changed) - break; + if (!changed) break; } while (maxOffDiagSymm (A) > absTol && numIter < maxIter); } } @@ -1151,34 +1169,35 @@ template void jacobiEigenSolver (Matrix44& A, Vec4& S, Matrix44& V, const T tol) { - V.makeIdentity(); + V.makeIdentity (); for (int i = 0; i < 4; ++i) { S[i] = A[i][i]; } - const int maxIter = 20; // In case we get really unlucky, prevents infinite loops - const T absTol = tol * maxOffDiagSymm (A); // Tolerance is in terms of the maximum - if (absTol != 0) // _off-diagonal_ entry. + const int maxIter = + 20; // In case we get really unlucky, prevents infinite loops + const T absTol = + tol * maxOffDiagSymm (A); // Tolerance is in terms of the maximum + if (absTol != 0) // _off-diagonal_ entry. { int numIter = 0; do { ++numIter; Vec4 Z (0, 0, 0, 0); - bool changed = jacobiRotation<0, 1, 2, 3> (A, V, Z, tol); - changed = jacobiRotation<0, 2, 1, 3> (A, V, Z, tol) || changed; - changed = jacobiRotation<0, 3, 1, 2> (A, V, Z, tol) || changed; - changed = jacobiRotation<1, 2, 0, 3> (A, V, Z, tol) || changed; - changed = jacobiRotation<1, 3, 0, 2> (A, V, Z, tol) || changed; - changed = jacobiRotation<2, 3, 0, 1> (A, V, Z, tol) || changed; + bool changed = jacobiRotation<0, 1, 2, 3> (A, V, Z, tol); + changed = jacobiRotation<0, 2, 1, 3> (A, V, Z, tol) || changed; + changed = jacobiRotation<0, 3, 1, 2> (A, V, Z, tol) || changed; + changed = jacobiRotation<1, 2, 0, 3> (A, V, Z, tol) || changed; + changed = jacobiRotation<1, 3, 0, 2> (A, V, Z, tol) || changed; + changed = jacobiRotation<2, 3, 0, 1> (A, V, Z, tol) || changed; for (int i = 0; i < 4; ++i) { A[i][i] = S[i] += Z[i]; } - if (!changed) - break; + if (!changed) break; } while (maxOffDiagSymm (A) > absTol && numIter < maxIter); } } @@ -1192,13 +1211,12 @@ maxEigenVector (TM& A, TV& V) jacobiEigenSolver (A, S, MV); int maxIdx (0); - for (unsigned int i = 1; i < TV::dimensions(); ++i) + for (unsigned int i = 1; i < TV::dimensions (); ++i) { - if (std::abs (S[i]) > std::abs (S[maxIdx])) - maxIdx = i; + if (std::abs (S[i]) > std::abs (S[maxIdx])) maxIdx = i; } - for (unsigned int i = 0; i < TV::dimensions(); ++i) + for (unsigned int i = 0; i < TV::dimensions (); ++i) V[i] = MV[i][maxIdx]; } @@ -1211,35 +1229,43 @@ minEigenVector (TM& A, TV& V) jacobiEigenSolver (A, S, MV); int minIdx (0); - for (unsigned int i = 1; i < TV::dimensions(); ++i) + for (unsigned int i = 1; i < TV::dimensions (); ++i) { - if (std::abs (S[i]) < std::abs (S[minIdx])) - minIdx = i; + if (std::abs (S[i]) < std::abs (S[minIdx])) minIdx = i; } - for (unsigned int i = 0; i < TV::dimensions(); ++i) + for (unsigned int i = 0; i < TV::dimensions (); ++i) V[i] = MV[i][minIdx]; } -template IMATH_EXPORT void -jacobiEigenSolver (Matrix33& A, Vec3& S, Matrix33& V, const float tol); -template IMATH_EXPORT void -jacobiEigenSolver (Matrix33& A, Vec3& S, Matrix33& V, const double tol); -template IMATH_EXPORT void -jacobiEigenSolver (Matrix44& A, Vec4& S, Matrix44& V, const float tol); -template IMATH_EXPORT void -jacobiEigenSolver (Matrix44& A, Vec4& S, Matrix44& V, const double tol); +template IMATH_EXPORT void jacobiEigenSolver ( + Matrix33& A, Vec3& S, Matrix33& V, const float tol); +template IMATH_EXPORT void jacobiEigenSolver ( + Matrix33& A, + Vec3& S, + Matrix33& V, + const double tol); +template IMATH_EXPORT void jacobiEigenSolver ( + Matrix44& A, Vec4& S, Matrix44& V, const float tol); +template IMATH_EXPORT void jacobiEigenSolver ( + Matrix44& A, + Vec4& S, + Matrix44& V, + const double tol); template IMATH_EXPORT void maxEigenVector (Matrix33& A, Vec3& S); template IMATH_EXPORT void maxEigenVector (Matrix44& A, Vec4& S); -template IMATH_EXPORT void maxEigenVector (Matrix33& A, Vec3& S); -template IMATH_EXPORT void maxEigenVector (Matrix44& A, Vec4& S); +template IMATH_EXPORT void +maxEigenVector (Matrix33& A, Vec3& S); +template IMATH_EXPORT void +maxEigenVector (Matrix44& A, Vec4& S); template IMATH_EXPORT void minEigenVector (Matrix33& A, Vec3& S); template IMATH_EXPORT void minEigenVector (Matrix44& A, Vec4& S); -template IMATH_EXPORT void minEigenVector (Matrix33& A, Vec3& S); -template IMATH_EXPORT void minEigenVector (Matrix44& A, Vec4& S); - +template IMATH_EXPORT void +minEigenVector (Matrix33& A, Vec3& S); +template IMATH_EXPORT void +minEigenVector (Matrix44& A, Vec4& S); IMATH_INTERNAL_NAMESPACE_SOURCE_EXIT diff --git a/third_party/Imath-3.1.9/src/Imath/ImathMatrixAlgo.h b/third_party/Imath/src/Imath/ImathMatrixAlgo.h similarity index 78% rename from third_party/Imath-3.1.9/src/Imath/ImathMatrixAlgo.h rename to third_party/Imath/src/Imath/ImathMatrixAlgo.h index ddc85f87..a5cf40c1 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathMatrixAlgo.h +++ b/third_party/Imath/src/Imath/ImathMatrixAlgo.h @@ -87,19 +87,21 @@ IMATH_EXPORT_CONST M44d identity44d; // Declarations for 4x4 matrix. // -/// Extract the scaling component of the given 4x4 matrix. +/// Extract the scaling component of the given 4x4 matrix. /// /// @param[in] mat The input matrix /// @param[out] scl The extracted scale, i.e. the output value /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the scale could be extracted, false if the matrix is degenerate. -template bool extractScaling (const Matrix44& mat, Vec3& scl, bool exc = true); +template +bool extractScaling (const Matrix44& mat, Vec3& scl, bool exc = true); /// Return the given 4x4 matrix with scaling removed. /// /// @param[in] mat The input matrix /// @param[in] exc If true, throw an exception if the scaling in `mat` -template Matrix44 sansScaling (const Matrix44& mat, bool exc = true); +template +Matrix44 sansScaling (const Matrix44& mat, bool exc = true); /// Remove scaling from the given 4x4 matrix in place. Return true if the /// scale could be successfully extracted, false if the matrix is @@ -119,13 +121,16 @@ template bool removeScaling (Matrix44& mat, bool exc = true); /// @param[out] shr The extracted shear /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the scale could be extracted, false if the matrix is degenerate. -template bool extractScalingAndShear (const Matrix44& mat, Vec3& scl, Vec3& shr, bool exc = true); +template +bool extractScalingAndShear ( + const Matrix44& mat, Vec3& scl, Vec3& shr, bool exc = true); /// Return the given 4x4 matrix with scaling and shear removed. /// /// @param[in] mat The input matrix /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. -template Matrix44 sansScalingAndShear (const Matrix44& mat, bool exc = true); +template +Matrix44 sansScalingAndShear (const Matrix44& mat, bool exc = true); /// Extract scaling and shear from the given 4x4 matrix in-place. /// @@ -133,14 +138,16 @@ template Matrix44 sansScalingAndShear (const Matrix44& mat, bool /// @param[in] mat The return value if `result` is degenerate /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. template -void sansScalingAndShear (Matrix44& result, const Matrix44& mat, bool exc = true); +void sansScalingAndShear ( + Matrix44& result, const Matrix44& mat, bool exc = true); /// Remove scaling and shear from the given 4x4 matrix in place. // /// @param[in,out] mat The matrix to operate on /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the scale could be extracted, false if the matrix is degenerate. -template bool removeScalingAndShear (Matrix44& mat, bool exc = true); +template +bool removeScalingAndShear (Matrix44& mat, bool exc = true); /// Remove scaling and shear from the given 4x4 matrix in place, returning /// the extracted values. @@ -151,8 +158,8 @@ template bool removeScalingAndShear (Matrix44& mat, bool exc = true /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the scale could be extracted, false if the matrix is degenerate. template -bool -extractAndRemoveScalingAndShear (Matrix44& mat, Vec3& scl, Vec3& shr, bool exc = true); +bool extractAndRemoveScalingAndShear ( + Matrix44& mat, Vec3& scl, Vec3& shr, bool exc = true); /// Extract the rotation from the given 4x4 matrix in the form of XYZ /// euler angles. @@ -185,16 +192,17 @@ template Quat extractQuat (const Matrix44& mat); /// @param[out] r The extracted rotation /// @param[out] t The extracted translation /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. -/// @param[in] rOrder The order with which to extract the rotation +/// @param[in] rOrder The order with which to extract the rotation /// @return True if the values could be extracted, false if the matrix is degenerate. template -bool extractSHRT (const Matrix44& mat, - Vec3& s, - Vec3& h, - Vec3& r, - Vec3& t, - bool exc /*= true*/, - typename Euler::Order rOrder); +bool extractSHRT ( + const Matrix44& mat, + Vec3& s, + Vec3& h, + Vec3& r, + Vec3& t, + bool exc /*= true*/, + typename Euler::Order rOrder); /// Extract the scaling, shear, rotation, and translation components /// of the given 4x4 matrix. @@ -207,12 +215,13 @@ bool extractSHRT (const Matrix44& mat, /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the values could be extracted, false if the matrix is degenerate. template -bool extractSHRT (const Matrix44& mat, - Vec3& s, - Vec3& h, - Vec3& r, - Vec3& t, - bool exc = true); +bool extractSHRT ( + const Matrix44& mat, + Vec3& s, + Vec3& h, + Vec3& r, + Vec3& t, + bool exc = true); /// Extract the scaling, shear, rotation, and translation components /// of the given 4x4 matrix. @@ -225,26 +234,30 @@ bool extractSHRT (const Matrix44& mat, /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the values could be extracted, false if the matrix is degenerate. template -bool extractSHRT (const Matrix44& mat, - Vec3& s, - Vec3& h, - Euler& r, - Vec3& t, - bool exc = true); +bool extractSHRT ( + const Matrix44& mat, + Vec3& s, + Vec3& h, + Euler& r, + Vec3& t, + bool exc = true); /// Return true if the given scale can be removed from the given row /// matrix, false if `scl` is small enough that the operation would /// overflow. If `exc` is true, throw an exception on overflow. -template bool checkForZeroScaleInRow (const T& scl, const Vec3& row, bool exc = true); +template +bool checkForZeroScaleInRow (const T& scl, const Vec3& row, bool exc = true); /// Return the 4x4 outer product two 4-vectors -template Matrix44 outerProduct (const Vec4& a, const Vec4& b); +template +Matrix44 outerProduct (const Vec4& a, const Vec4& b); /// /// Return a 4x4 matrix that rotates the vector `fromDirection` to `toDirection` /// template -Matrix44 rotationMatrix (const Vec3& fromDirection, const Vec3& toDirection); +Matrix44 +rotationMatrix (const Vec3& fromDirection, const Vec3& toDirection); /// /// Return a 4x4 matrix that rotates the `fromDir` vector @@ -252,8 +265,8 @@ Matrix44 rotationMatrix (const Vec3& fromDirection, const Vec3& toDirec /// specify that you want the up vector to be pointing /// in a certain direction 1upDir`. template -Matrix44 -rotationMatrixWithUpDir (const Vec3& fromDir, const Vec3& toDir, const Vec3& upDir); +Matrix44 rotationMatrixWithUpDir ( + const Vec3& fromDir, const Vec3& toDir, const Vec3& upDir); /// /// Construct a 4x4 matrix that rotates the z-axis so that it points @@ -269,7 +282,8 @@ rotationMatrixWithUpDir (const Vec3& fromDir, const Vec3& toDir, const Vec /// @param[in] targetDir The target direction vector /// @param[in] upDir The up direction vector template -void alignZAxisWithTargetDir (Matrix44& result, Vec3 targetDir, Vec3 upDir); +void +alignZAxisWithTargetDir (Matrix44& result, Vec3 targetDir, Vec3 upDir); /// Compute an orthonormal direct 4x4 frame from a position, an x axis /// direction and a normal to the y axis. If the x axis and normal are @@ -281,11 +295,12 @@ void alignZAxisWithTargetDir (Matrix44& result, Vec3 targetDir, Vec3 up /// @param[in] normal A normal to the y axis of the frame /// @return The orthonormal frame template -Matrix44 computeLocalFrame (const Vec3& p, const Vec3& xDir, const Vec3& normal); +Matrix44 computeLocalFrame ( + const Vec3& p, const Vec3& xDir, const Vec3& normal); /// Add a translate/rotate/scale offset to a 4x4 input frame /// and put it in another frame of reference -/// +/// /// @param[in] inMat Input frame /// @param[in] tOffset Translation offset /// @param[in] rOffset Rotation offset in degrees @@ -293,41 +308,47 @@ Matrix44 computeLocalFrame (const Vec3& p, const Vec3& xDir, const Vec3 /// @param[in] ref Frame of reference /// @return The offsetted frame template -Matrix44 addOffset (const Matrix44& inMat, - const Vec3& tOffset, - const Vec3& rOffset, - const Vec3& sOffset, - const Vec3& ref); +Matrix44 addOffset ( + const Matrix44& inMat, + const Vec3& tOffset, + const Vec3& rOffset, + const Vec3& sOffset, + const Vec3& ref); /// Compute 4x4 translate/rotate/scale matrix from `A` with the /// rotate/scale of `B`. -/// +/// /// @param[in] keepRotateA If true, keep rotate from matrix `A`, use `B` otherwise /// @param[in] keepScaleA If true, keep scale from matrix `A`, use `B` otherwise /// @param[in] A Matrix A /// @param[in] B Matrix B /// @return Matrix `A` with tweaked rotation/scale template -Matrix44 -computeRSMatrix (bool keepRotateA, bool keepScaleA, const Matrix44& A, const Matrix44& B); +Matrix44 computeRSMatrix ( + bool keepRotateA, + bool keepScaleA, + const Matrix44& A, + const Matrix44& B); // // Declarations for 3x3 matrix. // -/// Extract the scaling component of the given 3x3 matrix. +/// Extract the scaling component of the given 3x3 matrix. /// /// @param[in] mat The input matrix /// @param[out] scl The extracted scale, i.e. the output value /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the scale could be extracted, false if the matrix is degenerate. -template bool extractScaling (const Matrix33& mat, Vec2& scl, bool exc = true); +template +bool extractScaling (const Matrix33& mat, Vec2& scl, bool exc = true); /// Return the given 3x3 matrix with scaling removed. /// /// @param[in] mat The input matrix /// @param[in] exc If true, throw an exception if the scaling in `mat` -template Matrix33 sansScaling (const Matrix33& mat, bool exc = true); +template +Matrix33 sansScaling (const Matrix33& mat, bool exc = true); /// Remove scaling from the given 3x3 matrix in place. Return true if the /// scale could be successfully extracted, false if the matrix is @@ -348,21 +369,23 @@ template bool removeScaling (Matrix33& mat, bool exc = true); /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the scale could be extracted, false if the matrix is degenerate. template -bool extractScalingAndShear (const Matrix33& mat, Vec2& scl, T& shr, bool exc = true); +bool extractScalingAndShear ( + const Matrix33& mat, Vec2& scl, T& shr, bool exc = true); /// Return the given 3x3 matrix with scaling and shear removed. /// /// @param[in] mat The input matrix /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. -template Matrix33 sansScalingAndShear (const Matrix33& mat, bool exc = true); - +template +Matrix33 sansScalingAndShear (const Matrix33& mat, bool exc = true); /// Remove scaling and shear from the given 3x3e matrix in place. // /// @param[in,out] mat The matrix to operate on /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the scale could be extracted, false if the matrix is degenerate. -template bool removeScalingAndShear (Matrix33& mat, bool exc = true); +template +bool removeScalingAndShear (Matrix33& mat, bool exc = true); /// Remove scaling and shear from the given 3x3 matrix in place, returning /// the extracted values. @@ -373,7 +396,8 @@ template bool removeScalingAndShear (Matrix33& mat, bool exc = true /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the scale could be extracted, false if the matrix is degenerate. template -bool extractAndRemoveScalingAndShear (Matrix33& mat, Vec2& scl, T& shr, bool exc = true); +bool extractAndRemoveScalingAndShear ( + Matrix33& mat, Vec2& scl, T& shr, bool exc = true); /// Extract the rotation from the given 2x2 matrix /// @@ -400,15 +424,23 @@ template void extractEuler (const Matrix33& mat, T& rot); /// @param[in] exc If true, throw an exception if the scaling in `mat` is very close to zero. /// @return True if the values could be extracted, false if the matrix is degenerate. template -bool extractSHRT (const Matrix33& mat, Vec2& s, T& h, T& r, Vec2& t, bool exc = true); +bool extractSHRT ( + const Matrix33& mat, + Vec2& s, + T& h, + T& r, + Vec2& t, + bool exc = true); /// Return true if the given scale can be removed from the given row /// matrix, false if `scl` is small enough that the operation would /// overflow. If `exc` is true, throw an exception on overflow. -template bool checkForZeroScaleInRow (const T& scl, const Vec2& row, bool exc = true); +template +bool checkForZeroScaleInRow (const T& scl, const Vec2& row, bool exc = true); /// Return the 3xe outer product two 3-vectors -template Matrix33 outerProduct (const Vec3& a, const Vec3& b); +template +Matrix33 outerProduct (const Vec3& a, const Vec3& b); //------------------------------ // Implementation for 4x4 Matrix @@ -418,11 +450,10 @@ template bool extractScaling (const Matrix44& mat, Vec3& scl, bool exc) { - Vec3 shr; + Vec3 shr; Matrix44 M (mat); - if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) - return false; + if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) return false; return true; } @@ -436,8 +467,7 @@ sansScaling (const Matrix44& mat, bool exc) Vec3 rot; Vec3 tran; - if (!extractSHRT (mat, scl, shr, rot, tran, exc)) - return mat; + if (!extractSHRT (mat, scl, shr, rot, tran, exc)) return mat; Matrix44 M; @@ -457,10 +487,9 @@ removeScaling (Matrix44& mat, bool exc) Vec3 rot; Vec3 tran; - if (!extractSHRT (mat, scl, shr, rot, tran, exc)) - return false; + if (!extractSHRT (mat, scl, shr, rot, tran, exc)) return false; - mat.makeIdentity(); + mat.makeIdentity (); mat.translate (tran); mat.rotate (rot); mat.shear (shr); @@ -470,12 +499,12 @@ removeScaling (Matrix44& mat, bool exc) template bool -extractScalingAndShear (const Matrix44& mat, Vec3& scl, Vec3& shr, bool exc) +extractScalingAndShear ( + const Matrix44& mat, Vec3& scl, Vec3& shr, bool exc) { Matrix44 M (mat); - if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) - return false; + if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) return false; return true; } @@ -484,12 +513,11 @@ template Matrix44 sansScalingAndShear (const Matrix44& mat, bool exc) { - Vec3 scl; - Vec3 shr; + Vec3 scl; + Vec3 shr; Matrix44 M (mat); - if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) - return mat; + if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) return mat; return M; } @@ -501,8 +529,7 @@ sansScalingAndShear (Matrix44& result, const Matrix44& mat, bool exc) Vec3 scl; Vec3 shr; - if (!extractAndRemoveScalingAndShear (result, scl, shr, exc)) - result = mat; + if (!extractAndRemoveScalingAndShear (result, scl, shr, exc)) result = mat; } template @@ -512,15 +539,15 @@ removeScalingAndShear (Matrix44& mat, bool exc) Vec3 scl; Vec3 shr; - if (!extractAndRemoveScalingAndShear (mat, scl, shr, exc)) - return false; + if (!extractAndRemoveScalingAndShear (mat, scl, shr, exc)) return false; return true; } template bool -extractAndRemoveScalingAndShear (Matrix44& mat, Vec3& scl, Vec3& shr, bool exc) +extractAndRemoveScalingAndShear ( + Matrix44& mat, Vec3& scl, Vec3& shr, bool exc) { // // This implementation follows the technique described in the paper by @@ -558,9 +585,8 @@ extractAndRemoveScalingAndShear (Matrix44& mat, Vec3& scl, Vec3& shr, b } // Compute X scale factor. - scl.x = row[0].length(); - if (!checkForZeroScaleInRow (scl.x, row[0], exc)) - return false; + scl.x = row[0].length (); + if (!checkForZeroScaleInRow (scl.x, row[0], exc)) return false; // Normalize first row. row[0] /= scl.x; @@ -580,9 +606,8 @@ extractAndRemoveScalingAndShear (Matrix44& mat, Vec3& scl, Vec3& shr, b row[1] -= shr[0] * row[0]; // Now, compute Y scale. - scl.y = row[1].length(); - if (!checkForZeroScaleInRow (scl.y, row[1], exc)) - return false; + scl.y = row[1].length (); + if (!checkForZeroScaleInRow (scl.y, row[1], exc)) return false; // Normalize 2nd row and correct the XY shear factor for Y scaling. row[1] /= scl.y; @@ -595,9 +620,8 @@ extractAndRemoveScalingAndShear (Matrix44& mat, Vec3& scl, Vec3& shr, b row[2] -= shr[2] * row[1]; // Next, get Z scale. - scl.z = row[2].length(); - if (!checkForZeroScaleInRow (scl.z, row[2], exc)) - return false; + scl.z = row[2].length (); + if (!checkForZeroScaleInRow (scl.z, row[2], exc)) return false; // Normalize 3rd row and correct the XZ and YZ shear factors for Z scaling. row[2] /= scl.z; @@ -643,11 +667,27 @@ extractEulerXYZ (const Matrix44& mat, Vec3& rot) Vec3 j (mat[1][0], mat[1][1], mat[1][2]); Vec3 k (mat[2][0], mat[2][1], mat[2][2]); - i.normalize(); - j.normalize(); - k.normalize(); - - Matrix44 M (i[0], i[1], i[2], 0, j[0], j[1], j[2], 0, k[0], k[1], k[2], 0, 0, 0, 0, 1); + i.normalize (); + j.normalize (); + k.normalize (); + + Matrix44 M ( + i[0], + i[1], + i[2], + 0, + j[0], + j[1], + j[2], + 0, + k[0], + k[1], + k[2], + 0, + 0, + 0, + 0, + 1); // // Extract the first angle, rot.x. @@ -686,11 +726,27 @@ extractEulerZYX (const Matrix44& mat, Vec3& rot) Vec3 j (mat[1][0], mat[1][1], mat[1][2]); Vec3 k (mat[2][0], mat[2][1], mat[2][2]); - i.normalize(); - j.normalize(); - k.normalize(); - - Matrix44 M (i[0], i[1], i[2], 0, j[0], j[1], j[2], 0, k[0], k[1], k[2], 0, 0, 0, 0, 1); + i.normalize (); + j.normalize (); + k.normalize (); + + Matrix44 M ( + i[0], + i[1], + i[2], + 0, + j[0], + j[1], + j[2], + 0, + k[0], + k[1], + k[2], + 0, + 0, + 0, + 0, + 1); // // Extract the first angle, rot.x. @@ -724,10 +780,9 @@ extractQuat (const Matrix44& mat) T tr, s; T q[4]; int i, j, k; - Quat quat; - int nxt[3] = { 1, 2, 0 }; + int nxt[3] = {1, 2, 0}; tr = mat[0][0] + mat[1][1] + mat[2][2]; // check the diagonal @@ -745,18 +800,15 @@ extractQuat (const Matrix44& mat) { // diagonal is negative i = 0; - if (mat[1][1] > mat[0][0]) - i = 1; - if (mat[2][2] > mat[i][i]) - i = 2; + if (mat[1][1] > mat[0][0]) i = 1; + if (mat[2][2] > mat[i][i]) i = 2; j = nxt[i]; k = nxt[j]; s = std::sqrt ((mat[i][i] - (mat[j][j] + mat[k][k])) + T (1.0)); q[i] = s * T (0.5); - if (s != T (0.0)) - s = T (0.5) / s; + if (s != T (0.0)) s = T (0.5) / s; q[3] = (mat[j][k] - mat[k][j]) * s; q[j] = (mat[i][j] + mat[j][i]) * s; @@ -773,19 +825,19 @@ extractQuat (const Matrix44& mat) template bool -extractSHRT (const Matrix44& mat, - Vec3& s, - Vec3& h, - Vec3& r, - Vec3& t, - bool exc /* = true */, - typename Euler::Order rOrder /* = Euler::XYZ */) +extractSHRT ( + const Matrix44& mat, + Vec3& s, + Vec3& h, + Vec3& r, + Vec3& t, + bool exc /* = true */, + typename Euler::Order rOrder /* = Euler::XYZ */) { Matrix44 rot; rot = mat; - if (!extractAndRemoveScalingAndShear (rot, s, h, exc)) - return false; + if (!extractAndRemoveScalingAndShear (rot, s, h, exc)) return false; extractEulerXYZ (rot, r); @@ -797,7 +849,7 @@ extractSHRT (const Matrix44& mat, { Euler eXYZ (r, Euler::XYZ); Euler e (eXYZ, rOrder); - r = e.toXYZVector(); + r = e.toXYZVector (); } return true; @@ -805,21 +857,28 @@ extractSHRT (const Matrix44& mat, template bool -extractSHRT (const Matrix44& mat, Vec3& s, Vec3& h, Vec3& r, Vec3& t, bool exc) +extractSHRT ( + const Matrix44& mat, + Vec3& s, + Vec3& h, + Vec3& r, + Vec3& t, + bool exc) { return extractSHRT (mat, s, h, r, t, exc, Euler::XYZ); } template bool -extractSHRT (const Matrix44& mat, - Vec3& s, - Vec3& h, - Euler& r, - Vec3& t, - bool exc /* = true */) +extractSHRT ( + const Matrix44& mat, + Vec3& s, + Vec3& h, + Euler& r, + Vec3& t, + bool exc /* = true */) { - return extractSHRT (mat, s, h, r, t, exc, r.order()); + return extractSHRT (mat, s, h, r, t, exc, r.order ()); } template @@ -828,7 +887,8 @@ checkForZeroScaleInRow (const T& scl, const Vec3& row, bool exc /* = true */) { for (int i = 0; i < 3; i++) { - if ((abs (scl) < 1 && abs (row[i]) >= std::numeric_limits::max() * abs (scl))) + if ((abs (scl) < 1 && + abs (row[i]) >= std::numeric_limits::max () * abs (scl))) { if (exc) throw std::domain_error ("Cannot remove zero scaling " @@ -845,22 +905,23 @@ template Matrix44 outerProduct (const Vec4& a, const Vec4& b) { - return Matrix44 (a.x * b.x, - a.x * b.y, - a.x * b.z, - a.x * b.w, - a.y * b.x, - a.y * b.y, - a.y * b.z, - a.x * b.w, - a.z * b.x, - a.z * b.y, - a.z * b.z, - a.x * b.w, - a.w * b.x, - a.w * b.y, - a.w * b.z, - a.w * b.w); + return Matrix44 ( + a.x * b.x, + a.x * b.y, + a.x * b.z, + a.x * b.w, + a.y * b.x, + a.y * b.y, + a.y * b.z, + a.x * b.w, + a.z * b.x, + a.z * b.y, + a.z * b.z, + a.x * b.w, + a.w * b.x, + a.w * b.y, + a.w * b.z, + a.w * b.w); } template @@ -869,12 +930,13 @@ rotationMatrix (const Vec3& from, const Vec3& to) { Quat q; q.setRotation (from, to); - return q.toMatrix44(); + return q.toMatrix44 (); } template Matrix44 -rotationMatrixWithUpDir (const Vec3& fromDir, const Vec3& toDir, const Vec3& upDir) +rotationMatrixWithUpDir ( + const Vec3& fromDir, const Vec3& toDir, const Vec3& upDir) { // // The goal is to obtain a rotation matrix that takes @@ -885,15 +947,15 @@ rotationMatrixWithUpDir (const Vec3& fromDir, const Vec3& toDir, const Vec // // The from direction must be non-zero; but we allow zero to and up dirs. - if (fromDir.length() == 0) - return Matrix44(); + if (fromDir.length () == 0) + return Matrix44 (); else { Matrix44 zAxis2FromDir (UNINITIALIZED); alignZAxisWithTargetDir (zAxis2FromDir, fromDir, Vec3 (0, 1, 0)); - Matrix44 fromDir2zAxis = zAxis2FromDir.transposed(); + Matrix44 fromDir2zAxis = zAxis2FromDir.transposed (); Matrix44 zAxis2ToDir (UNINITIALIZED); alignZAxisWithTargetDir (zAxis2ToDir, toDir, upDir); @@ -910,15 +972,13 @@ alignZAxisWithTargetDir (Matrix44& result, Vec3 targetDir, Vec3 upDir) // Ensure that the target direction is non-zero. // - if (targetDir.length() == 0) - targetDir = Vec3 (0, 0, 1); + if (targetDir.length () == 0) targetDir = Vec3 (0, 0, 1); // // Ensure that the up direction is non-zero. // - if (upDir.length() == 0) - upDir = Vec3 (0, 1, 0); + if (upDir.length () == 0) upDir = Vec3 (0, 1, 0); // // Check for degeneracies. If the upDir and targetDir are parallel @@ -926,11 +986,10 @@ alignZAxisWithTargetDir (Matrix44& result, Vec3 targetDir, Vec3 upDir) // not parallel or opposite to the targetDir. // - if (upDir.cross (targetDir).length() == 0) + if (upDir.cross (targetDir).length () == 0) { upDir = targetDir.cross (Vec3 (1, 0, 0)); - if (upDir.length() == 0) - upDir = targetDir.cross (Vec3 (0, 0, 1)); + if (upDir.length () == 0) upDir = targetDir.cross (Vec3 (0, 0, 1)); } // @@ -947,9 +1006,9 @@ alignZAxisWithTargetDir (Matrix44& result, Vec3 targetDir, Vec3 upDir) // Vec3 row[3]; - row[0] = targetPerpDir.normalized(); - row[1] = targetUpDir.normalized(); - row[2] = targetDir.normalized(); + row[0] = targetPerpDir.normalized (); + row[1] = targetUpDir.normalized (); + row[2] = targetDir.normalized (); result.x[0][0] = row[0][0]; result.x[0][1] = row[0][1]; @@ -984,9 +1043,9 @@ Matrix44 computeLocalFrame (const Vec3& p, const Vec3& xDir, const Vec3& normal) { Vec3 _xDir (xDir); - Vec3 x = _xDir.normalize(); - Vec3 y = (normal % x).normalize(); - Vec3 z = (x % y).normalize(); + Vec3 x = _xDir.normalize (); + Vec3 y = (normal % x).normalize (); + Vec3 z = (x % y).normalize (); Matrix44 L; L[0][0] = x[0]; @@ -1023,11 +1082,12 @@ computeLocalFrame (const Vec3& p, const Vec3& xDir, const Vec3& normal) /// @return The offsetted frame template Matrix44 -addOffset (const Matrix44& inMat, - const Vec3& tOffset, - const Vec3& rOffset, - const Vec3& sOffset, - const Matrix44& ref) +addOffset ( + const Matrix44& inMat, + const Vec3& tOffset, + const Vec3& rOffset, + const Vec3& sOffset, + const Matrix44& ref) { Matrix44 O; @@ -1056,7 +1116,11 @@ addOffset (const Matrix44& inMat, // Return Matrix A with tweaked rotation/scale template Matrix44 -computeRSMatrix (bool keepRotateA, bool keepScaleA, const Matrix44& A, const Matrix44& B) +computeRSMatrix ( + bool keepRotateA, + bool keepScaleA, + const Matrix44& A, + const Matrix44& B) { Vec3 as, ah, ar, at; if (!extractSHRT (A, as, ah, ar, at)) @@ -1066,14 +1130,12 @@ computeRSMatrix (bool keepRotateA, bool keepScaleA, const Matrix44& A, const if (!extractSHRT (B, bs, bh, br, bt)) throw std::domain_error ("degenerate B matrix in computeRSMatrix"); - if (!keepRotateA) - ar = br; + if (!keepRotateA) ar = br; - if (!keepScaleA) - as = bs; + if (!keepScaleA) as = bs; Matrix44 mat; - mat.makeIdentity(); + mat.makeIdentity (); mat.translate (at); mat.rotate (ar); mat.scale (as); @@ -1089,11 +1151,10 @@ template bool extractScaling (const Matrix33& mat, Vec2& scl, bool exc) { - T shr; + T shr; Matrix33 M (mat); - if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) - return false; + if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) return false; return true; } @@ -1103,12 +1164,11 @@ Matrix33 sansScaling (const Matrix33& mat, bool exc) { Vec2 scl; - T shr; - T rot; + T shr; + T rot; Vec2 tran; - if (!extractSHRT (mat, scl, shr, rot, tran, exc)) - return mat; + if (!extractSHRT (mat, scl, shr, rot, tran, exc)) return mat; Matrix33 M; @@ -1124,14 +1184,13 @@ bool removeScaling (Matrix33& mat, bool exc) { Vec2 scl; - T shr; - T rot; + T shr; + T rot; Vec2 tran; - if (!extractSHRT (mat, scl, shr, rot, tran, exc)) - return false; + if (!extractSHRT (mat, scl, shr, rot, tran, exc)) return false; - mat.makeIdentity(); + mat.makeIdentity (); mat.translate (tran); mat.rotate (rot); mat.shear (shr); @@ -1145,8 +1204,7 @@ extractScalingAndShear (const Matrix33& mat, Vec2& scl, T& shr, bool exc) { Matrix33 M (mat); - if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) - return false; + if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) return false; return true; } @@ -1155,12 +1213,11 @@ template Matrix33 sansScalingAndShear (const Matrix33& mat, bool exc) { - Vec2 scl; - T shr; + Vec2 scl; + T shr; Matrix33 M (mat); - if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) - return mat; + if (!extractAndRemoveScalingAndShear (M, scl, shr, exc)) return mat; return M; } @@ -1170,17 +1227,17 @@ bool removeScalingAndShear (Matrix33& mat, bool exc) { Vec2 scl; - T shr; + T shr; - if (!extractAndRemoveScalingAndShear (mat, scl, shr, exc)) - return false; + if (!extractAndRemoveScalingAndShear (mat, scl, shr, exc)) return false; return true; } template bool -extractAndRemoveScalingAndShear (Matrix33& mat, Vec2& scl, T& shr, bool exc) +extractAndRemoveScalingAndShear ( + Matrix33& mat, Vec2& scl, T& shr, bool exc) { Vec2 row[2]; @@ -1211,9 +1268,8 @@ extractAndRemoveScalingAndShear (Matrix33& mat, Vec2& scl, T& shr, bool ex } // Compute X scale factor. - scl.x = row[0].length(); - if (!checkForZeroScaleInRow (scl.x, row[0], exc)) - return false; + scl.x = row[0].length (); + if (!checkForZeroScaleInRow (scl.x, row[0], exc)) return false; // Normalize first row. row[0] /= scl.x; @@ -1232,9 +1288,8 @@ extractAndRemoveScalingAndShear (Matrix33& mat, Vec2& scl, T& shr, bool ex row[1] -= shr * row[0]; // Now, compute Y scale. - scl.y = row[1].length(); - if (!checkForZeroScaleInRow (scl.y, row[1], exc)) - return false; + scl.y = row[1].length (); + if (!checkForZeroScaleInRow (scl.y, row[1], exc)) return false; // Normalize 2nd row and correct the XY shear factor for Y scaling. row[1] /= scl.y; @@ -1276,8 +1331,8 @@ extractEuler (const Matrix22& mat, T& rot) Vec2 i (mat[0][0], mat[0][1]); Vec2 j (mat[1][0], mat[1][1]); - i.normalize(); - j.normalize(); + i.normalize (); + j.normalize (); // // Extract the angle, rot. @@ -1297,8 +1352,8 @@ extractEuler (const Matrix33& mat, T& rot) Vec2 i (mat[0][0], mat[0][1]); Vec2 j (mat[1][0], mat[1][1]); - i.normalize(); - j.normalize(); + i.normalize (); + j.normalize (); // // Extract the angle, rot. @@ -1309,13 +1364,13 @@ extractEuler (const Matrix33& mat, T& rot) template bool -extractSHRT (const Matrix33& mat, Vec2& s, T& h, T& r, Vec2& t, bool exc) +extractSHRT ( + const Matrix33& mat, Vec2& s, T& h, T& r, Vec2& t, bool exc) { Matrix33 rot; rot = mat; - if (!extractAndRemoveScalingAndShear (rot, s, h, exc)) - return false; + if (!extractAndRemoveScalingAndShear (rot, s, h, exc)) return false; extractEuler (rot, r); @@ -1332,10 +1387,12 @@ checkForZeroScaleInRow (const T& scl, const Vec2& row, bool exc /* = true */) { for (int i = 0; i < 2; i++) { - if ((abs (scl) < 1 && abs (row[i]) >= std::numeric_limits::max() * abs (scl))) + if ((abs (scl) < 1 && + abs (row[i]) >= std::numeric_limits::max () * abs (scl))) { if (exc) - throw std::domain_error ("Cannot remove zero scaling from matrix."); + throw std::domain_error ( + "Cannot remove zero scaling from matrix."); else return false; } @@ -1349,15 +1406,16 @@ template Matrix33 outerProduct (const Vec3& a, const Vec3& b) { - return Matrix33 (a.x * b.x, - a.x * b.y, - a.x * b.z, - a.y * b.x, - a.y * b.y, - a.y * b.z, - a.z * b.x, - a.z * b.y, - a.z * b.z); + return Matrix33 ( + a.x * b.x, + a.x * b.y, + a.x * b.z, + a.y * b.x, + a.y * b.y, + a.y * b.z, + a.z * b.x, + a.z * b.y, + a.z * b.z); } /// Computes the translation and rotation that brings the 'from' points @@ -1376,12 +1434,12 @@ outerProduct (const Vec3& a, const Vec3& b) /// @param doScaling If true, include a scaling transformation /// @return The procrustes transformation template -M44d -procrustesRotationAndTranslation (const Vec3* A, - const Vec3* B, - const T* weights, - const size_t numPoints, - const bool doScaling = false); +M44d procrustesRotationAndTranslation ( + const Vec3* A, + const Vec3* B, + const T* weights, + const size_t numPoints, + const bool doScaling = false); /// Computes the translation and rotation that brings the 'from' points /// as close as possible to the 'to' points under the Frobenius norm. @@ -1398,11 +1456,11 @@ procrustesRotationAndTranslation (const Vec3* A, /// @param doScaling If true, include a scaling transformation /// @return The procrustes transformation template -M44d -procrustesRotationAndTranslation (const Vec3* A, - const Vec3* B, - const size_t numPoints, - const bool doScaling = false); +M44d procrustesRotationAndTranslation ( + const Vec3* A, + const Vec3* B, + const size_t numPoints, + const bool doScaling = false); /// Compute the SVD of a 3x3 matrix using Jacobi transformations. This method /// should be quite accurate (competitive with LAPACK) even for poorly @@ -1420,12 +1478,13 @@ procrustesRotationAndTranslation (const Vec3* A, /// /// Currently only available for single- and double-precision matrices. template -void jacobiSVD (const Matrix33& A, - Matrix33& U, - Vec3& S, - Matrix33& V, - const T tol = std::numeric_limits::epsilon(), - const bool forcePositiveDeterminant = false); +void jacobiSVD ( + const Matrix33& A, + Matrix33& U, + Vec3& S, + Matrix33& V, + const T tol = std::numeric_limits::epsilon (), + const bool forcePositiveDeterminant = false); /// Compute the SVD of a 3x3 matrix using Jacobi transformations. This method /// should be quite accurate (competitive with LAPACK) even for poorly @@ -1443,12 +1502,13 @@ void jacobiSVD (const Matrix33& A, /// /// Currently only available for single- and double-precision matrices. template -void jacobiSVD (const Matrix44& A, - Matrix44& U, - Vec4& S, - Matrix44& V, - const T tol = std::numeric_limits::epsilon(), - const bool forcePositiveDeterminant = false); +void jacobiSVD ( + const Matrix44& A, + Matrix44& U, + Vec4& S, + Matrix44& V, + const T tol = std::numeric_limits::epsilon (), + const bool forcePositiveDeterminant = false); /// Compute the eigenvalues (S) and the eigenvectors (V) of a real /// symmetric matrix using Jacobi transformation, using a given @@ -1460,7 +1520,8 @@ void jacobiSVD (const Matrix44& A, /// Input matrix A must be symmetric. A is also modified during /// the computation so that upper diagonal entries of A become zero. template -void jacobiEigenSolver (Matrix33& A, Vec3& S, Matrix33& V, const T tol); +void +jacobiEigenSolver (Matrix33& A, Vec3& S, Matrix33& V, const T tol); /// Compute the eigenvalues (S) and the eigenvectors (V) of /// a real symmetric matrix using Jacobi transformation. @@ -1474,7 +1535,7 @@ template inline void jacobiEigenSolver (Matrix33& A, Vec3& S, Matrix33& V) { - jacobiEigenSolver (A, S, V, std::numeric_limits::epsilon()); + jacobiEigenSolver (A, S, V, std::numeric_limits::epsilon ()); } /// Compute the eigenvalues (S) and the eigenvectors (V) of a real @@ -1487,7 +1548,8 @@ jacobiEigenSolver (Matrix33& A, Vec3& S, Matrix33& V) /// Input matrix A must be symmetric. A is also modified during /// the computation so that upper diagonal entries of A become zero. template -void jacobiEigenSolver (Matrix44& A, Vec4& S, Matrix44& V, const T tol); +void +jacobiEigenSolver (Matrix44& A, Vec4& S, Matrix44& V, const T tol); /// Compute the eigenvalues (S) and the eigenvectors (V) of /// a real symmetric matrix using Jacobi transformation. @@ -1501,7 +1563,7 @@ template inline void jacobiEigenSolver (Matrix44& A, Vec4& S, Matrix44& V) { - jacobiEigenSolver (A, S, V, std::numeric_limits::epsilon()); + jacobiEigenSolver (A, S, V, std::numeric_limits::epsilon ()); } /// Compute a eigenvector corresponding to the abs max eigenvalue diff --git a/third_party/Imath-3.1.9/src/Imath/ImathNamespace.h b/third_party/Imath/src/Imath/ImathNamespace.h similarity index 83% rename from third_party/Imath-3.1.9/src/Imath/ImathNamespace.h rename to third_party/Imath/src/Imath/ImathNamespace.h index 913241ca..3b7c801a 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathNamespace.h +++ b/third_party/Imath/src/Imath/ImathNamespace.h @@ -79,15 +79,15 @@ using namespace IMATH_INTERNAL_NAMESPACE; // project source code. // -#define IMATH_INTERNAL_NAMESPACE_HEADER_ENTER \ - namespace IMATH_INTERNAL_NAMESPACE \ - { -#define IMATH_INTERNAL_NAMESPACE_HEADER_EXIT } +# define IMATH_INTERNAL_NAMESPACE_HEADER_ENTER \ + namespace IMATH_INTERNAL_NAMESPACE \ + { +# define IMATH_INTERNAL_NAMESPACE_HEADER_EXIT } -#define IMATH_INTERNAL_NAMESPACE_SOURCE_ENTER \ - namespace IMATH_INTERNAL_NAMESPACE \ - { -#define IMATH_INTERNAL_NAMESPACE_SOURCE_EXIT } +# define IMATH_INTERNAL_NAMESPACE_SOURCE_ENTER \ + namespace IMATH_INTERNAL_NAMESPACE \ + { +# define IMATH_INTERNAL_NAMESPACE_SOURCE_EXIT } #endif // __cplusplus diff --git a/third_party/Imath-3.1.9/src/Imath/ImathPlane.h b/third_party/Imath/src/Imath/ImathPlane.h similarity index 70% rename from third_party/Imath-3.1.9/src/Imath/ImathPlane.h rename to third_party/Imath/src/Imath/ImathPlane.h index 9ec1e839..71f215ea 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathPlane.h +++ b/third_party/Imath/src/Imath/ImathPlane.h @@ -30,14 +30,13 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class IMATH_EXPORT_TEMPLATE_TYPE Plane3 { - public: - +public: /// @{ /// @name Direct access to member fields - + /// The normal to the plane Vec3 normal; - + /// The distance from the origin to the plane T distance; @@ -47,59 +46,70 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Plane3 /// @name Constructors /// Uninitialized by default - IMATH_HOSTDEVICE Plane3() IMATH_NOEXCEPT {} + IMATH_HOSTDEVICE Plane3 () IMATH_NOEXCEPT {} /// Initialize with a normal and distance - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3 (const Vec3& normal, T distance) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Plane3 (const Vec3& normal, T distance) IMATH_NOEXCEPT; /// Initialize with a point and a normal - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3 (const Vec3& point, const Vec3& normal) IMATH_NOEXCEPT; - + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Plane3 (const Vec3& point, const Vec3& normal) IMATH_NOEXCEPT; + /// Initialize with three points - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3 (const Vec3& point1, - const Vec3& point2, - const Vec3& point3) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3 ( + const Vec3& point1, + const Vec3& point2, + const Vec3& point3) IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Manipulation - + /// Set via a given normal and distance - IMATH_HOSTDEVICE void set (const Vec3& normal, T distance) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + set (const Vec3& normal, T distance) IMATH_NOEXCEPT; /// Set via a given point and normal - IMATH_HOSTDEVICE void set (const Vec3& point, const Vec3& normal) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + set (const Vec3& point, const Vec3& normal) IMATH_NOEXCEPT; /// Set via three points - IMATH_HOSTDEVICE void set (const Vec3& point1, const Vec3& point2, const Vec3& point3) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE void + set (const Vec3& point1, const Vec3& point2, const Vec3& point3) + IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Utility Methods - + /// Determine if a line intersects the plane. /// @param line The line /// @param[out] intersection The point of intersection /// @return True if the line intersects the plane. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool - intersect (const Line3& line, Vec3& intersection) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersect ( + const Line3& line, Vec3& intersection) const IMATH_NOEXCEPT; /// Determine if a line intersects the plane. /// @param line The line /// @param[out] parameter The parametric value of the point of intersection /// @return True if the line intersects the plane. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersectT (const Line3& line, T& parameter) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersectT (const Line3& line, T& parameter) const IMATH_NOEXCEPT; /// Return the distance from a point to the plane. - IMATH_HOSTDEVICE constexpr T distanceTo (const Vec3& point) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T + distanceTo (const Vec3& point) const IMATH_NOEXCEPT; /// Reflect the given point around the plane. - IMATH_HOSTDEVICE constexpr Vec3 reflectPoint (const Vec3& point) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 + reflectPoint (const Vec3& point) const IMATH_NOEXCEPT; /// Reflect the direction vector around the plane - IMATH_HOSTDEVICE constexpr Vec3 reflectVector (const Vec3& vec) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 + reflectVector (const Vec3& vec) const IMATH_NOEXCEPT; /// @} }; @@ -115,29 +125,35 @@ typedef Plane3 Plane3d; //--------------- template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Plane3::Plane3 (const Vec3& p0, const Vec3& p1, const Vec3& p2) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Plane3::Plane3 ( + const Vec3& p0, const Vec3& p1, const Vec3& p2) IMATH_NOEXCEPT { set (p0, p1, p2); } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Plane3::Plane3 (const Vec3& n, T d) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Plane3::Plane3 ( + const Vec3& n, T d) IMATH_NOEXCEPT { set (n, d); } template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Plane3::Plane3 (const Vec3& p, const Vec3& n) IMATH_NOEXCEPT +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Plane3::Plane3 ( + const Vec3& p, const Vec3& n) IMATH_NOEXCEPT { set (p, n); } template IMATH_HOSTDEVICE inline void -Plane3::set (const Vec3& point1, const Vec3& point2, const Vec3& point3) IMATH_NOEXCEPT +Plane3::set ( + const Vec3& point1, + const Vec3& point2, + const Vec3& point3) IMATH_NOEXCEPT { normal = (point2 - point1) % (point3 - point1); - normal.normalize(); + normal.normalize (); distance = normal ^ point1; } @@ -146,7 +162,7 @@ IMATH_HOSTDEVICE inline void Plane3::set (const Vec3& point, const Vec3& n) IMATH_NOEXCEPT { normal = n; - normal.normalize(); + normal.normalize (); distance = normal ^ point; } @@ -155,7 +171,7 @@ IMATH_HOSTDEVICE inline void Plane3::set (const Vec3& n, T d) IMATH_NOEXCEPT { normal = n; - normal.normalize(); + normal.normalize (); distance = d; } @@ -185,8 +201,7 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool Plane3::intersect (const Line3& line, Vec3& point) const IMATH_NOEXCEPT { T d = normal ^ line.dir; - if (d == 0.0) - return false; + if (d == 0.0) return false; T t = -((normal ^ line.pos) - distance) / d; point = line (t); return true; @@ -197,8 +212,7 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline bool Plane3::intersectT (const Line3& line, T& t) const IMATH_NOEXCEPT { T d = normal ^ line.dir; - if (d == 0.0) - return false; + if (d == 0.0) return false; t = -((normal ^ line.pos) - distance) / d; return true; } @@ -221,11 +235,11 @@ operator* (const Plane3& plane, const Matrix44& M) IMATH_NOEXCEPT // Could also compute M but that would suck. // - Vec3 dir1 = Vec3 (1, 0, 0) % plane.normal; - T dir1Len = dir1 ^ dir1; + Vec3 dir1 = Vec3 (1, 0, 0) % plane.normal; + T dir1Len = dir1 ^ dir1; - Vec3 tmp = Vec3 (0, 1, 0) % plane.normal; - T tmpLen = tmp ^ tmp; + Vec3 tmp = Vec3 (0, 1, 0) % plane.normal; + T tmpLen = tmp ^ tmp; if (tmpLen > dir1Len) { @@ -236,10 +250,7 @@ operator* (const Plane3& plane, const Matrix44& M) IMATH_NOEXCEPT tmp = Vec3 (0, 0, 1) % plane.normal; tmpLen = tmp ^ tmp; - if (tmpLen > dir1Len) - { - dir1 = tmp; - } + if (tmpLen > dir1Len) { dir1 = tmp; } Vec3 dir2 = dir1 % plane.normal; Vec3 point = plane.distance * plane.normal; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathPlatform.h b/third_party/Imath/src/Imath/ImathPlatform.h similarity index 61% rename from third_party/Imath-3.1.9/src/Imath/ImathPlatform.h rename to third_party/Imath/src/Imath/ImathPlatform.h index 5dc32fdc..437b95e7 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathPlatform.h +++ b/third_party/Imath/src/Imath/ImathPlatform.h @@ -25,27 +25,27 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER // // Helpful macros for checking which C++ standard we are compiling with. // -#if (__cplusplus >= 202002L) -# define IMATH_CPLUSPLUS_VERSION 20 -#elif (__cplusplus >= 201703L) -# define IMATH_CPLUSPLUS_VERSION 17 -#elif (__cplusplus >= 201402L) || (defined(_MSC_VER) && _MSC_VER >= 1914) -# define IMATH_CPLUSPLUS_VERSION 14 -#elif (__cplusplus >= 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1900) -# define IMATH_CPLUSPLUS_VERSION 11 -#else -# error "This version of Imath is meant to work only with C++11 and above" -#endif - +# if (__cplusplus >= 202002L) +# define IMATH_CPLUSPLUS_VERSION 20 +# elif (__cplusplus >= 201703L) +# define IMATH_CPLUSPLUS_VERSION 17 +# elif (__cplusplus >= 201402L) || (defined(_MSC_VER) && _MSC_VER >= 1914) +# define IMATH_CPLUSPLUS_VERSION 14 +# elif (__cplusplus >= 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1900) +# define IMATH_CPLUSPLUS_VERSION 11 +# else +# error \ + "This version of Imath is meant to work only with C++11 and above" +# endif // // Constexpr C++14 conditional definition // -#if (IMATH_CPLUSPLUS_VERSION >= 14) - #define IMATH_CONSTEXPR14 constexpr -#else - #define IMATH_CONSTEXPR14 /* can not be constexpr before c++14 */ -#endif +# if (IMATH_CPLUSPLUS_VERSION >= 14) +# define IMATH_CONSTEXPR14 constexpr +# else +# define IMATH_CONSTEXPR14 /* can not be constexpr before c++14 */ +# endif #endif // __cplusplus @@ -64,7 +64,8 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER // //----------------------------------------------------------------------------- -#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) || \ + defined(__INTEL_COMPILER) # define IMATH_RESTRICT __restrict #else # define IMATH_RESTRICT diff --git a/third_party/Imath-3.1.9/src/Imath/ImathQuat.h b/third_party/Imath/src/Imath/ImathQuat.h similarity index 70% rename from third_party/Imath-3.1.9/src/Imath/ImathQuat.h rename to third_party/Imath/src/Imath/ImathQuat.h index ebe242a8..a0972dff 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathQuat.h +++ b/third_party/Imath/src/Imath/ImathQuat.h @@ -41,13 +41,12 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class IMATH_EXPORT_TEMPLATE_TYPE Quat { - public: - +public: /// @{ /// @name Direct access to elements - + /// The real part - T r; + T r; /// The imaginary vector Vec3 v; @@ -56,7 +55,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Quat /// Element access: q[0] is the real part, (q[1],q[2],q[3]) is the /// imaginary part. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T& operator[] (int index) IMATH_NOEXCEPT; // as 4D vector + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T& + operator[] (int index) IMATH_NOEXCEPT; // as 4D vector /// Element access: q[0] is the real part, (q[1],q[2],q[3]) is the /// imaginary part. @@ -66,13 +66,14 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Quat /// @name Constructors /// Default constructor is the identity quat - IMATH_HOSTDEVICE constexpr Quat() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Quat () IMATH_NOEXCEPT; /// Copy constructor IMATH_HOSTDEVICE constexpr Quat (const Quat& q) IMATH_NOEXCEPT; /// Construct from a quaternion of a another base type - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat (const Quat& q) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat (const Quat& q) IMATH_NOEXCEPT; /// Initialize with real part `s` and imaginary vector 1(i,j,k)` IMATH_HOSTDEVICE constexpr Quat (T s, T i, T j, T k) IMATH_NOEXCEPT; @@ -81,10 +82,11 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Quat IMATH_HOSTDEVICE constexpr Quat (T s, Vec3 d) IMATH_NOEXCEPT; /// The identity quaternion - IMATH_HOSTDEVICE constexpr static Quat identity() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr static Quat identity () IMATH_NOEXCEPT; /// Assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& operator= (const Quat& q) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& + operator= (const Quat& q) IMATH_NOEXCEPT; /// Destructor ~Quat () IMATH_NOEXCEPT = default; @@ -92,119 +94,140 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Quat /// @} /// @{ - /// @name Basic Algebra - /// + /// @name Basic Algebra + /// /// Note that the operator return values are *NOT* normalized // /// Quaternion multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& operator*= (const Quat& q) IMATH_NOEXCEPT; - + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& + operator*= (const Quat& q) IMATH_NOEXCEPT; + /// Scalar multiplication: multiply both real and imaginary parts /// by the given scalar. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& operator*= (T t) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& + operator*= (T t) IMATH_NOEXCEPT; /// Quaterion division, using the inverse() - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& operator/= (const Quat& q) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& + operator/= (const Quat& q) IMATH_NOEXCEPT; /// Scalar division: multiply both real and imaginary parts /// by the given scalar. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& operator/= (T t) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& + operator/= (T t) IMATH_NOEXCEPT; /// Quaternion addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& operator+= (const Quat& q) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& + operator+= (const Quat& q) IMATH_NOEXCEPT; /// Quaternion subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& operator-= (const Quat& q) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat& + operator-= (const Quat& q) IMATH_NOEXCEPT; /// Equality - template IMATH_HOSTDEVICE constexpr bool operator== (const Quat& q) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr bool + operator== (const Quat& q) const IMATH_NOEXCEPT; /// Inequality - template IMATH_HOSTDEVICE constexpr bool operator!= (const Quat& q) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr bool + operator!= (const Quat& q) const IMATH_NOEXCEPT; /// @} - /// @{ /// @name Query - + /// Return the R4 length - IMATH_HOSTDEVICE constexpr T length() const IMATH_NOEXCEPT; // in R4 + IMATH_HOSTDEVICE constexpr T length () const IMATH_NOEXCEPT; // in R4 /// Return the angle of the axis/angle representation - IMATH_HOSTDEVICE constexpr T angle() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T angle () const IMATH_NOEXCEPT; /// Return the axis of the axis/angle representation - IMATH_HOSTDEVICE constexpr Vec3 axis() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 axis () const IMATH_NOEXCEPT; /// Return a 3x3 rotation matrix - IMATH_HOSTDEVICE constexpr Matrix33 toMatrix33() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix33 toMatrix33 () const IMATH_NOEXCEPT; /// Return a 4x4 rotation matrix - IMATH_HOSTDEVICE constexpr Matrix44 toMatrix44() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Matrix44 toMatrix44 () const IMATH_NOEXCEPT; /// Return the logarithm of the quaterion - IMATH_HOSTDEVICE Quat log() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Quat log () const IMATH_NOEXCEPT; /// Return the exponent of the quaterion - IMATH_HOSTDEVICE Quat exp() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Quat exp () const IMATH_NOEXCEPT; /// @} /// @{ /// @name Utility Methods - + /// Invert in place: this = 1 / this. /// @return const reference to this. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat& invert() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat& invert () IMATH_NOEXCEPT; /// Return 1/this, leaving this unchanged. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat inverse() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat inverse () const IMATH_NOEXCEPT; /// Normalize in place /// @return const reference to this. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat& normalize() IMATH_NOEXCEPT; - + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat& normalize () IMATH_NOEXCEPT; + /// Return a normalized quaternion, leaving this unmodified. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat normalized() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat + normalized () const IMATH_NOEXCEPT; /// Rotate the given point by the quaterion. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 rotateVector (const Vec3& original) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 + rotateVector (const Vec3& original) const IMATH_NOEXCEPT; /// Return the Euclidean inner product. - IMATH_HOSTDEVICE constexpr T euclideanInnerProduct (const Quat& q) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T + euclideanInnerProduct (const Quat& q) const IMATH_NOEXCEPT; /// Set the quaterion to be a rotation around the given axis by the /// given angle. /// @return const reference to this. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat& setAxisAngle (const Vec3& axis, T radians) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat& + setAxisAngle (const Vec3& axis, T radians) IMATH_NOEXCEPT; /// Set the quaternion to be a rotation that transforms the /// direction vector `fromDirection` to `toDirection` /// @return const reference to this. IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat& - setRotation (const Vec3& fromDirection, const Vec3& toDirection) IMATH_NOEXCEPT; + setRotation (const Vec3& fromDirection, const Vec3& toDirection) + IMATH_NOEXCEPT; /// @} - + /// The base type: In templates that accept a parameter `V`, you /// can refer to `T` as `V::BaseType` typedef T BaseType; - private: - IMATH_HOSTDEVICE void setRotationInternal (const Vec3& f0, const Vec3& t0, Quat& q) IMATH_NOEXCEPT; +private: + IMATH_HOSTDEVICE void setRotationInternal ( + const Vec3& f0, const Vec3& t0, Quat& q) IMATH_NOEXCEPT; }; template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat slerp (const Quat& q1, const Quat& q2, T t) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat +slerp (const Quat& q1, const Quat& q2, T t) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat slerpShortestArc (const Quat& q1, const Quat& q2, T t) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat +slerpShortestArc (const Quat& q1, const Quat& q2, T t) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat -squad (const Quat& q1, const Quat& q2, const Quat& qa, const Quat& qb, T t) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat squad ( + const Quat& q1, + const Quat& q2, + const Quat& qa, + const Quat& qb, + T t) IMATH_NOEXCEPT; /// /// From advanced Animation and Rendering Techniques by Watt and Watt, @@ -213,41 +236,51 @@ squad (const Quat& q1, const Quat& q2, const Quat& qa, const Quat& q /// computing the inner quadrangle points (qa and qb) to guarantee /// tangent continuity. template -IMATH_HOSTDEVICE void intermediate (const Quat& q0, - const Quat& q1, - const Quat& q2, - const Quat& q3, - Quat& qa, - Quat& qb) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE void intermediate ( + const Quat& q0, + const Quat& q1, + const Quat& q2, + const Quat& q3, + Quat& qa, + Quat& qb) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE constexpr Matrix33 operator* (const Matrix33& M, const Quat& q) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Matrix33 +operator* (const Matrix33& M, const Quat& q) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE constexpr Matrix33 operator* (const Quat& q, const Matrix33& M) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Matrix33 +operator* (const Quat& q, const Matrix33& M) IMATH_NOEXCEPT; template std::ostream& operator<< (std::ostream& o, const Quat& q); template -IMATH_HOSTDEVICE constexpr Quat operator* (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Quat +operator* (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE constexpr Quat operator/ (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Quat +operator/ (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE constexpr Quat operator/ (const Quat& q, T t) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Quat +operator/ (const Quat& q, T t) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE constexpr Quat operator* (const Quat& q, T t) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Quat +operator* (const Quat& q, T t) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE constexpr Quat operator* (T t, const Quat& q) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Quat +operator* (T t, const Quat& q) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE constexpr Quat operator+ (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Quat +operator+ (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE constexpr Quat operator- (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE constexpr Quat +operator- (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT; template IMATH_HOSTDEVICE constexpr Quat operator~ (const Quat& q) IMATH_NOEXCEPT; @@ -256,7 +289,8 @@ template IMATH_HOSTDEVICE constexpr Quat operator- (const Quat& q) IMATH_NOEXCEPT; template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 operator* (const Vec3& v, const Quat& q) IMATH_NOEXCEPT; +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 +operator* (const Vec3& v, const Quat& q) IMATH_NOEXCEPT; /// Quaternion of type float typedef Quat Quatf; @@ -269,41 +303,51 @@ typedef Quat Quatd; //--------------- template -IMATH_HOSTDEVICE constexpr inline Quat::Quat() IMATH_NOEXCEPT : r (1), v (0, 0, 0) +IMATH_HOSTDEVICE constexpr inline Quat::Quat () IMATH_NOEXCEPT : r (1), + v (0, 0, 0) { // empty } template template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Quat::Quat (const Quat& q) IMATH_NOEXCEPT : r (q.r), v (q.v) +IMATH_HOSTDEVICE + IMATH_CONSTEXPR14 inline Quat::Quat (const Quat& q) IMATH_NOEXCEPT + : r (q.r), + v (q.v) { // empty } template -IMATH_HOSTDEVICE constexpr inline Quat::Quat (T s, T i, T j, T k) IMATH_NOEXCEPT : r (s), v (i, j, k) +IMATH_HOSTDEVICE constexpr inline Quat::Quat (T s, T i, T j, T k) + IMATH_NOEXCEPT : r (s), + v (i, j, k) { // empty } template -IMATH_HOSTDEVICE constexpr inline Quat::Quat (T s, Vec3 d) IMATH_NOEXCEPT : r (s), v (d) +IMATH_HOSTDEVICE constexpr inline Quat::Quat (T s, Vec3 d) IMATH_NOEXCEPT + : r (s), + v (d) { // empty } template -IMATH_HOSTDEVICE constexpr inline Quat::Quat (const Quat& q) IMATH_NOEXCEPT : r (q.r), v (q.v) +IMATH_HOSTDEVICE constexpr inline Quat::Quat (const Quat& q) + IMATH_NOEXCEPT : r (q.r), + v (q.v) { // empty } template IMATH_HOSTDEVICE constexpr inline Quat -Quat::identity() IMATH_NOEXCEPT +Quat::identity () IMATH_NOEXCEPT { - return Quat(); + return Quat (); } template @@ -338,7 +382,7 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Quat& Quat::operator/= (const Quat& q) IMATH_NOEXCEPT { - *this = *this * q.inverse(); + *this = *this * q.inverse (); return *this; } @@ -409,16 +453,16 @@ operator^ (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline T -Quat::length() const IMATH_NOEXCEPT +Quat::length () const IMATH_NOEXCEPT { return std::sqrt (r * r + (v ^ v)); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Quat& -Quat::normalize() IMATH_NOEXCEPT + Quat::normalize () IMATH_NOEXCEPT { - if (T l = length()) + if (T l = length ()) { r /= l; v /= l; @@ -434,17 +478,16 @@ Quat::normalize() IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Quat -Quat::normalized() const IMATH_NOEXCEPT + Quat::normalized () const IMATH_NOEXCEPT { - if (T l = length()) - return Quat (r / l, v / l); + if (T l = length ()) return Quat (r / l, v / l); - return Quat(); + return Quat (); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Quat -Quat::inverse() const IMATH_NOEXCEPT + Quat::inverse () const IMATH_NOEXCEPT { // // 1 Q* @@ -458,7 +501,7 @@ Quat::inverse() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Quat& -Quat::invert() IMATH_NOEXCEPT + Quat::invert () IMATH_NOEXCEPT { T qdot = (*this) ^ (*this); r /= qdot; @@ -500,11 +543,11 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline T angle4D (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT { - Quat d = q1 - q2; - T lengthD = std::sqrt (d ^ d); + Quat d = q1 - q2; + T lengthD = std::sqrt (d ^ d); - Quat s = q1 + q2; - T lengthS = std::sqrt (s ^ s); + Quat s = q1 + q2; + T lengthS = std::sqrt (s ^ s); return 2 * std::atan2 (lengthD, lengthS); } @@ -536,7 +579,7 @@ slerp (const Quat& q1, const Quat& q2, T t) IMATH_NOEXCEPT Quat q = sinx_over_x (s * a) / sinx_over_x (a) * s * q1 + sinx_over_x (t * a) / sinx_over_x (a) * t * q2; - return q.normalized(); + return q.normalized (); } /// @@ -573,7 +616,12 @@ slerpShortestArc (const Quat& q1, const Quat& q2, T t) IMATH_NOEXCEPT /// qb. template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Quat -spline (const Quat& q0, const Quat& q1, const Quat& q2, const Quat& q3, T t) IMATH_NOEXCEPT + spline ( + const Quat& q0, + const Quat& q1, + const Quat& q2, + const Quat& q3, + T t) IMATH_NOEXCEPT { Quat qa = intermediate (q0, q1, q2); Quat qb = intermediate (q1, q2, q3); @@ -591,7 +639,12 @@ spline (const Quat& q0, const Quat& q1, const Quat& q2, const Quat& /// quaternions. template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Quat -squad (const Quat& q1, const Quat& qa, const Quat& qb, const Quat& q2, T t) IMATH_NOEXCEPT + squad ( + const Quat& q1, + const Quat& qa, + const Quat& qb, + const Quat& q2, + T t) IMATH_NOEXCEPT { Quat r1 = slerp (q1, q2, t); Quat r2 = slerp (qa, qb, t); @@ -604,20 +657,21 @@ squad (const Quat& q1, const Quat& qa, const Quat& qb, const Quat& q /// and `q2`. template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Quat -intermediate (const Quat& q0, const Quat& q1, const Quat& q2) IMATH_NOEXCEPT +intermediate (const Quat& q0, const Quat& q1, const Quat& q2) + IMATH_NOEXCEPT { - Quat q1inv = q1.inverse(); + Quat q1inv = q1.inverse (); Quat c1 = q1inv * q2; Quat c2 = q1inv * q0; - Quat c3 = (T) (-0.25) * (c2.log() + c1.log()); - Quat qa = q1 * c3.exp(); - qa.normalize(); + Quat c3 = (T) (-0.25) * (c2.log () + c1.log ()); + Quat qa = q1 * c3.exp (); + qa.normalize (); return qa; } template IMATH_HOSTDEVICE inline Quat -Quat::log() const IMATH_NOEXCEPT +Quat::log () const IMATH_NOEXCEPT { // // For unit quaternion, from Advanced Animation and @@ -626,13 +680,14 @@ Quat::log() const IMATH_NOEXCEPT T theta = std::acos (std::min (r, (T) 1.0)); - if (theta == 0) - return Quat (0, v); + if (theta == 0) return Quat (0, v); T sintheta = std::sin (theta); T k; - if (std::abs(sintheta) < 1 && std::abs(theta) >= std::numeric_limits::max() * std::abs(sintheta)) + if (std::abs (sintheta) < 1 && + std::abs (theta) >= + std::numeric_limits::max () * std::abs (sintheta)) k = 1; else k = theta / sintheta; @@ -642,7 +697,7 @@ Quat::log() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline Quat -Quat::exp() const IMATH_NOEXCEPT +Quat::exp () const IMATH_NOEXCEPT { // // For pure quaternion (zero scalar part): @@ -650,11 +705,12 @@ Quat::exp() const IMATH_NOEXCEPT // Techniques by Watt and Watt, Page 366: // - T theta = v.length(); + T theta = v.length (); T sintheta = std::sin (theta); T k; - if (abs (theta) < 1 && abs (sintheta) >= std::numeric_limits::max() * abs (theta)) + if (abs (theta) < 1 && + abs (sintheta) >= std::numeric_limits::max () * abs (theta)) k = 1; else k = sintheta / theta; @@ -666,16 +722,16 @@ Quat::exp() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline T -Quat::angle() const IMATH_NOEXCEPT +Quat::angle () const IMATH_NOEXCEPT { - return 2 * std::atan2 (v.length(), r); + return 2 * std::atan2 (v.length (), r); } template IMATH_HOSTDEVICE constexpr inline Vec3 -Quat::axis() const IMATH_NOEXCEPT +Quat::axis () const IMATH_NOEXCEPT { - return v.normalized(); + return v.normalized (); } template @@ -683,7 +739,7 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Quat& Quat::setAxisAngle (const Vec3& axis, T radians) IMATH_NOEXCEPT { r = std::cos (radians / 2); - v = axis.normalized() * std::sin (radians / 2); + v = axis.normalized () * std::sin (radians / 2); return *this; } @@ -707,8 +763,8 @@ Quat::setRotation (const Vec3& from, const Vec3& to) IMATH_NOEXCEPT // Normalize from and to, yielding f0 and t0. // - Vec3 f0 = from.normalized(); - Vec3 t0 = to.normalized(); + Vec3 f0 = from.normalized (); + Vec3 t0 = to.normalized (); if ((f0 ^ t0) >= 0) { @@ -726,7 +782,7 @@ Quat::setRotation (const Vec3& from, const Vec3& to) IMATH_NOEXCEPT // from f0 to h0, then from h0 to t0. // - Vec3 h0 = (f0 + t0).normalized(); + Vec3 h0 = (f0 + t0).normalized (); if ((h0 ^ h0) != 0) { @@ -750,11 +806,11 @@ Quat::setRotation (const Vec3& from, const Vec3& to) IMATH_NOEXCEPT Vec3 f02 = f0 * f0; if (f02.x <= f02.y && f02.x <= f02.z) - v = (f0 % Vec3 (1, 0, 0)).normalized(); + v = (f0 % Vec3 (1, 0, 0)).normalized (); else if (f02.y <= f02.z) - v = (f0 % Vec3 (0, 1, 0)).normalized(); + v = (f0 % Vec3 (0, 1, 0)).normalized (); else - v = (f0 % Vec3 (0, 0, 1)).normalized(); + v = (f0 % Vec3 (0, 0, 1)).normalized (); } } @@ -763,7 +819,8 @@ Quat::setRotation (const Vec3& from, const Vec3& to) IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline void -Quat::setRotationInternal (const Vec3& f0, const Vec3& t0, Quat& q) IMATH_NOEXCEPT +Quat::setRotationInternal (const Vec3& f0, const Vec3& t0, Quat& q) + IMATH_NOEXCEPT { // // The following is equivalent to setAxisAngle(n,2*phi), @@ -782,7 +839,7 @@ Quat::setRotationInternal (const Vec3& f0, const Vec3& t0, Quat& q) // The angle between f0 and h0 is phi. // - Vec3 h0 = (f0 + t0).normalized(); + Vec3 h0 = (f0 + t0).normalized (); // // Store the rotation axis and rotation angle. @@ -794,41 +851,43 @@ Quat::setRotationInternal (const Vec3& f0, const Vec3& t0, Quat& q) template IMATH_HOSTDEVICE constexpr inline Matrix33 -Quat::toMatrix33() const IMATH_NOEXCEPT +Quat::toMatrix33 () const IMATH_NOEXCEPT { - return Matrix33 (1 - 2 * (v.y * v.y + v.z * v.z), - 2 * (v.x * v.y + v.z * r), - 2 * (v.z * v.x - v.y * r), + return Matrix33 ( + 1 - 2 * (v.y * v.y + v.z * v.z), + 2 * (v.x * v.y + v.z * r), + 2 * (v.z * v.x - v.y * r), - 2 * (v.x * v.y - v.z * r), - 1 - 2 * (v.z * v.z + v.x * v.x), - 2 * (v.y * v.z + v.x * r), + 2 * (v.x * v.y - v.z * r), + 1 - 2 * (v.z * v.z + v.x * v.x), + 2 * (v.y * v.z + v.x * r), - 2 * (v.z * v.x + v.y * r), - 2 * (v.y * v.z - v.x * r), - 1 - 2 * (v.y * v.y + v.x * v.x)); + 2 * (v.z * v.x + v.y * r), + 2 * (v.y * v.z - v.x * r), + 1 - 2 * (v.y * v.y + v.x * v.x)); } template IMATH_HOSTDEVICE constexpr inline Matrix44 -Quat::toMatrix44() const IMATH_NOEXCEPT -{ - return Matrix44 (1 - 2 * (v.y * v.y + v.z * v.z), - 2 * (v.x * v.y + v.z * r), - 2 * (v.z * v.x - v.y * r), - 0, - 2 * (v.x * v.y - v.z * r), - 1 - 2 * (v.z * v.z + v.x * v.x), - 2 * (v.y * v.z + v.x * r), - 0, - 2 * (v.z * v.x + v.y * r), - 2 * (v.y * v.z - v.x * r), - 1 - 2 * (v.y * v.y + v.x * v.x), - 0, - 0, - 0, - 0, - 1); +Quat::toMatrix44 () const IMATH_NOEXCEPT +{ + return Matrix44 ( + 1 - 2 * (v.y * v.y + v.z * v.z), + 2 * (v.x * v.y + v.z * r), + 2 * (v.z * v.x - v.y * r), + 0, + 2 * (v.x * v.y - v.z * r), + 1 - 2 * (v.z * v.z + v.x * v.x), + 2 * (v.y * v.z + v.x * r), + 0, + 2 * (v.z * v.x + v.y * r), + 2 * (v.y * v.z - v.x * r), + 1 - 2 * (v.y * v.y + v.x * v.x), + 0, + 0, + 0, + 0, + 1); } /// Transform the quaternion by the matrix @@ -837,7 +896,7 @@ template IMATH_HOSTDEVICE constexpr inline Matrix33 operator* (const Matrix33& M, const Quat& q) IMATH_NOEXCEPT { - return M * q.toMatrix33(); + return M * q.toMatrix33 (); } /// Transform the matrix by the quaterion: @@ -846,7 +905,7 @@ template IMATH_HOSTDEVICE constexpr inline Matrix33 operator* (const Quat& q, const Matrix33& M) IMATH_NOEXCEPT { - return q.toMatrix33() * M; + return q.toMatrix33 () * M; } /// Stream output as "(r x y z)" @@ -854,7 +913,8 @@ template std::ostream& operator<< (std::ostream& o, const Quat& q) { - return o << "(" << q.r << " " << q.v.x << " " << q.v.y << " " << q.v.z << ")"; + return o << "(" << q.r << " " << q.v.x << " " << q.v.y << " " << q.v.z + << ")"; } /// Quaterion multiplication @@ -862,7 +922,8 @@ template IMATH_HOSTDEVICE constexpr inline Quat operator* (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT { - return Quat (q1.r * q2.r - (q1.v ^ q2.v), q1.r * q2.v + q1.v * q2.r + q1.v % q2.v); + return Quat ( + q1.r * q2.r - (q1.v ^ q2.v), q1.r * q2.v + q1.v * q2.r + q1.v % q2.v); } /// Quaterion division @@ -870,7 +931,7 @@ template IMATH_HOSTDEVICE constexpr inline Quat operator/ (const Quat& q1, const Quat& q2) IMATH_NOEXCEPT { - return q1 * q2.inverse(); + return q1 * q2.inverse (); } /// Quaterion division @@ -935,7 +996,7 @@ operator- (const Quat& q) IMATH_NOEXCEPT /// @return v * q template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Vec3 -operator* (const Vec3& v, const Quat& q) IMATH_NOEXCEPT + operator* (const Vec3& v, const Quat& q) IMATH_NOEXCEPT { Vec3 a = q.v % v; Vec3 b = q.v % a; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathRandom.cpp b/third_party/Imath/src/Imath/ImathRandom.cpp similarity index 96% rename from third_party/Imath-3.1.9/src/Imath/ImathRandom.cpp rename to third_party/Imath/src/Imath/ImathRandom.cpp index 87c47cf2..880b2df5 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathRandom.cpp +++ b/third_party/Imath/src/Imath/ImathRandom.cpp @@ -21,7 +21,7 @@ namespace // Static state used by Imath::drand48(), Imath::lrand48() and Imath::srand48() // -unsigned short staticState[3] = { 0, 0, 0 }; +unsigned short staticState[3] = {0, 0, 0}; void rand48Next (unsigned short state[3]) @@ -90,7 +90,7 @@ erand48 (unsigned short state[3]) union { - double d; + double d; uint64_t i; } u; @@ -107,7 +107,7 @@ erand48 (unsigned short state[3]) /// Return erand48() double -drand48() +drand48 () { return IMATH_INTERNAL_NAMESPACE::erand48 (staticState); } @@ -126,7 +126,7 @@ nrand48 (unsigned short state[3]) /// Return nrand48() long int -lrand48() +lrand48 () { return IMATH_INTERNAL_NAMESPACE::nrand48 (staticState); } @@ -140,7 +140,7 @@ srand48 (long int seed) } float -Rand32::nextf() +Rand32::nextf () { // // Generate single-precision floating-point values between 0.0 and 1.0: @@ -155,11 +155,11 @@ Rand32::nextf() // between 0.0 and 1.0-FLT_EPSILON. // - next(); + next (); union { - float f; + float f; unsigned int i; } u; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathRandom.h b/third_party/Imath/src/Imath/ImathRandom.h similarity index 83% rename from third_party/Imath-3.1.9/src/Imath/ImathRandom.h rename to third_party/Imath/src/Imath/ImathRandom.h index 5dce7102..ff164d52 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathRandom.h +++ b/third_party/Imath/src/Imath/ImathRandom.h @@ -31,8 +31,7 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER /// length of 2^32. class Rand32 { - public: - +public: /// Constructor, given a seed IMATH_HOSTDEVICE Rand32 (unsigned long int seed = 0); @@ -40,10 +39,10 @@ class Rand32 IMATH_HOSTDEVICE void init (unsigned long int seed); /// Get the next value in the sequence (range: [false, true]) - IMATH_HOSTDEVICE bool nextb(); + IMATH_HOSTDEVICE bool nextb (); /// Get the next value in the sequence (range: [0 ... 0xffffffff]) - IMATH_HOSTDEVICE unsigned long int nexti(); + IMATH_HOSTDEVICE unsigned long int nexti (); /// Get the next value in the sequence (range: [0 ... 1[) IMATH_HOSTDEVICE IMATH_EXPORT float nextf (); @@ -51,8 +50,8 @@ class Rand32 /// Get the next value in the sequence (range [rangeMin ... rangeMax[) IMATH_HOSTDEVICE float nextf (float rangeMin, float rangeMax); - private: - IMATH_HOSTDEVICE void next(); +private: + IMATH_HOSTDEVICE void next (); unsigned long int _state; }; @@ -62,8 +61,7 @@ class Rand32 /// uniformly distributed sequence. class Rand48 { - public: - +public: /// Constructor IMATH_HOSTDEVICE Rand48 (unsigned long int seed = 0); @@ -71,28 +69,30 @@ class Rand48 IMATH_HOSTDEVICE void init (unsigned long int seed); /// Get the next value in the sequence (range: [false, true]) - IMATH_HOSTDEVICE bool nextb(); + IMATH_HOSTDEVICE bool nextb (); /// Get the next value in the sequence (range: [0 ... 0x7fffffff]) - IMATH_HOSTDEVICE long int nexti(); + IMATH_HOSTDEVICE long int nexti (); /// Get the next value in the sequence (range: [0 ... 1[) - IMATH_HOSTDEVICE double nextf(); + IMATH_HOSTDEVICE double nextf (); /// Get the next value in the sequence (range [rangeMin ... rangeMax[) IMATH_HOSTDEVICE double nextf (double rangeMin, double rangeMax); - private: +private: unsigned short int _state[3]; }; /// Return random points uniformly distributed in a sphere with /// radius 1 around the origin (distance from origin <= 1). -template IMATH_HOSTDEVICE Vec solidSphereRand (Rand& rand); +template +IMATH_HOSTDEVICE Vec solidSphereRand (Rand& rand); /// Return random points uniformly distributed on the surface of /// a sphere with radius 1 around the origin. -template IMATH_HOSTDEVICE Vec hollowSphereRand (Rand& rand); +template +IMATH_HOSTDEVICE Vec hollowSphereRand (Rand& rand); /// Return random numbers with a normal (Gaussian) /// distribution with zero mean and unit variance. @@ -101,18 +101,19 @@ template IMATH_HOSTDEVICE float gaussRand (Rand& rand); /// Return random points whose distance from the origin /// has a normal (Gaussian) distribution with zero mean /// and unit variance. -template IMATH_HOSTDEVICE Vec gaussSphereRand (Rand& rand); +template +IMATH_HOSTDEVICE Vec gaussSphereRand (Rand& rand); //--------------------------------- // erand48(), nrand48() and friends //--------------------------------- /// @cond Doxygen_Suppress -IMATH_HOSTDEVICE IMATH_EXPORT double erand48 (unsigned short state[3]); -IMATH_HOSTDEVICE IMATH_EXPORT double drand48(); +IMATH_HOSTDEVICE IMATH_EXPORT double erand48 (unsigned short state[3]); +IMATH_HOSTDEVICE IMATH_EXPORT double drand48 (); IMATH_HOSTDEVICE IMATH_EXPORT long int nrand48 (unsigned short state[3]); -IMATH_HOSTDEVICE IMATH_EXPORT long int lrand48(); -IMATH_HOSTDEVICE IMATH_EXPORT void srand48 (long int seed); +IMATH_HOSTDEVICE IMATH_EXPORT long int lrand48 (); +IMATH_HOSTDEVICE IMATH_EXPORT void srand48 (long int seed); /// @endcond //--------------- @@ -131,30 +132,30 @@ IMATH_HOSTDEVICE inline Rand32::Rand32 (unsigned long int seed) } IMATH_HOSTDEVICE inline void -Rand32::next() +Rand32::next () { _state = 1664525L * _state + 1013904223L; } IMATH_HOSTDEVICE inline bool -Rand32::nextb() +Rand32::nextb () { - next(); + next (); // Return the 31st (most significant) bit, by and-ing with 2 ^ 31. return !!(_state & 2147483648UL); } IMATH_HOSTDEVICE inline unsigned long int -Rand32::nexti() +Rand32::nexti () { - next(); + next (); return _state & 0xffffffff; } IMATH_HOSTDEVICE inline float Rand32::nextf (float rangeMin, float rangeMax) { - float f = nextf(); + float f = nextf (); return rangeMin * (1 - f) + rangeMax * f; } @@ -174,19 +175,19 @@ IMATH_HOSTDEVICE inline Rand48::Rand48 (unsigned long int seed) } IMATH_HOSTDEVICE inline bool -Rand48::nextb() +Rand48::nextb () { return nrand48 (_state) & 1; } IMATH_HOSTDEVICE inline long int -Rand48::nexti() +Rand48::nexti () { return nrand48 (_state); } IMATH_HOSTDEVICE inline double -Rand48::nextf() +Rand48::nextf () { return erand48 (_state); } @@ -194,7 +195,7 @@ Rand48::nextf() IMATH_HOSTDEVICE inline double Rand48::nextf (double rangeMin, double rangeMax) { - double f = nextf(); + double f = nextf (); return rangeMin * (1 - f) + rangeMax * f; } @@ -206,9 +207,9 @@ solidSphereRand (Rand& rand) do { - for (unsigned int i = 0; i < Vec::dimensions(); i++) + for (unsigned int i = 0; i < Vec::dimensions (); i++) v[i] = (typename Vec::BaseType) rand.nextf (-1, 1); - } while (v.length2() > 1); + } while (v.length2 () > 1); return v; } @@ -217,15 +218,15 @@ template IMATH_HOSTDEVICE Vec hollowSphereRand (Rand& rand) { - Vec v; + Vec v; typename Vec::BaseType length; do { - for (unsigned int i = 0; i < Vec::dimensions(); i++) + for (unsigned int i = 0; i < Vec::dimensions (); i++) v[i] = (typename Vec::BaseType) rand.nextf (-1, 1); - length = v.length(); + length = v.length (); } while (length > 1 || length == 0); return v / length; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathRoots.h b/third_party/Imath/src/Imath/ImathRoots.h similarity index 79% rename from third_party/Imath-3.1.9/src/Imath/ImathRoots.h rename to third_party/Imath/src/Imath/ImathRoots.h index 6632bec7..97abd394 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathRoots.h +++ b/third_party/Imath/src/Imath/ImathRoots.h @@ -40,7 +40,8 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER /// /// @return 1 if the equation has a solution, 0 if there is no /// solution, and -1 if all real numbers are solutions. -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int solveLinear (T a, T b, T& x); +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int solveLinear (T a, T b, T& x); /// /// Solve for x in the quadratic equation: @@ -50,7 +51,8 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int solveLinear (T a, T b, /// @return 2 if the equation has two solutions, 1 if the equation has /// a single solution, 0 if there is no solution, and -1 if all real /// numbers are solutions. -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int solveQuadratic (T a, T b, T c, T x[2]); +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int solveQuadratic (T a, T b, T c, T x[2]); template /// @@ -64,7 +66,8 @@ template /// /// @return 0 if there is no solution, and -1 if all real /// numbers are solutions, otherwise return the number of solutions. -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int solveNormalizedCubic (T r, T s, T t, T x[3]); +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int +solveNormalizedCubic (T r, T s, T t, T x[3]); /// /// Solve for x in the cubic equation: @@ -77,7 +80,8 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int solveNormalizedCubic (T r, T s, T t, T x[ /// /// @return 0 if there is no solution, and -1 if all real /// numbers are solutions, otherwise return the number of solutions. -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int solveCubic (T a, T b, T c, T d, T x[3]); +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 int solveCubic (T a, T b, T c, T d, T x[3]); //--------------- // Implementation @@ -106,10 +110,7 @@ template IMATH_CONSTEXPR14 int solveQuadratic (T a, T b, T c, T x[2]) { - if (a == 0) - { - return solveLinear (b, c, x[0]); - } + if (a == 0) { return solveLinear (b, c, x[0]); } else { T D = b * b - 4 * a * c; @@ -156,7 +157,7 @@ solveNormalizedCubic (T r, T s, T t, T x[3]) if (D > 0) { auto real_root = [] (T a, T x) -> T { - T sign = std::copysign(T(1), a); + T sign = std::copysign (T (1), a); return sign * std::pow (sign * a, T (1) / x); }; @@ -167,27 +168,30 @@ solveNormalizedCubic (T r, T s, T t, T x[3]) return 1; } - namespace CN = COMPLEX_NAMESPACE; - CN::complex u = CN::pow (-q / 2 + CN::sqrt (CN::complex (D)), T (1) / T (3)); + namespace CN = COMPLEX_NAMESPACE; + CN::complex u = + CN::pow (-q / 2 + CN::sqrt (CN::complex (D)), T (1) / T (3)); CN::complex v = -p / (T (3) * u); const T sqrt3 = T (1.73205080756887729352744634150587); // enough digits // for long double CN::complex y0 (u + v); - CN::complex y1 (-(u + v) / T (2) + (u - v) / T (2) * CN::complex (0, sqrt3)); - CN::complex y2 (-(u + v) / T (2) - (u - v) / T (2) * CN::complex (0, sqrt3)); + CN::complex y1 ( + -(u + v) / T (2) + (u - v) / T (2) * CN::complex (0, sqrt3)); + CN::complex y2 ( + -(u + v) / T (2) - (u - v) / T (2) * CN::complex (0, sqrt3)); if (D == 0) { - x[0] = y0.real() - r / 3; - x[1] = y1.real() - r / 3; + x[0] = y0.real () - r / 3; + x[1] = y1.real () - r / 3; return 2; } else { - x[0] = y0.real() - r / 3; - x[1] = y1.real() - r / 3; - x[2] = y2.real() - r / 3; + x[0] = y0.real () - r / 3; + x[1] = y1.real () - r / 3; + x[2] = y2.real () - r / 3; return 3; } } @@ -196,10 +200,7 @@ template IMATH_CONSTEXPR14 int solveCubic (T a, T b, T c, T d, T x[3]) { - if (a == 0) - { - return solveQuadratic (b, c, d, x); - } + if (a == 0) { return solveQuadratic (b, c, d, x); } else { return solveNormalizedCubic (b / a, c / a, d / a, x); diff --git a/third_party/Imath-3.1.9/src/Imath/ImathShear.h b/third_party/Imath/src/Imath/ImathShear.h similarity index 80% rename from third_party/Imath-3.1.9/src/Imath/ImathShear.h rename to third_party/Imath/src/Imath/ImathShear.h index 994ed5a1..77ce4585 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathShear.h +++ b/third_party/Imath/src/Imath/ImathShear.h @@ -50,13 +50,13 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER /// lower/upper (depending on column/row major) triangle of the /// matrix. Houdini is the same as Maya (see /// https://www.sidefx.com/docs/houdini/props/obj.html) in this -/// respect. +/// respect. /// /// There's another way to look at it. A general affine transformation /// in 3D has 12 degrees of freedom - 12 "available" elements in the /// 4x4 matrix since a single row/column must be (0,0,0,1). If you /// add up the degrees of freedom from Maya: -/// +/// /// - 3 translation /// - 3 rotation /// - 3 scale @@ -69,7 +69,7 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER /// represented in those standard 12 degrees of freedom. Here's a /// python example of how to do that: /// -/// +/// /// >>> import imath /// >>> M = imath.M44f() /// >>> s = imath.V3f() @@ -89,7 +89,7 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER /// V3f(0, -0, 0.785398185) /// >>> t /// V3f(0, 0, 0) -/// +/// /// That shows how to decompose a transform matrix with one of those /// "extra" shear coefficients into those standard 12 degrees of /// freedom. But it's not necessarily intuitive; in this case, a @@ -109,13 +109,12 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER /// transformation matrix doesn't necessarily mean that the matrix has /// 12 true degrees of freedom, but the standard /// translation/rotation/scale/shear matrices have the right -/// construction to ensure that. -/// +/// construction to ensure that. +/// template class IMATH_EXPORT_TEMPLATE_TYPE Shear6 { - public: - +public: /// @{ /// @name Direct access to members @@ -133,8 +132,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Shear6 /// @name Constructors and Assignment /// Initialize to 0 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Shear6(); - + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Shear6 (); + /// Initialize to the given XY, XZ, YZ values IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Shear6 (T XY, T XZ, T YZ); @@ -146,96 +145,104 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Shear6 IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Shear6 (const Vec3& v); /// Initialize to the given (XY XZ YZ YX ZX ZY) values - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Shear6 (T XY, - T XZ, - T YZ, - T YX, - T ZX, - T ZY); + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Shear6 (T XY, T XZ, T YZ, T YX, T ZX, T ZY); /// Copy constructor IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Shear6 (const Shear6& h); /// Construct from a Shear6 object of another base type - template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Shear6 (const Shear6& h); + template + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Shear6 (const Shear6& h); /// Assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& operator= (const Shear6& h); + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& + operator= (const Shear6& h); /// Assignment from vector template - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& operator= (const Vec3& v); + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& + operator= (const Vec3& v); /// Destructor ~Shear6() = default; /// @} - + /// @{ /// @name Compatibility with Sb /// Set the value - template IMATH_HOSTDEVICE void setValue (S XY, S XZ, S YZ, S YX, S ZX, S ZY); + template + IMATH_HOSTDEVICE void setValue (S XY, S XZ, S YZ, S YX, S ZX, S ZY); /// Set the value template IMATH_HOSTDEVICE void setValue (const Shear6& h); /// Return the values template - IMATH_HOSTDEVICE void getValue (S& XY, S& XZ, S& YZ, S& YX, S& ZX, S& ZY) const; + IMATH_HOSTDEVICE void + getValue (S& XY, S& XZ, S& YZ, S& YX, S& ZX, S& ZY) const; /// Return the value in `h` template IMATH_HOSTDEVICE void getValue (Shear6& h) const; /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE T* getValue(); + IMATH_HOSTDEVICE T* getValue (); /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE const T* getValue() const; + IMATH_HOSTDEVICE const T* getValue () const; /// @} /// @{ /// @name Arithmetic and Comparison - + /// Equality - template IMATH_HOSTDEVICE constexpr bool operator== (const Shear6& h) const; + template + IMATH_HOSTDEVICE constexpr bool operator== (const Shear6& h) const; /// Inequality - template IMATH_HOSTDEVICE constexpr bool operator!= (const Shear6& h) const; + template + IMATH_HOSTDEVICE constexpr bool operator!= (const Shear6& h) const; /// Compare two shears and test if they are "approximately equal": /// @return True if the coefficients of this and h are the same with /// an absolute error of no more than e, i.e., for all i /// abs (this[i] - h[i]) <= e - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithAbsError (const Shear6& h, T e) const; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithAbsError (const Shear6& h, T e) const; /// Compare two shears and test if they are "approximately equal": /// @return True if the coefficients of this and h are the same with /// a relative error of no more than e, i.e., for all i /// abs (this[i] - h[i]) <= e * abs (this[i]) - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithRelError (const Shear6& h, T e) const; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithRelError (const Shear6& h, T e) const; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& operator+= (const Shear6& h); + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& + operator+= (const Shear6& h); /// Component-wise addition IMATH_HOSTDEVICE constexpr Shear6 operator+ (const Shear6& h) const; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& operator-= (const Shear6& h); + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& + operator-= (const Shear6& h); /// Component-wise subtraction IMATH_HOSTDEVICE constexpr Shear6 operator- (const Shear6& h) const; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE constexpr Shear6 operator-() const; + IMATH_HOSTDEVICE constexpr Shear6 operator- () const; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& negate(); + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& negate (); /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& operator*= (const Shear6& h); + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& + operator*= (const Shear6& h); /// Scalar multiplication IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& operator*= (T a); @@ -246,7 +253,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Shear6 IMATH_HOSTDEVICE constexpr Shear6 operator* (T a) const; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& operator/= (const Shear6& h); + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& + operator/= (const Shear6& h); /// Scalar division IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Shear6& operator/= (T a); @@ -258,26 +266,38 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Shear6 IMATH_HOSTDEVICE constexpr Shear6 operator/ (T a) const; /// @} - + /// @{ /// @name Numerical Limits - + /// Largest possible negative value - IMATH_HOSTDEVICE constexpr static T baseTypeLowest() IMATH_NOEXCEPT { return std::numeric_limits::lowest(); } + IMATH_HOSTDEVICE constexpr static T baseTypeLowest () IMATH_NOEXCEPT + { + return std::numeric_limits::lowest (); + } /// Largest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeMax() IMATH_NOEXCEPT { return std::numeric_limits::max(); } + IMATH_HOSTDEVICE constexpr static T baseTypeMax () IMATH_NOEXCEPT + { + return std::numeric_limits::max (); + } /// Smallest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeSmallest() IMATH_NOEXCEPT { return std::numeric_limits::min(); } + IMATH_HOSTDEVICE constexpr static T baseTypeSmallest () IMATH_NOEXCEPT + { + return std::numeric_limits::min (); + } /// Smallest possible e for which 1+e != 1 - IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon() IMATH_NOEXCEPT { return std::numeric_limits::epsilon(); } + IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon () IMATH_NOEXCEPT + { + return std::numeric_limits::epsilon (); + } /// @} /// Return the number of dimensions, i.e. 6 - IMATH_HOSTDEVICE constexpr static unsigned int dimensions() { return 6; } + IMATH_HOSTDEVICE constexpr static unsigned int dimensions () { return 6; } /// The base type: In templates that accept a parameter `V` (could /// be a Color4), you can refer to `T` as `V::BaseType` @@ -285,7 +305,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Shear6 }; /// Stream output, as "(xy xz yz yx zx zy)" -template std::ostream& operator<< (std::ostream& s, const Shear6& h); +template +std::ostream& operator<< (std::ostream& s, const Shear6& h); /// Reverse multiplication: scalar * Shear6 template @@ -321,12 +342,14 @@ Shear6::operator[] (int i) const return (&xy)[i]; // NOSONAR - suppress SonarCloud bug report. } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6() +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 () { xy = xz = yz = yx = zx = zy = 0; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 (T XY, T XZ, T YZ) +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 (T XY, T XZ, T YZ) { xy = XY; xz = XZ; @@ -336,7 +359,8 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 ( zy = 0; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 (const Vec3& v) +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 (const Vec3& v) { xy = v.x; xz = v.y; @@ -358,7 +382,9 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 (const Vec3& v) zy = 0; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 (T XY, T XZ, T YZ, T YX, T ZX, T ZY) +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 ( + T XY, T XZ, T YZ, T YX, T ZX, T ZY) { xy = XY; xz = XZ; @@ -368,7 +394,8 @@ template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 ( zy = ZY; } -template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 (const Shear6& h) +template +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Shear6::Shear6 (const Shear6& h) { xy = h.xy; xz = h.xz; @@ -471,14 +498,14 @@ Shear6::getValue (Shear6& h) const template IMATH_HOSTDEVICE inline T* -Shear6::getValue() +Shear6::getValue () { return (T*) &xy; } template IMATH_HOSTDEVICE inline const T* -Shear6::getValue() const +Shear6::getValue () const { return (const T*) &xy; } @@ -488,7 +515,8 @@ template IMATH_HOSTDEVICE constexpr inline bool Shear6::operator== (const Shear6& h) const { - return xy == h.xy && xz == h.xz && yz == h.yz && yx == h.yx && zx == h.zx && zy == h.zy; + return xy == h.xy && xz == h.xz && yz == h.yz && yx == h.yx && zx == h.zx && + zy == h.zy; } template @@ -496,7 +524,8 @@ template IMATH_HOSTDEVICE constexpr inline bool Shear6::operator!= (const Shear6& h) const { - return xy != h.xy || xz != h.xz || yz != h.yz || yx != h.yx || zx != h.zx || zy != h.zy; + return xy != h.xy || xz != h.xz || yz != h.yz || yx != h.yx || zx != h.zx || + zy != h.zy; } template @@ -538,7 +567,8 @@ template IMATH_HOSTDEVICE constexpr inline Shear6 Shear6::operator+ (const Shear6& h) const { - return Shear6 (xy + h.xy, xz + h.xz, yz + h.yz, yx + h.yx, zx + h.zx, zy + h.zy); + return Shear6 ( + xy + h.xy, xz + h.xz, yz + h.yz, yx + h.yx, zx + h.zx, zy + h.zy); } template @@ -558,19 +588,20 @@ template IMATH_HOSTDEVICE constexpr inline Shear6 Shear6::operator- (const Shear6& h) const { - return Shear6 (xy - h.xy, xz - h.xz, yz - h.yz, yx - h.yx, zx - h.zx, zy - h.zy); + return Shear6 ( + xy - h.xy, xz - h.xz, yz - h.yz, yx - h.yx, zx - h.zx, zy - h.zy); } template IMATH_HOSTDEVICE constexpr inline Shear6 -Shear6::operator-() const +Shear6::operator- () const { return Shear6 (-xy, -xz, -yz, -yx, -zx, -zy); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Shear6& -Shear6::negate() + Shear6::negate () { xy = -xy; xz = -xz; @@ -611,7 +642,8 @@ template IMATH_HOSTDEVICE constexpr inline Shear6 Shear6::operator* (const Shear6& h) const { - return Shear6 (xy * h.xy, xz * h.xz, yz * h.yz, yx * h.yx, zx * h.zx, zy * h.zy); + return Shear6 ( + xy * h.xy, xz * h.xz, yz * h.yz, yx * h.yx, zx * h.zx, zy * h.zy); } template @@ -651,7 +683,8 @@ template IMATH_HOSTDEVICE constexpr inline Shear6 Shear6::operator/ (const Shear6& h) const { - return Shear6 (xy / h.xy, xz / h.xz, yz / h.yz, yx / h.yx, zx / h.zx, zy / h.zy); + return Shear6 ( + xy / h.xy, xz / h.xz, yz / h.yz, yx / h.yx, zx / h.zx, zy / h.zy); } template @@ -669,8 +702,8 @@ template std::ostream& operator<< (std::ostream& s, const Shear6& h) { - return s << '(' << h.xy << ' ' << h.xz << ' ' << h.yz << h.yx << ' ' << h.zx << ' ' << h.zy - << ')'; + return s << '(' << h.xy << ' ' << h.xz << ' ' << h.yz << h.yx << ' ' << h.zx + << ' ' << h.zy << ')'; } //----------------------------------------- @@ -681,7 +714,8 @@ template IMATH_HOSTDEVICE constexpr inline Shear6 operator* (S a, const Shear6& h) { - return Shear6 (a * h.xy, a * h.xz, a * h.yz, a * h.yx, a * h.zx, a * h.zy); + return Shear6 ( + a * h.xy, a * h.xz, a * h.yz, a * h.yx, a * h.zx, a * h.zy); } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT diff --git a/third_party/Imath-3.1.9/src/Imath/ImathSphere.h b/third_party/Imath/src/Imath/ImathSphere.h similarity index 87% rename from third_party/Imath-3.1.9/src/Imath/ImathSphere.h rename to third_party/Imath/src/Imath/ImathSphere.h index 0680de78..3d5031bb 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathSphere.h +++ b/third_party/Imath/src/Imath/ImathSphere.h @@ -25,11 +25,10 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template class IMATH_EXPORT_TEMPLATE_TYPE Sphere3 { - public: - +public: /// @{ /// @name Direct access to member fields - + /// Center Vec3 center; @@ -42,25 +41,27 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Sphere3 /// @name Constructors /// Default is center at (0,0,0) and radius of 0. - IMATH_HOSTDEVICE constexpr Sphere3() : center (0, 0, 0), radius (0) {} + IMATH_HOSTDEVICE constexpr Sphere3 () : center (0, 0, 0), radius (0) {} /// Initialize to a given center and radius - IMATH_HOSTDEVICE constexpr Sphere3 (const Vec3& c, T r) : center (c), radius (r) {} + IMATH_HOSTDEVICE constexpr Sphere3 (const Vec3& c, T r) + : center (c), radius (r) + {} /// @} - + /// @{ /// @name Manipulation - + /// Set the center and radius of the sphere so that it tightly /// encloses Box b. IMATH_HOSTDEVICE void circumscribe (const Box>& box); /// @} - + /// @{ /// @name Utility Methods - + /// If the sphere and line `l` intersect, then compute the /// smallest `t` with `t>=0` so that `l(t)` is a point on the sphere. /// @@ -78,7 +79,8 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Sphere3 /// @param[out] t The parameter of the line at the intersection point /// @return True if the sphere and line intersect, false if they /// do not. - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersectT (const Line3& l, T& t) const; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + intersectT (const Line3& l, T& t) const; /// @} }; @@ -98,7 +100,7 @@ IMATH_HOSTDEVICE inline void Sphere3::circumscribe (const Box>& box) { center = T (0.5) * (box.min + box.max); - radius = (box.max - center).length(); + radius = (box.max - center).length (); } template @@ -108,8 +110,8 @@ Sphere3::intersectT (const Line3& line, T& t) const bool doesIntersect = true; Vec3 v = line.pos - center; - T B = T (2.0) * (line.dir ^ v); - T C = (v ^ v) - (radius * radius); + T B = T (2.0) * (line.dir ^ v); + T C = (v ^ v) - (radius * radius); // compute discriminant // if negative, there is no intersection @@ -136,8 +138,7 @@ Sphere3::intersectT (const Line3& line, T& t) const t = (-B + sqroot) * T (0.5); } - if (t < 0.0) - doesIntersect = false; + if (t < 0.0) doesIntersect = false; } return doesIntersect; diff --git a/third_party/Imath-3.1.9/src/Imath/ImathTypeTraits.h b/third_party/Imath/src/Imath/ImathTypeTraits.h similarity index 62% rename from third_party/Imath-3.1.9/src/Imath/ImathTypeTraits.h rename to third_party/Imath/src/Imath/ImathTypeTraits.h index 4e8447d3..c3ad212a 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathTypeTraits.h +++ b/third_party/Imath/src/Imath/ImathTypeTraits.h @@ -16,21 +16,19 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER - /// Define Imath::enable_if_t to be std for C++14, equivalent for C++11. #if (IMATH_CPLUSPLUS_VERSION >= 14) - using std::enable_if_t; // Use C++14 std::enable_if_t +using std::enable_if_t; // Use C++14 std::enable_if_t #else - // Define enable_if_t for C++11 - template - using enable_if_t = typename std::enable_if::type; +// Define enable_if_t for C++11 +template +using enable_if_t = typename std::enable_if::type; #endif - /// An enable_if helper to be used in template parameters which results in /// much shorter symbols. -#define IMATH_ENABLE_IF(...) IMATH_INTERNAL_NAMESPACE::enable_if_t<(__VA_ARGS__), int> = 0 - +#define IMATH_ENABLE_IF(...) \ + IMATH_INTERNAL_NAMESPACE::enable_if_t<(__VA_ARGS__), int> = 0 #if IMATH_FOREIGN_VECTOR_INTEROP @@ -75,138 +73,162 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER /// struct Imath::has_subscript : public std::false_type { }; /// - /// `has_xy::value` will be true if type `T` has member variables /// `.x` and `.y`, all of type `Base`, and the size of a `T` is exactly big /// enough to hold 2 Base values. -template -struct has_xy { +template struct has_xy +{ private: typedef char Yes[1]; typedef char No[2]; // Valid only if .x, .y exist and are the right type: return a Yes. - template::value), - IMATH_ENABLE_IF(std::is_same::value)> - static Yes& test(int); + template < + typename C, + IMATH_ENABLE_IF (std::is_same::value), + IMATH_ENABLE_IF (std::is_same::value)> + static Yes& test (int); // Fallback, default to returning a No. - template static No& test(...); + template static No& test (...); + public: - enum { value = (sizeof(test(0)) == sizeof(Yes) - && sizeof(T) == 2*sizeof(Base)) - }; + enum + { + value = + (sizeof (test (0)) == sizeof (Yes) && + sizeof (T) == 2 * sizeof (Base)) + }; }; - /// `has_xyz::value` will be true if type `T` has member variables /// `.x`, `.y`, and `.z`, all of type `Base`, and the size of a `T` is /// exactly big enough to hold 3 Base values. -template -struct has_xyz { +template struct has_xyz +{ private: typedef char Yes[1]; typedef char No[2]; // Valid only if .x, .y, .z exist and are the right type: return a Yes. - template::value), - IMATH_ENABLE_IF(std::is_same::value), - IMATH_ENABLE_IF(std::is_same::value)> - static Yes& test(int); + template < + typename C, + IMATH_ENABLE_IF (std::is_same::value), + IMATH_ENABLE_IF (std::is_same::value), + IMATH_ENABLE_IF (std::is_same::value)> + static Yes& test (int); // Fallback, default to returning a No. - template static No& test(...); + template static No& test (...); + public: - enum { value = (sizeof(test(0)) == sizeof(Yes) - && sizeof(T) == 3*sizeof(Base)) - }; + enum + { + value = + (sizeof (test (0)) == sizeof (Yes) && + sizeof (T) == 3 * sizeof (Base)) + }; }; - /// `has_xyzw::value` will be true if type `T` has member variables /// `.x`, `.y`, `.z`, and `.w`, all of type `Base`, and the size of a `T` is /// exactly big enough to hold 4 Base values. -template -struct has_xyzw { +template struct has_xyzw +{ private: typedef char Yes[1]; typedef char No[2]; // Valid only if .x, .y, .z, .w exist and are the right type: return a Yes. - template::value), - IMATH_ENABLE_IF(std::is_same::value), - IMATH_ENABLE_IF(std::is_same::value), - IMATH_ENABLE_IF(std::is_same::value)> - static Yes& test(int); + template < + typename C, + IMATH_ENABLE_IF (std::is_same::value), + IMATH_ENABLE_IF (std::is_same::value), + IMATH_ENABLE_IF (std::is_same::value), + IMATH_ENABLE_IF (std::is_same::value)> + static Yes& test (int); // Fallback, default to returning a No. - template static No& test(...); + template static No& test (...); + public: - enum { value = (sizeof(test(0)) == sizeof(Yes) - && sizeof(T) == 4*sizeof(Base)) - }; + enum + { + value = + (sizeof (test (0)) == sizeof (Yes) && + sizeof (T) == 4 * sizeof (Base)) + }; }; - - /// `has_subscript::value` will be true if type `T` has /// subscripting syntax, a `T[int]` returns a `Base`, and the size of a `T` /// is exactly big enough to hold `Nelem` `Base` values. -template -struct has_subscript { +template struct has_subscript +{ private: typedef char Yes[1]; typedef char No[2]; // Valid only if T[] is possible and is the right type: return a Yes. - template::type, Base>::value)> - static Yes& test(int); + template < + typename C, + IMATH_ENABLE_IF (std::is_same< + typename std::decay::type, + Base>::value)> + static Yes& test (int); // Fallback, default to returning a No. - template static No& test(...); + template static No& test (...); + public: - enum { value = (sizeof(test(0)) == sizeof(Yes) - && sizeof(T) == Nelem*sizeof(Base)) - }; + enum + { + value = + (sizeof (test (0)) == sizeof (Yes) && + sizeof (T) == Nelem * sizeof (Base)) + }; }; - /// C arrays of just the right length also are qualified for has_subscript. -template -struct has_subscript : public std::true_type { }; - - +template +struct has_subscript : public std::true_type +{}; /// `has_double_subscript::value` will be true if type `T` /// has 2-level subscripting syntax, a `T[int][int]` returns a `Base`, and /// the size of a `T` is exactly big enough to hold `R*C` `Base` values. template -struct has_double_subscript { +struct has_double_subscript +{ private: typedef char Yes[1]; typedef char No[2]; // Valid only if T[][] is possible and is the right type: return a Yes. - template::type, Base>::value)> - static Yes& test(int); + template < + typename C, + IMATH_ENABLE_IF (std::is_same< + typename std::decay::type, + Base>::value)> + static Yes& test (int); // Fallback, default to returning a No. - template static No& test(...); + template static No& test (...); + public: - enum { value = (sizeof(test(0)) == sizeof(Yes) - && sizeof(T) == (Rows*Cols)*sizeof(Base)) - }; + enum + { + value = + (sizeof (test (0)) == sizeof (Yes) && + sizeof (T) == (Rows * Cols) * sizeof (Base)) + }; }; - /// C arrays of just the right length also are qualified for has_double_subscript. -template -struct has_double_subscript : public std::true_type { }; +template +struct has_double_subscript + : public std::true_type +{}; /// @} diff --git a/third_party/Imath-3.1.9/src/Imath/ImathVec.h b/third_party/Imath/src/Imath/ImathVec.h similarity index 61% rename from third_party/Imath-3.1.9/src/Imath/ImathVec.h rename to third_party/Imath/src/Imath/ImathVec.h index f29968db..49d69256 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathVec.h +++ b/third_party/Imath/src/Imath/ImathVec.h @@ -1,7 +1,7 @@ // // SPDX-License-Identifier: BSD-3-Clause // Copyright Contributors to the OpenEXR Project. -// +// // // 2D, 3D and 4D point/vector class templates @@ -45,26 +45,25 @@ enum IMATH_EXPORT_ENUM InfException template class IMATH_EXPORT_TEMPLATE_TYPE Vec2 { - public: - +public: /// @{ /// @name Direct access to elements - + T x, y; /// @} - - /// Element access by index. + + /// Element access by index. IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T& operator[] (int i) IMATH_NOEXCEPT; - /// Element access by index. + /// Element access by index. IMATH_HOSTDEVICE constexpr const T& operator[] (int i) const IMATH_NOEXCEPT; /// @{ /// @name Constructors and Assignment /// Uninitialized by default - IMATH_HOSTDEVICE Vec2() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Vec2 () IMATH_NOEXCEPT; /// Initialize to a scalar `(a,a)` IMATH_HOSTDEVICE constexpr explicit Vec2 (T a) IMATH_NOEXCEPT; @@ -76,14 +75,15 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec2 IMATH_HOSTDEVICE constexpr Vec2 (const Vec2& v) IMATH_NOEXCEPT; /// Construct from Vec2 of another base type - template IMATH_HOSTDEVICE constexpr Vec2 (const Vec2& v) IMATH_NOEXCEPT; - + template + IMATH_HOSTDEVICE constexpr Vec2 (const Vec2& v) IMATH_NOEXCEPT; /// Assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& operator= (const Vec2& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& + operator= (const Vec2& v) IMATH_NOEXCEPT; /// Destructor - ~Vec2() IMATH_NOEXCEPT = default; + ~Vec2 () IMATH_NOEXCEPT = default; /// @} @@ -103,26 +103,33 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec2 /// including any Imath header files. /// - template::value)> + template ::value)> IMATH_HOSTDEVICE explicit constexpr Vec2 (const V& v) IMATH_NOEXCEPT - : Vec2(T(v.x), T(v.y)) { } - - template::value - && !has_xy::value)> - IMATH_HOSTDEVICE explicit Vec2 (const V& v) : Vec2(T(v[0]), T(v[1])) { } - - template::value)> - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& operator= (const V& v) IMATH_NOEXCEPT { - x = T(v.x); - y = T(v.y); + : Vec2 (T (v.x), T (v.y)) + {} + + template < + typename V, + IMATH_ENABLE_IF (has_subscript::value && !has_xy::value)> + IMATH_HOSTDEVICE explicit Vec2 (const V& v) : Vec2 (T (v[0]), T (v[1])) + {} + + template ::value)> + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& + operator= (const V& v) IMATH_NOEXCEPT + { + x = T (v.x); + y = T (v.y); return *this; } - template::value - && !has_xy::value)> - IMATH_HOSTDEVICE const Vec2& operator= (const V& v) { - x = T(v[0]); - y = T(v[1]); + template < + typename V, + IMATH_ENABLE_IF (has_subscript::value && !has_xy::value)> + IMATH_HOSTDEVICE const Vec2& operator= (const V& v) + { + x = T (v[0]); + y = T (v[1]); return *this; } #endif @@ -134,45 +141,53 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec2 template IMATH_HOSTDEVICE void setValue (S a, S b) IMATH_NOEXCEPT; /// Set the value - template IMATH_HOSTDEVICE void setValue (const Vec2& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void setValue (const Vec2& v) IMATH_NOEXCEPT; /// Return the value in `a` and `b` - template IMATH_HOSTDEVICE void getValue (S& a, S& b) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void getValue (S& a, S& b) const IMATH_NOEXCEPT; /// Return the value in `v` - template IMATH_HOSTDEVICE void getValue (Vec2& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void getValue (Vec2& v) const IMATH_NOEXCEPT; /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE T* getValue() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T* getValue () IMATH_NOEXCEPT; /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE const T* getValue() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const T* getValue () const IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Arithmetic and Comparison - - /// Equality - template IMATH_HOSTDEVICE constexpr bool operator== (const Vec2& v) const IMATH_NOEXCEPT; + /// Equality + template + IMATH_HOSTDEVICE constexpr bool + operator== (const Vec2& v) const IMATH_NOEXCEPT; /// Inequality - template IMATH_HOSTDEVICE constexpr bool operator!= (const Vec2& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr bool + operator!= (const Vec2& v) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and `m` are the same /// with an absolute error of no more than e, i.e., for all i, j: /// /// abs (this[i][j] - m[i][j]) <= e - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithAbsError (const Vec2& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithAbsError (const Vec2& v, T e) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and m are the same with /// a relative error of no more than e, i.e., for all i, j: /// /// abs (this[i] - v[i][j]) <= e * abs (this[i][j]) - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithRelError (const Vec2& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithRelError (const Vec2& v, T e) const IMATH_NOEXCEPT; /// Dot product IMATH_HOSTDEVICE constexpr T dot (const Vec2& v) const IMATH_NOEXCEPT; @@ -189,43 +204,53 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec2 IMATH_HOSTDEVICE constexpr T operator% (const Vec2& v) const IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& operator+= (const Vec2& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& + operator+= (const Vec2& v) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE constexpr Vec2 operator+ (const Vec2& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec2 + operator+ (const Vec2& v) const IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& operator-= (const Vec2& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& + operator-= (const Vec2& v) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE constexpr Vec2 operator- (const Vec2& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec2 + operator- (const Vec2& v) const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE constexpr Vec2 operator-() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec2 operator- () const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& negate() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& negate () IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& operator*= (const Vec2& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& + operator*= (const Vec2& v) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& operator*= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& + operator*= (T a) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE constexpr Vec2 operator* (const Vec2& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec2 + operator* (const Vec2& v) const IMATH_NOEXCEPT; /// Component-wise multiplication IMATH_HOSTDEVICE constexpr Vec2 operator* (T a) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& operator/= (const Vec2& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& + operator/= (const Vec2& v) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& operator/= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec2& + operator/= (T a) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE constexpr Vec2 operator/ (const Vec2& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec2 + operator/ (const Vec2& v) const IMATH_NOEXCEPT; /// Component-wise division IMATH_HOSTDEVICE constexpr Vec2 operator/ (T a) const IMATH_NOEXCEPT; @@ -236,65 +261,79 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec2 /// @name Query and Manipulation /// Return the Euclidean norm - IMATH_HOSTDEVICE T length() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T length () const IMATH_NOEXCEPT; /// Return the square of the Euclidean norm, i.e. the dot product /// with itself. - IMATH_HOSTDEVICE constexpr T length2() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T length2 () const IMATH_NOEXCEPT; /// Normalize in place. If length()==0, return a null vector. - IMATH_HOSTDEVICE const Vec2& normalize() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const Vec2& normalize () IMATH_NOEXCEPT; /// Normalize in place. If length()==0, throw an exception. - const Vec2& normalizeExc(); - + const Vec2& normalizeExc (); + /// Normalize without any checks for length()==0. Slightly faster /// than the other normalization routines, but if v.length() is /// 0.0, the result is undefined. - IMATH_HOSTDEVICE const Vec2& normalizeNonNull() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const Vec2& normalizeNonNull () IMATH_NOEXCEPT; /// Return a normalized vector. Does not modify *this. - IMATH_HOSTDEVICE Vec2 normalized() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Vec2 normalized () const IMATH_NOEXCEPT; /// Return a normalized vector. Does not modify *this. Throw an /// exception if length()==0. - Vec2 normalizedExc() const; + Vec2 normalizedExc () const; /// Return a normalized vector. Does not modify *this, and does /// not check for length()==0. Slightly faster than the other /// normalization routines, but if v.length() is 0.0, the result /// is undefined. - IMATH_HOSTDEVICE Vec2 normalizedNonNull() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Vec2 normalizedNonNull () const IMATH_NOEXCEPT; /// @} /// @{ /// @name Numeric Limits - + /// Largest possible negative value - IMATH_HOSTDEVICE constexpr static T baseTypeLowest() IMATH_NOEXCEPT { return std::numeric_limits::lowest(); } + IMATH_HOSTDEVICE constexpr static T baseTypeLowest () IMATH_NOEXCEPT + { + return std::numeric_limits::lowest (); + } /// Largest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeMax() IMATH_NOEXCEPT { return std::numeric_limits::max(); } + IMATH_HOSTDEVICE constexpr static T baseTypeMax () IMATH_NOEXCEPT + { + return std::numeric_limits::max (); + } /// Smallest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeSmallest() IMATH_NOEXCEPT { return std::numeric_limits::min(); } + IMATH_HOSTDEVICE constexpr static T baseTypeSmallest () IMATH_NOEXCEPT + { + return std::numeric_limits::min (); + } /// Smallest possible e for which 1+e != 1 - IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon() IMATH_NOEXCEPT { return std::numeric_limits::epsilon(); } + IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon () IMATH_NOEXCEPT + { + return std::numeric_limits::epsilon (); + } /// @} - + /// Return the number of dimensions, i.e. 2 - IMATH_HOSTDEVICE constexpr static unsigned int dimensions() IMATH_NOEXCEPT { return 2; } + IMATH_HOSTDEVICE constexpr static unsigned int dimensions () IMATH_NOEXCEPT + { + return 2; + } /// The base type: In templates that accept a parameter `V`, you /// can refer to `T` as `V::BaseType` typedef T BaseType; - private: - - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T lengthTiny() const IMATH_NOEXCEPT; +private: + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T lengthTiny () const IMATH_NOEXCEPT; }; /// @@ -303,27 +342,26 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec2 template class IMATH_EXPORT_TEMPLATE_TYPE Vec3 { - public: - +public: /// @{ /// @name Direct access to elements T x, y, z; /// @} - - /// Element access by index. + + /// Element access by index. IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T& operator[] (int i) IMATH_NOEXCEPT; - /// Element access by index. + /// Element access by index. IMATH_HOSTDEVICE constexpr const T& operator[] (int i) const IMATH_NOEXCEPT; /// @{ /// @name Constructors and Assignment /// Uninitialized by default - IMATH_HOSTDEVICE Vec3() IMATH_NOEXCEPT; - + IMATH_HOSTDEVICE Vec3 () IMATH_NOEXCEPT; + /// Initialize to a scalar `(a,a,a)` IMATH_HOSTDEVICE constexpr explicit Vec3 (T a) IMATH_NOEXCEPT; @@ -334,23 +372,27 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec3 IMATH_HOSTDEVICE constexpr Vec3 (const Vec3& v) IMATH_NOEXCEPT; /// Construct from Vec3 of another base type - template IMATH_HOSTDEVICE constexpr Vec3 (const Vec3& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr Vec3 (const Vec3& v) IMATH_NOEXCEPT; /// Vec4 to Vec3 conversion: divide x, y and z by w, even if w is /// 0. The result depends on how the environment handles /// floating-point exceptions. - template IMATH_HOSTDEVICE explicit constexpr Vec3 (const Vec4& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE explicit constexpr Vec3 (const Vec4& v) IMATH_NOEXCEPT; /// Vec4 to Vec3 conversion: divide x, y and z by w. Throws an /// exception if w is zero or if division by w would overflow. template - explicit IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3 (const Vec4& v, InfException); + explicit IMATH_HOSTDEVICE IMATH_CONSTEXPR14 + Vec3 (const Vec4& v, InfException); /// Assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator= (const Vec3& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& + operator= (const Vec3& v) IMATH_NOEXCEPT; /// Destructor - ~Vec3() IMATH_NOEXCEPT = default; + ~Vec3 () IMATH_NOEXCEPT = default; /// @} @@ -370,30 +412,39 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec3 /// including any Imath header files. /// - template::value)> + template ::value)> IMATH_HOSTDEVICE explicit constexpr Vec3 (const V& v) IMATH_NOEXCEPT - : Vec3(T(v.x), T(v.y), T(v.z)) { } + : Vec3 (T (v.x), T (v.y), T (v.z)) + {} - template::value - && !has_xyz::value)> - IMATH_HOSTDEVICE explicit Vec3 (const V& v) : Vec3(T(v[0]), T(v[1]), T(v[2])) { } + template < + typename V, + IMATH_ENABLE_IF ( + has_subscript::value && !has_xyz::value)> + IMATH_HOSTDEVICE explicit Vec3 (const V& v) + : Vec3 (T (v[0]), T (v[1]), T (v[2])) + {} /// Interoperability assignment from another type that behaves as if it /// were an equivalent vector. - template::value)> - IMATH_HOSTDEVICE const Vec3& operator= (const V& v) IMATH_NOEXCEPT { - x = T(v.x); - y = T(v.y); - z = T(v.z); + template ::value)> + IMATH_HOSTDEVICE const Vec3& operator= (const V& v) IMATH_NOEXCEPT + { + x = T (v.x); + y = T (v.y); + z = T (v.z); return *this; } - template::value - && !has_xyz::value)> - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator= (const V& v) { - x = T(v[0]); - y = T(v[1]); - z = T(v[2]); + template < + typename V, + IMATH_ENABLE_IF ( + has_subscript::value && !has_xyz::value)> + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator= (const V& v) + { + x = T (v[0]); + y = T (v[1]); + z = T (v[2]); return *this; } /// @} @@ -403,47 +454,57 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec3 /// @name Compatibility with Sb /// Set the value - template IMATH_HOSTDEVICE void setValue (S a, S b, S c) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void setValue (S a, S b, S c) IMATH_NOEXCEPT; /// Set the value - template IMATH_HOSTDEVICE void setValue (const Vec3& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void setValue (const Vec3& v) IMATH_NOEXCEPT; /// Return the value in `a`, `b`, and `c` - template IMATH_HOSTDEVICE void getValue (S& a, S& b, S& c) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void getValue (S& a, S& b, S& c) const IMATH_NOEXCEPT; /// Return the value in `v` - template IMATH_HOSTDEVICE void getValue (Vec3& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE void getValue (Vec3& v) const IMATH_NOEXCEPT; /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE T* getValue() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T* getValue () IMATH_NOEXCEPT; /// Return a raw pointer to the array of values - IMATH_HOSTDEVICE const T* getValue() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const T* getValue () const IMATH_NOEXCEPT; /// @} /// @{ /// @name Arithmetic and Comparison - + /// Equality - template IMATH_HOSTDEVICE constexpr bool operator== (const Vec3& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr bool + operator== (const Vec3& v) const IMATH_NOEXCEPT; /// Inequality - template IMATH_HOSTDEVICE constexpr bool operator!= (const Vec3& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr bool + operator!= (const Vec3& v) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and `m` are the same /// with an absolute error of no more than e, i.e., for all i, j: /// /// abs (this[i][j] - m[i][j]) <= e - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithAbsError (const Vec3& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithAbsError (const Vec3& v, T e) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and m are the same with /// a relative error of no more than e, i.e., for all i, j: /// /// abs (this[i] - v[i][j]) <= e * abs (this[i][j]) - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithRelError (const Vec3& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithRelError (const Vec3& v, T e) const IMATH_NOEXCEPT; /// Dot product IMATH_HOSTDEVICE constexpr T dot (const Vec3& v) const IMATH_NOEXCEPT; @@ -455,49 +516,61 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec3 IMATH_HOSTDEVICE constexpr Vec3 cross (const Vec3& v) const IMATH_NOEXCEPT; /// Right-handed cross product - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator%= (const Vec3& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& + operator%= (const Vec3& v) IMATH_NOEXCEPT; /// Right-handed cross product - IMATH_HOSTDEVICE constexpr Vec3 operator% (const Vec3& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 + operator% (const Vec3& v) const IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator+= (const Vec3& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& + operator+= (const Vec3& v) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE constexpr Vec3 operator+ (const Vec3& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 + operator+ (const Vec3& v) const IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator-= (const Vec3& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& + operator-= (const Vec3& v) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE constexpr Vec3 operator- (const Vec3& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 + operator- (const Vec3& v) const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE constexpr Vec3 operator-() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 operator- () const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& negate() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& negate () IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator*= (const Vec3& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& + operator*= (const Vec3& v) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator*= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& + operator*= (T a) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE constexpr Vec3 operator* (const Vec3& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 + operator* (const Vec3& v) const IMATH_NOEXCEPT; /// Component-wise multiplication IMATH_HOSTDEVICE constexpr Vec3 operator* (T a) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator/= (const Vec3& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& + operator/= (const Vec3& v) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& operator/= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3& + operator/= (T a) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE constexpr Vec3 operator/ (const Vec3& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec3 + operator/ (const Vec3& v) const IMATH_NOEXCEPT; /// Component-wise division IMATH_HOSTDEVICE constexpr Vec3 operator/ (T a) const IMATH_NOEXCEPT; @@ -508,35 +581,36 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec3 /// @name Query and Manipulation /// Return the Euclidean norm - IMATH_HOSTDEVICE T length() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T length () const IMATH_NOEXCEPT; /// Return the square of the Euclidean norm, i.e. the dot product /// with itself. - IMATH_HOSTDEVICE constexpr T length2() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T length2 () const IMATH_NOEXCEPT; /// Normalize in place. If length()==0, return a null vector. - IMATH_HOSTDEVICE const Vec3& normalize() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const Vec3& normalize () IMATH_NOEXCEPT; /// Normalize in place. If length()==0, throw an exception. - const Vec3& normalizeExc(); + const Vec3& normalizeExc (); /// Normalize without any checks for length()==0. Slightly faster /// than the other normalization routines, but if v.length() is /// 0.0, the result is undefined. - IMATH_HOSTDEVICE const Vec3& normalizeNonNull() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const Vec3& normalizeNonNull () IMATH_NOEXCEPT; /// Return a normalized vector. Does not modify *this. - IMATH_HOSTDEVICE Vec3 normalized() const IMATH_NOEXCEPT; // does not modify *this + IMATH_HOSTDEVICE Vec3 + normalized () const IMATH_NOEXCEPT; // does not modify *this /// Return a normalized vector. Does not modify *this. Throw an /// exception if length()==0. - Vec3 normalizedExc() const; + Vec3 normalizedExc () const; /// Return a normalized vector. Does not modify *this, and does /// not check for length()==0. Slightly faster than the other /// normalization routines, but if v.length() is 0.0, the result /// is undefined. - IMATH_HOSTDEVICE Vec3 normalizedNonNull() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Vec3 normalizedNonNull () const IMATH_NOEXCEPT; /// @} @@ -544,28 +618,43 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec3 /// @name Numeric Limits /// Largest possible negative value - IMATH_HOSTDEVICE constexpr static T baseTypeLowest() IMATH_NOEXCEPT { return std::numeric_limits::lowest(); } + IMATH_HOSTDEVICE constexpr static T baseTypeLowest () IMATH_NOEXCEPT + { + return std::numeric_limits::lowest (); + } /// Largest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeMax() IMATH_NOEXCEPT { return std::numeric_limits::max(); } + IMATH_HOSTDEVICE constexpr static T baseTypeMax () IMATH_NOEXCEPT + { + return std::numeric_limits::max (); + } /// Smallest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeSmallest() IMATH_NOEXCEPT { return std::numeric_limits::min(); } + IMATH_HOSTDEVICE constexpr static T baseTypeSmallest () IMATH_NOEXCEPT + { + return std::numeric_limits::min (); + } /// Smallest possible e for which 1+e != 1 - IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon() IMATH_NOEXCEPT { return std::numeric_limits::epsilon(); } + IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon () IMATH_NOEXCEPT + { + return std::numeric_limits::epsilon (); + } /// @} - + /// Return the number of dimensions, i.e. 3 - IMATH_HOSTDEVICE constexpr static unsigned int dimensions() IMATH_NOEXCEPT { return 3; } + IMATH_HOSTDEVICE constexpr static unsigned int dimensions () IMATH_NOEXCEPT + { + return 3; + } /// The base type: In templates that accept a parameter `V`, you /// can refer to `T` as `V::BaseType` typedef T BaseType; - private: - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T lengthTiny() const IMATH_NOEXCEPT; +private: + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T lengthTiny () const IMATH_NOEXCEPT; }; /// @@ -574,26 +663,25 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec3 template class IMATH_EXPORT_TEMPLATE_TYPE Vec4 { - public: - +public: /// @{ /// @name Direct access to elements T x, y, z, w; /// @} - - /// Element access by index. + + /// Element access by index. IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T& operator[] (int i) IMATH_NOEXCEPT; - /// Element access by index. + /// Element access by index. IMATH_HOSTDEVICE constexpr const T& operator[] (int i) const IMATH_NOEXCEPT; /// @{ /// @name Constructors and Assignment /// Uninitialized by default - IMATH_HOSTDEVICE Vec4() IMATH_NOEXCEPT; // no initialization + IMATH_HOSTDEVICE Vec4 () IMATH_NOEXCEPT; // no initialization /// Initialize to a scalar `(a,a,a,a)` IMATH_HOSTDEVICE constexpr explicit Vec4 (T a) IMATH_NOEXCEPT; @@ -605,16 +693,19 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec4 IMATH_HOSTDEVICE constexpr Vec4 (const Vec4& v) IMATH_NOEXCEPT; /// Construct from Vec4 of another base type - template IMATH_HOSTDEVICE constexpr Vec4 (const Vec4& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr Vec4 (const Vec4& v) IMATH_NOEXCEPT; /// Vec3 to Vec4 conversion, sets w to 1. - template IMATH_HOSTDEVICE explicit constexpr Vec4 (const Vec3& v) IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE explicit constexpr Vec4 (const Vec3& v) IMATH_NOEXCEPT; /// Assignment - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& operator= (const Vec4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& + operator= (const Vec4& v) IMATH_NOEXCEPT; /// Destructor - ~Vec4() IMATH_NOEXCEPT = default; + ~Vec4 () IMATH_NOEXCEPT = default; /// @} @@ -634,30 +725,40 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec4 /// including any Imath header files. /// - template::value)> + template ::value)> IMATH_HOSTDEVICE explicit constexpr Vec4 (const V& v) IMATH_NOEXCEPT - : Vec4(T(v.x), T(v.y), T(v.z), T(v.w)) { } - - template::value - && !has_xyzw::value)> - IMATH_HOSTDEVICE explicit Vec4 (const V& v) : Vec4(T(v[0]), T(v[1]), T(v[2]), T(v[3])) { } - - template::value)> - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& operator= (const V& v) IMATH_NOEXCEPT { - x = T(v.x); - y = T(v.y); - z = T(v.z); - w = T(v.w); + : Vec4 (T (v.x), T (v.y), T (v.z), T (v.w)) + {} + + template < + typename V, + IMATH_ENABLE_IF ( + has_subscript::value && !has_xyzw::value)> + IMATH_HOSTDEVICE explicit Vec4 (const V& v) + : Vec4 (T (v[0]), T (v[1]), T (v[2]), T (v[3])) + {} + + template ::value)> + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& + operator= (const V& v) IMATH_NOEXCEPT + { + x = T (v.x); + y = T (v.y); + z = T (v.z); + w = T (v.w); return *this; } - template::value - && !has_xyzw::value)> - IMATH_HOSTDEVICE const Vec4& operator= (const V& v) { - x = T(v[0]); - y = T(v[1]); - z = T(v[2]); - w = T(v[3]); + template < + typename V, + IMATH_ENABLE_IF ( + has_subscript::value && !has_xyzw::value)> + IMATH_HOSTDEVICE const Vec4& operator= (const V& v) + { + x = T (v[0]); + y = T (v[1]); + z = T (v[2]); + w = T (v[3]); return *this; } /// @} @@ -665,26 +766,32 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec4 /// @{ /// @name Arithmetic and Comparison - + /// Equality - template IMATH_HOSTDEVICE constexpr bool operator== (const Vec4& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr bool + operator== (const Vec4& v) const IMATH_NOEXCEPT; /// Inequality - template IMATH_HOSTDEVICE constexpr bool operator!= (const Vec4& v) const IMATH_NOEXCEPT; + template + IMATH_HOSTDEVICE constexpr bool + operator!= (const Vec4& v) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and `m` are the same /// with an absolute error of no more than e, i.e., for all i, j: /// /// abs (this[i][j] - m[i][j]) <= e - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithAbsError (const Vec4& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithAbsError (const Vec4& v, T e) const IMATH_NOEXCEPT; /// Compare two matrices and test if they are "approximately equal": /// @return True if the coefficients of this and m are the same with /// a relative error of no more than e, i.e., for all i, j: /// /// abs (this[i] - v[i][j]) <= e * abs (this[i][j]) - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithRelError (const Vec4& v, T e) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool + equalWithRelError (const Vec4& v, T e) const IMATH_NOEXCEPT; /// Dot product IMATH_HOSTDEVICE constexpr T dot (const Vec4& v) const IMATH_NOEXCEPT; @@ -693,43 +800,53 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec4 IMATH_HOSTDEVICE constexpr T operator^ (const Vec4& v) const IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& operator+= (const Vec4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& + operator+= (const Vec4& v) IMATH_NOEXCEPT; /// Component-wise addition - IMATH_HOSTDEVICE constexpr Vec4 operator+ (const Vec4& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec4 + operator+ (const Vec4& v) const IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& operator-= (const Vec4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& + operator-= (const Vec4& v) IMATH_NOEXCEPT; /// Component-wise subtraction - IMATH_HOSTDEVICE constexpr Vec4 operator- (const Vec4& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec4 + operator- (const Vec4& v) const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE constexpr Vec4 operator-() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec4 operator- () const IMATH_NOEXCEPT; /// Component-wise multiplication by -1 - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& negate() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& negate () IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& operator*= (const Vec4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& + operator*= (const Vec4& v) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& operator*= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& + operator*= (T a) IMATH_NOEXCEPT; /// Component-wise multiplication - IMATH_HOSTDEVICE constexpr Vec4 operator* (const Vec4& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec4 + operator* (const Vec4& v) const IMATH_NOEXCEPT; /// Component-wise multiplication IMATH_HOSTDEVICE constexpr Vec4 operator* (T a) const IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& operator/= (const Vec4& v) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& + operator/= (const Vec4& v) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& operator/= (T a) IMATH_NOEXCEPT; + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4& + operator/= (T a) IMATH_NOEXCEPT; /// Component-wise division - IMATH_HOSTDEVICE constexpr Vec4 operator/ (const Vec4& v) const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr Vec4 + operator/ (const Vec4& v) const IMATH_NOEXCEPT; /// Component-wise division IMATH_HOSTDEVICE constexpr Vec4 operator/ (T a) const IMATH_NOEXCEPT; @@ -740,64 +857,80 @@ template class IMATH_EXPORT_TEMPLATE_TYPE Vec4 /// @name Query and Manipulation /// Return the Euclidean norm - IMATH_HOSTDEVICE T length() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE T length () const IMATH_NOEXCEPT; /// Return the square of the Euclidean norm, i.e. the dot product /// with itself. - IMATH_HOSTDEVICE constexpr T length2() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE constexpr T length2 () const IMATH_NOEXCEPT; /// Normalize in place. If length()==0, return a null vector. - IMATH_HOSTDEVICE const Vec4& normalize() IMATH_NOEXCEPT; // modifies *this + IMATH_HOSTDEVICE const Vec4& normalize () IMATH_NOEXCEPT; // modifies *this /// Normalize in place. If length()==0, throw an exception. - const Vec4& normalizeExc(); + const Vec4& normalizeExc (); /// Normalize without any checks for length()==0. Slightly faster /// than the other normalization routines, but if v.length() is /// 0.0, the result is undefined. - IMATH_HOSTDEVICE const Vec4& normalizeNonNull() IMATH_NOEXCEPT; + IMATH_HOSTDEVICE const Vec4& normalizeNonNull () IMATH_NOEXCEPT; /// Return a normalized vector. Does not modify *this. - IMATH_HOSTDEVICE Vec4 normalized() const IMATH_NOEXCEPT; // does not modify *this + IMATH_HOSTDEVICE Vec4 + normalized () const IMATH_NOEXCEPT; // does not modify *this /// Return a normalized vector. Does not modify *this. Throw an /// exception if length()==0. - Vec4 normalizedExc() const; + Vec4 normalizedExc () const; /// Return a normalized vector. Does not modify *this, and does /// not check for length()==0. Slightly faster than the other /// normalization routines, but if v.length() is 0.0, the result /// is undefined. - IMATH_HOSTDEVICE Vec4 normalizedNonNull() const IMATH_NOEXCEPT; + IMATH_HOSTDEVICE Vec4 normalizedNonNull () const IMATH_NOEXCEPT; /// @} - + /// @{ /// @name Numeric Limits - + /// Largest possible negative value - IMATH_HOSTDEVICE constexpr static T baseTypeLowest() IMATH_NOEXCEPT { return std::numeric_limits::lowest(); } + IMATH_HOSTDEVICE constexpr static T baseTypeLowest () IMATH_NOEXCEPT + { + return std::numeric_limits::lowest (); + } /// Largest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeMax() IMATH_NOEXCEPT { return std::numeric_limits::max(); } + IMATH_HOSTDEVICE constexpr static T baseTypeMax () IMATH_NOEXCEPT + { + return std::numeric_limits::max (); + } /// Smallest possible positive value - IMATH_HOSTDEVICE constexpr static T baseTypeSmallest() IMATH_NOEXCEPT { return std::numeric_limits::min(); } + IMATH_HOSTDEVICE constexpr static T baseTypeSmallest () IMATH_NOEXCEPT + { + return std::numeric_limits::min (); + } /// Smallest possible e for which 1+e != 1 - IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon() IMATH_NOEXCEPT { return std::numeric_limits::epsilon(); } + IMATH_HOSTDEVICE constexpr static T baseTypeEpsilon () IMATH_NOEXCEPT + { + return std::numeric_limits::epsilon (); + } /// @} - + /// Return the number of dimensions, i.e. 4 - IMATH_HOSTDEVICE constexpr static unsigned int dimensions() IMATH_NOEXCEPT { return 4; } + IMATH_HOSTDEVICE constexpr static unsigned int dimensions () IMATH_NOEXCEPT + { + return 4; + } /// The base type: In templates that accept a parameter `V`, you /// can refer to `T` as `V::BaseType` typedef T BaseType; - private: - IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T lengthTiny() const IMATH_NOEXCEPT; +private: + IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T lengthTiny () const IMATH_NOEXCEPT; }; /// Stream output, as "(x y)" @@ -810,13 +943,19 @@ template std::ostream& operator<< (std::ostream& s, const Vec3& v); template std::ostream& operator<< (std::ostream& s, const Vec4& v); /// Reverse multiplication: S * Vec2 -template IMATH_HOSTDEVICE constexpr Vec2 operator* (T a, const Vec2& v) IMATH_NOEXCEPT; +template +IMATH_HOSTDEVICE constexpr Vec2 +operator* (T a, const Vec2& v) IMATH_NOEXCEPT; /// Reverse multiplication: S * Vec3 -template IMATH_HOSTDEVICE constexpr Vec3 operator* (T a, const Vec3& v) IMATH_NOEXCEPT; +template +IMATH_HOSTDEVICE constexpr Vec3 +operator* (T a, const Vec3& v) IMATH_NOEXCEPT; /// Reverse multiplication: S * Vec4 -template IMATH_HOSTDEVICE constexpr Vec4 operator* (T a, const Vec4& v) IMATH_NOEXCEPT; +template +IMATH_HOSTDEVICE constexpr Vec4 +operator* (T a, const Vec4& v) IMATH_NOEXCEPT; //------------------------- // Typedefs for convenience @@ -876,85 +1015,166 @@ typedef Vec4 V4d; /// @cond Doxygen_Suppress // Vec2 -template <> IMATH_HOSTDEVICE short Vec2::length() const IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE const Vec2& Vec2::normalize() IMATH_NOEXCEPT = delete; -template <> const Vec2& Vec2::normalizeExc() = delete; -template <> IMATH_HOSTDEVICE const Vec2& Vec2::normalizeNonNull() IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE Vec2 Vec2::normalized() const IMATH_NOEXCEPT = delete; -template <> Vec2 Vec2::normalizedExc() const = delete; -template <> IMATH_HOSTDEVICE Vec2 Vec2::normalizedNonNull() const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE short Vec2::length () const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE const Vec2& + Vec2::normalize () IMATH_NOEXCEPT = delete; +template <> const Vec2& Vec2::normalizeExc () = delete; +template <> +IMATH_HOSTDEVICE const Vec2& + Vec2::normalizeNonNull () IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE Vec2 + Vec2::normalized () const IMATH_NOEXCEPT = delete; +template <> Vec2 Vec2::normalizedExc () const = delete; +template <> +IMATH_HOSTDEVICE Vec2 +Vec2::normalizedNonNull () const IMATH_NOEXCEPT = delete; // Vec2 -template <> IMATH_HOSTDEVICE int Vec2::length() const IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE const Vec2& Vec2::normalize() IMATH_NOEXCEPT = delete; -template <> const Vec2& Vec2::normalizeExc() = delete; -template <> IMATH_HOSTDEVICE const Vec2& Vec2::normalizeNonNull() IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE Vec2 Vec2::normalized() const IMATH_NOEXCEPT = delete; -template <> Vec2 Vec2::normalizedExc() const = delete; -template <> IMATH_HOSTDEVICE Vec2 Vec2::normalizedNonNull() const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE int Vec2::length () const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE const Vec2& + Vec2::normalize () IMATH_NOEXCEPT = delete; +template <> const Vec2& Vec2::normalizeExc () = delete; +template <> +IMATH_HOSTDEVICE const Vec2& + Vec2::normalizeNonNull () IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE Vec2 + Vec2::normalized () const IMATH_NOEXCEPT = delete; +template <> Vec2 Vec2::normalizedExc () const = delete; +template <> +IMATH_HOSTDEVICE Vec2 + Vec2::normalizedNonNull () const IMATH_NOEXCEPT = delete; // Vec2 -template <> IMATH_HOSTDEVICE int64_t Vec2::length() const IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE const Vec2& Vec2::normalize() IMATH_NOEXCEPT = delete; -template <> const Vec2& Vec2::normalizeExc() = delete; -template <> IMATH_HOSTDEVICE const Vec2& Vec2::normalizeNonNull() IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE Vec2 Vec2::normalized() const IMATH_NOEXCEPT = delete; -template <> Vec2 Vec2::normalizedExc() const = delete; -template <> IMATH_HOSTDEVICE Vec2 Vec2::normalizedNonNull() const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE int64_t Vec2::length () const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE const Vec2& + Vec2::normalize () IMATH_NOEXCEPT = delete; +template <> const Vec2& Vec2::normalizeExc () = delete; +template <> +IMATH_HOSTDEVICE const Vec2& +Vec2::normalizeNonNull () IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE Vec2 + Vec2::normalized () const IMATH_NOEXCEPT = delete; +template <> Vec2 Vec2::normalizedExc () const = delete; +template <> +IMATH_HOSTDEVICE Vec2 +Vec2::normalizedNonNull () const IMATH_NOEXCEPT = delete; // Vec3 -template <> IMATH_HOSTDEVICE short Vec3::length() const IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE const Vec3& Vec3::normalize() IMATH_NOEXCEPT = delete; -template <> const Vec3& Vec3::normalizeExc() = delete; -template <> IMATH_HOSTDEVICE const Vec3& Vec3::normalizeNonNull() IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE Vec3 Vec3::normalized() const IMATH_NOEXCEPT = delete; -template <> Vec3 Vec3::normalizedExc() const = delete; -template <> IMATH_HOSTDEVICE Vec3 Vec3::normalizedNonNull() const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE short Vec3::length () const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE const Vec3& + Vec3::normalize () IMATH_NOEXCEPT = delete; +template <> const Vec3& Vec3::normalizeExc () = delete; +template <> +IMATH_HOSTDEVICE const Vec3& + Vec3::normalizeNonNull () IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE Vec3 + Vec3::normalized () const IMATH_NOEXCEPT = delete; +template <> Vec3 Vec3::normalizedExc () const = delete; +template <> +IMATH_HOSTDEVICE Vec3 +Vec3::normalizedNonNull () const IMATH_NOEXCEPT = delete; // Vec3 -template <> IMATH_HOSTDEVICE int Vec3::length() const IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE const Vec3& Vec3::normalize() IMATH_NOEXCEPT = delete; -template <> const Vec3& Vec3::normalizeExc() = delete; -template <> IMATH_HOSTDEVICE const Vec3& Vec3::normalizeNonNull() IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE Vec3 Vec3::normalized() const IMATH_NOEXCEPT = delete; -template <> Vec3 Vec3::normalizedExc() const = delete; -template <> IMATH_HOSTDEVICE Vec3 Vec3::normalizedNonNull() const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE int Vec3::length () const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE const Vec3& + Vec3::normalize () IMATH_NOEXCEPT = delete; +template <> const Vec3& Vec3::normalizeExc () = delete; +template <> +IMATH_HOSTDEVICE const Vec3& + Vec3::normalizeNonNull () IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE Vec3 + Vec3::normalized () const IMATH_NOEXCEPT = delete; +template <> Vec3 Vec3::normalizedExc () const = delete; +template <> +IMATH_HOSTDEVICE Vec3 + Vec3::normalizedNonNull () const IMATH_NOEXCEPT = delete; // Vec3 -template <> IMATH_HOSTDEVICE int64_t Vec3::length() const IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE const Vec3& Vec3::normalize() IMATH_NOEXCEPT = delete; -template <> const Vec3& Vec3::normalizeExc() = delete; -template <> IMATH_HOSTDEVICE const Vec3& Vec3::normalizeNonNull() IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE Vec3 Vec3::normalized() const IMATH_NOEXCEPT = delete; -template <> Vec3 Vec3::normalizedExc() const = delete; -template <> IMATH_HOSTDEVICE Vec3 Vec3::normalizedNonNull() const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE int64_t Vec3::length () const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE const Vec3& + Vec3::normalize () IMATH_NOEXCEPT = delete; +template <> const Vec3& Vec3::normalizeExc () = delete; +template <> +IMATH_HOSTDEVICE const Vec3& +Vec3::normalizeNonNull () IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE Vec3 + Vec3::normalized () const IMATH_NOEXCEPT = delete; +template <> Vec3 Vec3::normalizedExc () const = delete; +template <> +IMATH_HOSTDEVICE Vec3 +Vec3::normalizedNonNull () const IMATH_NOEXCEPT = delete; // Vec4 -template <> IMATH_HOSTDEVICE short Vec4::length() const IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE const Vec4& Vec4::normalize() IMATH_NOEXCEPT = delete; -template <> const Vec4& Vec4::normalizeExc() = delete; -template <> IMATH_HOSTDEVICE const Vec4& Vec4::normalizeNonNull() IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE Vec4 Vec4::normalized() const IMATH_NOEXCEPT = delete; -template <> Vec4 Vec4::normalizedExc() const = delete; -template <> IMATH_HOSTDEVICE Vec4 Vec4::normalizedNonNull() const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE short Vec4::length () const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE const Vec4& + Vec4::normalize () IMATH_NOEXCEPT = delete; +template <> const Vec4& Vec4::normalizeExc () = delete; +template <> +IMATH_HOSTDEVICE const Vec4& + Vec4::normalizeNonNull () IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE Vec4 + Vec4::normalized () const IMATH_NOEXCEPT = delete; +template <> Vec4 Vec4::normalizedExc () const = delete; +template <> +IMATH_HOSTDEVICE Vec4 +Vec4::normalizedNonNull () const IMATH_NOEXCEPT = delete; // Vec4 -template <> IMATH_HOSTDEVICE int Vec4::length() const IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE const Vec4& Vec4::normalize() IMATH_NOEXCEPT = delete; -template <> const Vec4& Vec4::normalizeExc() = delete; -template <> IMATH_HOSTDEVICE const Vec4& Vec4::normalizeNonNull() IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE Vec4 Vec4::normalized() const IMATH_NOEXCEPT = delete; -template <> Vec4 Vec4::normalizedExc() const = delete; -template <> IMATH_HOSTDEVICE Vec4 Vec4::normalizedNonNull() const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE int Vec4::length () const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE const Vec4& + Vec4::normalize () IMATH_NOEXCEPT = delete; +template <> const Vec4& Vec4::normalizeExc () = delete; +template <> +IMATH_HOSTDEVICE const Vec4& + Vec4::normalizeNonNull () IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE Vec4 + Vec4::normalized () const IMATH_NOEXCEPT = delete; +template <> Vec4 Vec4::normalizedExc () const = delete; +template <> +IMATH_HOSTDEVICE Vec4 + Vec4::normalizedNonNull () const IMATH_NOEXCEPT = delete; // Vec4 -template <> IMATH_HOSTDEVICE int64_t Vec4::length() const IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE const Vec4& Vec4::normalize() IMATH_NOEXCEPT = delete; -template <> const Vec4& Vec4::normalizeExc() = delete; -template <> IMATH_HOSTDEVICE const Vec4& Vec4::normalizeNonNull() IMATH_NOEXCEPT = delete; -template <> IMATH_HOSTDEVICE Vec4 Vec4::normalized() const IMATH_NOEXCEPT = delete; -template <> Vec4 Vec4::normalizedExc() const = delete; -template <> IMATH_HOSTDEVICE Vec4 Vec4::normalizedNonNull() const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE int64_t Vec4::length () const IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE const Vec4& + Vec4::normalize () IMATH_NOEXCEPT = delete; +template <> const Vec4& Vec4::normalizeExc () = delete; +template <> +IMATH_HOSTDEVICE const Vec4& +Vec4::normalizeNonNull () IMATH_NOEXCEPT = delete; +template <> +IMATH_HOSTDEVICE Vec4 + Vec4::normalized () const IMATH_NOEXCEPT = delete; +template <> Vec4 Vec4::normalizedExc () const = delete; +template <> +IMATH_HOSTDEVICE Vec4 +Vec4::normalizedNonNull () const IMATH_NOEXCEPT = delete; /// @endcond Doxygen_Suppress @@ -976,30 +1196,34 @@ Vec2::operator[] (int i) const IMATH_NOEXCEPT return (&x)[i]; // NOSONAR - suppress SonarCloud bug report. } -template IMATH_HOSTDEVICE inline Vec2::Vec2() IMATH_NOEXCEPT +template IMATH_HOSTDEVICE inline Vec2::Vec2 () IMATH_NOEXCEPT { // empty, and not constexpr because data is uninitialized. } -template IMATH_HOSTDEVICE constexpr inline Vec2::Vec2 (T a) IMATH_NOEXCEPT - : x(a), y(a) -{ -} +template +IMATH_HOSTDEVICE constexpr inline Vec2::Vec2 (T a) IMATH_NOEXCEPT : x (a), + y (a) +{} -template IMATH_HOSTDEVICE constexpr inline Vec2::Vec2 (T a, T b) IMATH_NOEXCEPT - : x(a), y(b) -{ -} +template +IMATH_HOSTDEVICE constexpr inline Vec2::Vec2 (T a, T b) IMATH_NOEXCEPT + : x (a), + y (b) +{} -template IMATH_HOSTDEVICE constexpr inline Vec2::Vec2 (const Vec2& v) IMATH_NOEXCEPT - : x(v.x), y(v.y) -{ -} +template +IMATH_HOSTDEVICE constexpr inline Vec2::Vec2 (const Vec2& v) IMATH_NOEXCEPT + : x (v.x), + y (v.y) +{} -template template IMATH_HOSTDEVICE constexpr inline Vec2::Vec2 (const Vec2& v) IMATH_NOEXCEPT - : x(T(v.x)), y(T(v.y)) -{ -} +template +template +IMATH_HOSTDEVICE constexpr inline Vec2::Vec2 (const Vec2& v) + IMATH_NOEXCEPT : x (T (v.x)), + y (T (v.y)) +{} template IMATH_CONSTEXPR14 IMATH_HOSTDEVICE inline const Vec2& @@ -1048,14 +1272,14 @@ Vec2::getValue (Vec2& v) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline T* -Vec2::getValue() IMATH_NOEXCEPT +Vec2::getValue () IMATH_NOEXCEPT { return (T*) &x; } template IMATH_HOSTDEVICE inline const T* -Vec2::getValue() const IMATH_NOEXCEPT +Vec2::getValue () const IMATH_NOEXCEPT { return (const T*) &x; } @@ -1160,14 +1384,14 @@ Vec2::operator- (const Vec2& v) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline Vec2 -Vec2::operator-() const IMATH_NOEXCEPT +Vec2::operator- () const IMATH_NOEXCEPT { return Vec2 (-x, -y); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Vec2& -Vec2::negate() IMATH_NOEXCEPT + Vec2::negate () IMATH_NOEXCEPT { x = -x; y = -y; @@ -1240,18 +1464,16 @@ Vec2::operator/ (T a) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline T -Vec2::lengthTiny() const IMATH_NOEXCEPT +Vec2::lengthTiny () const IMATH_NOEXCEPT { - T absX = std::abs(x); - T absY = std::abs(y); + T absX = std::abs (x); + T absY = std::abs (y); T max = absX; - if (max < absY) - max = absY; + if (max < absY) max = absY; - if (IMATH_UNLIKELY(max == T (0))) - return T (0); + if (IMATH_UNLIKELY (max == T (0))) return T (0); // // Do not replace the divisions by max with multiplications by 1/max. @@ -1267,30 +1489,30 @@ Vec2::lengthTiny() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline T -Vec2::length() const IMATH_NOEXCEPT +Vec2::length () const IMATH_NOEXCEPT { T length2 = dot (*this); - if (IMATH_UNLIKELY(length2 < T (2) * std::numeric_limits::min())) - return lengthTiny(); + if (IMATH_UNLIKELY (length2 < T (2) * std::numeric_limits::min ())) + return lengthTiny (); return std::sqrt (length2); } template IMATH_HOSTDEVICE constexpr inline T -Vec2::length2() const IMATH_NOEXCEPT +Vec2::length2 () const IMATH_NOEXCEPT { return dot (*this); } template IMATH_HOSTDEVICE inline const Vec2& -Vec2::normalize() IMATH_NOEXCEPT +Vec2::normalize () IMATH_NOEXCEPT { - T l = length(); + T l = length (); - if (IMATH_LIKELY(l != T (0))) + if (IMATH_LIKELY (l != T (0))) { // // Do not replace the divisions by l with multiplications by 1/l. @@ -1307,11 +1529,11 @@ Vec2::normalize() IMATH_NOEXCEPT template inline const Vec2& -Vec2::normalizeExc() +Vec2::normalizeExc () { - T l = length(); + T l = length (); - if (IMATH_UNLIKELY(l == T (0))) + if (IMATH_UNLIKELY (l == T (0))) throw std::domain_error ("Cannot normalize null vector."); x /= l; @@ -1321,9 +1543,9 @@ Vec2::normalizeExc() template IMATH_HOSTDEVICE inline const Vec2& -Vec2::normalizeNonNull() IMATH_NOEXCEPT +Vec2::normalizeNonNull () IMATH_NOEXCEPT { - T l = length(); + T l = length (); x /= l; y /= l; return *this; @@ -1331,23 +1553,22 @@ Vec2::normalizeNonNull() IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline Vec2 -Vec2::normalized() const IMATH_NOEXCEPT +Vec2::normalized () const IMATH_NOEXCEPT { - T l = length(); + T l = length (); - if (IMATH_UNLIKELY(l == T (0))) - return Vec2 (T (0)); + if (IMATH_UNLIKELY (l == T (0))) return Vec2 (T (0)); return Vec2 (x / l, y / l); } template inline Vec2 -Vec2::normalizedExc() const +Vec2::normalizedExc () const { - T l = length(); + T l = length (); - if (IMATH_UNLIKELY(l == T (0))) + if (IMATH_UNLIKELY (l == T (0))) throw std::domain_error ("Cannot normalize null vector."); return Vec2 (x / l, y / l); @@ -1355,9 +1576,9 @@ Vec2::normalizedExc() const template IMATH_HOSTDEVICE inline Vec2 -Vec2::normalizedNonNull() const IMATH_NOEXCEPT +Vec2::normalizedNonNull () const IMATH_NOEXCEPT { - T l = length(); + T l = length (); return Vec2 (x / l, y / l); } @@ -1366,8 +1587,7 @@ Vec2::normalizedNonNull() const IMATH_NOEXCEPT //----------------------- template -IMATH_HOSTDEVICE -IMATH_CONSTEXPR14 inline T& +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline T& Vec3::operator[] (int i) IMATH_NOEXCEPT { return (&x)[i]; // NOSONAR - suppress SonarCloud bug report. @@ -1380,31 +1600,38 @@ Vec3::operator[] (int i) const IMATH_NOEXCEPT return (&x)[i]; // NOSONAR - suppress SonarCloud bug report. } -template IMATH_HOSTDEVICE inline Vec3::Vec3() IMATH_NOEXCEPT +template IMATH_HOSTDEVICE inline Vec3::Vec3 () IMATH_NOEXCEPT { // empty, and not constexpr because data is uninitialized. } -template IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (T a) IMATH_NOEXCEPT - : x(a), y(a), z(a) -{ -} +template +IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (T a) IMATH_NOEXCEPT : x (a), + y (a), + z (a) +{} -template IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (T a, T b, T c) IMATH_NOEXCEPT - : x(a), y(b), z(c) -{ -} +template +IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (T a, T b, T c) IMATH_NOEXCEPT + : x (a), + y (b), + z (c) +{} -template IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (const Vec3& v) IMATH_NOEXCEPT - : x(v.x), y(v.y), z(v.z) -{ -} +template +IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (const Vec3& v) IMATH_NOEXCEPT + : x (v.x), + y (v.y), + z (v.z) +{} -template template -IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (const Vec3& v) IMATH_NOEXCEPT - : x(T(v.x)), y(T(v.y)), z(T(v.z)) -{ -} +template +template +IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (const Vec3& v) + IMATH_NOEXCEPT : x (T (v.x)), + y (T (v.y)), + z (T (v.z)) +{} template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Vec3& @@ -1416,15 +1643,18 @@ Vec3::operator= (const Vec3& v) IMATH_NOEXCEPT return *this; } -template template -IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (const Vec4& v) IMATH_NOEXCEPT - : x(T(v.x/v.w)), y(T(v.y/v.w)), z(T(v.z/v.w)) -{ -} +template +template +IMATH_HOSTDEVICE constexpr inline Vec3::Vec3 (const Vec4& v) + IMATH_NOEXCEPT : x (T (v.x / v.w)), + y (T (v.y / v.w)), + z (T (v.z / v.w)) +{} template template -IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Vec3::Vec3 (const Vec4& v, InfException) +IMATH_HOSTDEVICE + IMATH_CONSTEXPR14 inline Vec3::Vec3 (const Vec4& v, InfException) { T vx = T (v.x); T vy = T (v.y); @@ -1435,7 +1665,7 @@ IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline Vec3::Vec3 (const Vec4& v, InfEx if (absW < 1) { - T m = baseTypeMax() * absW; + T m = baseTypeMax () * absW; if (vx <= -m || vx >= m || vy <= -m || vy >= m || vz <= -m || vz >= m) throw std::domain_error ("Cannot normalize point at infinity."); @@ -1488,14 +1718,14 @@ Vec3::getValue (Vec3& v) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline T* -Vec3::getValue() IMATH_NOEXCEPT +Vec3::getValue () IMATH_NOEXCEPT { return (T*) &x; } template IMATH_HOSTDEVICE inline const T* -Vec3::getValue() const IMATH_NOEXCEPT +Vec3::getValue () const IMATH_NOEXCEPT { return (const T*) &x; } @@ -1615,14 +1845,14 @@ Vec3::operator- (const Vec3& v) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline Vec3 -Vec3::operator-() const IMATH_NOEXCEPT +Vec3::operator- () const IMATH_NOEXCEPT { return Vec3 (-x, -y, -z); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Vec3& -Vec3::negate() IMATH_NOEXCEPT + Vec3::negate () IMATH_NOEXCEPT { x = -x; y = -y; @@ -1700,7 +1930,7 @@ Vec3::operator/ (T a) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline T -Vec3::lengthTiny() const IMATH_NOEXCEPT +Vec3::lengthTiny () const IMATH_NOEXCEPT { T absX = (x >= T (0)) ? x : -x; T absY = (y >= T (0)) ? y : -y; @@ -1708,14 +1938,11 @@ Vec3::lengthTiny() const IMATH_NOEXCEPT T max = absX; - if (max < absY) - max = absY; + if (max < absY) max = absY; - if (max < absZ) - max = absZ; + if (max < absZ) max = absZ; - if (IMATH_UNLIKELY(max == T (0))) - return T (0); + if (IMATH_UNLIKELY (max == T (0))) return T (0); // // Do not replace the divisions by max with multiplications by 1/max. @@ -1732,30 +1959,30 @@ Vec3::lengthTiny() const IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline T -Vec3::length() const IMATH_NOEXCEPT +Vec3::length () const IMATH_NOEXCEPT { T length2 = dot (*this); - if (IMATH_UNLIKELY(length2 < T (2) * std::numeric_limits::min())) - return lengthTiny(); + if (IMATH_UNLIKELY (length2 < T (2) * std::numeric_limits::min ())) + return lengthTiny (); return std::sqrt (length2); } template IMATH_HOSTDEVICE constexpr inline T -Vec3::length2() const IMATH_NOEXCEPT +Vec3::length2 () const IMATH_NOEXCEPT { return dot (*this); } template IMATH_HOSTDEVICE inline const Vec3& -Vec3::normalize() IMATH_NOEXCEPT +Vec3::normalize () IMATH_NOEXCEPT { - T l = length(); + T l = length (); - if (IMATH_LIKELY(l != T (0))) + if (IMATH_LIKELY (l != T (0))) { // // Do not replace the divisions by l with multiplications by 1/l. @@ -1773,11 +2000,11 @@ Vec3::normalize() IMATH_NOEXCEPT template inline const Vec3& -Vec3::normalizeExc() +Vec3::normalizeExc () { - T l = length(); + T l = length (); - if (IMATH_UNLIKELY(l == T (0))) + if (IMATH_UNLIKELY (l == T (0))) throw std::domain_error ("Cannot normalize null vector."); x /= l; @@ -1788,9 +2015,9 @@ Vec3::normalizeExc() template IMATH_HOSTDEVICE inline const Vec3& -Vec3::normalizeNonNull() IMATH_NOEXCEPT +Vec3::normalizeNonNull () IMATH_NOEXCEPT { - T l = length(); + T l = length (); x /= l; y /= l; z /= l; @@ -1799,23 +2026,22 @@ Vec3::normalizeNonNull() IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline Vec3 -Vec3::normalized() const IMATH_NOEXCEPT +Vec3::normalized () const IMATH_NOEXCEPT { - T l = length(); + T l = length (); - if (IMATH_UNLIKELY((l == T (0)))) - return Vec3 (T (0)); + if (IMATH_UNLIKELY ((l == T (0)))) return Vec3 (T (0)); return Vec3 (x / l, y / l, z / l); } template inline Vec3 -Vec3::normalizedExc() const +Vec3::normalizedExc () const { - T l = length(); + T l = length (); - if (IMATH_UNLIKELY(l == T (0))) + if (IMATH_UNLIKELY (l == T (0))) throw std::domain_error ("Cannot normalize null vector."); return Vec3 (x / l, y / l, z / l); @@ -1823,9 +2049,9 @@ Vec3::normalizedExc() const template IMATH_HOSTDEVICE inline Vec3 -Vec3::normalizedNonNull() const IMATH_NOEXCEPT +Vec3::normalizedNonNull () const IMATH_NOEXCEPT { - T l = length(); + T l = length (); return Vec3 (x / l, y / l, z / l); } @@ -1834,8 +2060,7 @@ Vec3::normalizedNonNull() const IMATH_NOEXCEPT //----------------------- template -IMATH_HOSTDEVICE -IMATH_CONSTEXPR14 inline T& +IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline T& Vec4::operator[] (int i) IMATH_NOEXCEPT { return (&x)[i]; // NOSONAR - suppress SonarCloud bug report. @@ -1848,31 +2073,42 @@ Vec4::operator[] (int i) const IMATH_NOEXCEPT return (&x)[i]; // NOSONAR - suppress SonarCloud bug report. } -template IMATH_HOSTDEVICE inline Vec4::Vec4() IMATH_NOEXCEPT +template IMATH_HOSTDEVICE inline Vec4::Vec4 () IMATH_NOEXCEPT { // empty, and not constexpr because data is uninitialized. } -template IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (T a) IMATH_NOEXCEPT - : x(a), y(a), z(a), w(a) -{ -} +template +IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (T a) IMATH_NOEXCEPT : x (a), + y (a), + z (a), + w (a) +{} -template IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (T a, T b, T c, T d) IMATH_NOEXCEPT - : x(a), y(b), z(c), w(d) -{ -} +template +IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (T a, T b, T c, T d) + IMATH_NOEXCEPT : x (a), + y (b), + z (c), + w (d) +{} -template IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (const Vec4& v) IMATH_NOEXCEPT - : x(v.x), y(v.y), z(v.z), w(v.w) -{ -} +template +IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (const Vec4& v) IMATH_NOEXCEPT + : x (v.x), + y (v.y), + z (v.z), + w (v.w) +{} -template template -IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (const Vec4& v) IMATH_NOEXCEPT - : x(T(v.x)), y(T(v.y)), z(T(v.z)), w(T(v.w)) -{ -} +template +template +IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (const Vec4& v) + IMATH_NOEXCEPT : x (T (v.x)), + y (T (v.y)), + z (T (v.z)), + w (T (v.w)) +{} template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Vec4& @@ -1885,11 +2121,14 @@ Vec4::operator= (const Vec4& v) IMATH_NOEXCEPT return *this; } -template template -IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (const Vec3& v) IMATH_NOEXCEPT - : x(T(v.x)), y(T(v.y)), z(T(v.z)), w(T(1)) -{ -} +template +template +IMATH_HOSTDEVICE constexpr inline Vec4::Vec4 (const Vec3& v) + IMATH_NOEXCEPT : x (T (v.x)), + y (T (v.y)), + z (T (v.z)), + w (T (1)) +{} template template @@ -1981,14 +2220,14 @@ Vec4::operator- (const Vec4& v) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE constexpr inline Vec4 -Vec4::operator-() const IMATH_NOEXCEPT +Vec4::operator- () const IMATH_NOEXCEPT { return Vec4 (-x, -y, -z, -w); } template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline const Vec4& -Vec4::negate() IMATH_NOEXCEPT + Vec4::negate () IMATH_NOEXCEPT { x = -x; y = -y; @@ -2071,7 +2310,7 @@ Vec4::operator/ (T a) const IMATH_NOEXCEPT template IMATH_HOSTDEVICE IMATH_CONSTEXPR14 inline T -Vec4::lengthTiny() const IMATH_NOEXCEPT +Vec4::lengthTiny () const IMATH_NOEXCEPT { T absX = (x >= T (0)) ? x : -x; T absY = (y >= T (0)) ? y : -y; @@ -2080,17 +2319,13 @@ Vec4::lengthTiny() const IMATH_NOEXCEPT T max = absX; - if (max < absY) - max = absY; + if (max < absY) max = absY; - if (max < absZ) - max = absZ; + if (max < absZ) max = absZ; - if (max < absW) - max = absW; + if (max < absW) max = absW; - if (IMATH_UNLIKELY(max == T (0))) - return T (0); + if (IMATH_UNLIKELY (max == T (0))) return T (0); // // Do not replace the divisions by max with multiplications by 1/max. @@ -2103,35 +2338,36 @@ Vec4::lengthTiny() const IMATH_NOEXCEPT absZ /= max; absW /= max; - return max * std::sqrt (absX * absX + absY * absY + absZ * absZ + absW * absW); + return max * + std::sqrt (absX * absX + absY * absY + absZ * absZ + absW * absW); } template IMATH_HOSTDEVICE inline T -Vec4::length() const IMATH_NOEXCEPT +Vec4::length () const IMATH_NOEXCEPT { T length2 = dot (*this); - if (IMATH_UNLIKELY(length2 < T (2) * std::numeric_limits::min())) - return lengthTiny(); + if (IMATH_UNLIKELY (length2 < T (2) * std::numeric_limits::min ())) + return lengthTiny (); return std::sqrt (length2); } template IMATH_HOSTDEVICE constexpr inline T -Vec4::length2() const IMATH_NOEXCEPT +Vec4::length2 () const IMATH_NOEXCEPT { return dot (*this); } template IMATH_HOSTDEVICE const inline Vec4& -Vec4::normalize() IMATH_NOEXCEPT +Vec4::normalize () IMATH_NOEXCEPT { - T l = length(); + T l = length (); - if (IMATH_LIKELY(l != T (0))) + if (IMATH_LIKELY (l != T (0))) { // // Do not replace the divisions by l with multiplications by 1/l. @@ -2150,11 +2386,11 @@ Vec4::normalize() IMATH_NOEXCEPT template const inline Vec4& -Vec4::normalizeExc() +Vec4::normalizeExc () { - T l = length(); + T l = length (); - if (IMATH_UNLIKELY(l == T (0))) + if (IMATH_UNLIKELY (l == T (0))) throw std::domain_error ("Cannot normalize null vector."); x /= l; @@ -2166,9 +2402,9 @@ Vec4::normalizeExc() template IMATH_HOSTDEVICE inline const Vec4& -Vec4::normalizeNonNull() IMATH_NOEXCEPT +Vec4::normalizeNonNull () IMATH_NOEXCEPT { - T l = length(); + T l = length (); x /= l; y /= l; z /= l; @@ -2178,23 +2414,22 @@ Vec4::normalizeNonNull() IMATH_NOEXCEPT template IMATH_HOSTDEVICE inline Vec4 -Vec4::normalized() const IMATH_NOEXCEPT +Vec4::normalized () const IMATH_NOEXCEPT { - T l = length(); + T l = length (); - if (IMATH_UNLIKELY(l == T (0))) - return Vec4 (T (0)); + if (IMATH_UNLIKELY (l == T (0))) return Vec4 (T (0)); return Vec4 (x / l, y / l, z / l, w / l); } template inline Vec4 -Vec4::normalizedExc() const +Vec4::normalizedExc () const { - T l = length(); + T l = length (); - if (IMATH_UNLIKELY(l == T (0))) + if (IMATH_UNLIKELY (l == T (0))) throw std::domain_error ("Cannot normalize null vector."); return Vec4 (x / l, y / l, z / l, w / l); @@ -2202,9 +2437,9 @@ Vec4::normalizedExc() const template IMATH_HOSTDEVICE inline Vec4 -Vec4::normalizedNonNull() const IMATH_NOEXCEPT +Vec4::normalizedNonNull () const IMATH_NOEXCEPT { - T l = length(); + T l = length (); return Vec4 (x / l, y / l, z / l, w / l); } diff --git a/third_party/Imath-3.1.9/src/Imath/ImathVecAlgo.h b/third_party/Imath/src/Imath/ImathVecAlgo.h similarity index 78% rename from third_party/Imath-3.1.9/src/Imath/ImathVecAlgo.h rename to third_party/Imath/src/Imath/ImathVecAlgo.h index df62392e..dddde51e 100644 --- a/third_party/Imath-3.1.9/src/Imath/ImathVecAlgo.h +++ b/third_party/Imath/src/Imath/ImathVecAlgo.h @@ -29,12 +29,13 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER /// Find the projection of vector `t` onto vector `s` (`Vec2`, `Vec3`, `Vec4`) /// /// Only defined for floating-point types, e.g. `V2f`, `V3d`, etc. -template ::value)> +template < + class Vec, + IMATH_ENABLE_IF (!std::is_integral::value)> IMATH_CONSTEXPR14 inline Vec project (const Vec& s, const Vec& t) IMATH_NOEXCEPT { - Vec sNormalized = s.normalized(); + Vec sNormalized = s.normalized (); return sNormalized * (sNormalized ^ t); } @@ -42,8 +43,9 @@ project (const Vec& s, const Vec& t) IMATH_NOEXCEPT /// in the same plane as `s` and `t` (`Vec2`, `Vec3`, `Vec4`) /// /// Only defined for floating-point types, e.g. `V2f`, `V3d`, etc. -template ::value)> +template < + class Vec, + IMATH_ENABLE_IF (!std::is_integral::value)> constexpr inline Vec orthogonal (const Vec& s, const Vec& t) IMATH_NOEXCEPT { @@ -54,8 +56,9 @@ orthogonal (const Vec& s, const Vec& t) IMATH_NOEXCEPT /// off a plane with normal `t` (`Vec2`, `Vec3`, `Vec4`) /// /// Only defined for floating-point types, e.g. `V2f`, `V3d`, etc. -template ::value)> +template < + class Vec, + IMATH_ENABLE_IF (!std::is_integral::value)> constexpr inline Vec reflect (const Vec& s, const Vec& t) IMATH_NOEXCEPT { @@ -68,11 +71,12 @@ reflect (const Vec& s, const Vec& t) IMATH_NOEXCEPT /// (`Vec2`, `Vec3`, `Vec4`) template IMATH_CONSTEXPR14 Vec -closestVertex (const Vec& v0, const Vec& v1, const Vec& v2, const Vec& p) IMATH_NOEXCEPT +closestVertex (const Vec& v0, const Vec& v1, const Vec& v2, const Vec& p) + IMATH_NOEXCEPT { - Vec nearest = v0; - typename Vec::BaseType neardot = (v0 - p).length2(); - typename Vec::BaseType tmp = (v1 - p).length2(); + Vec nearest = v0; + typename Vec::BaseType neardot = (v0 - p).length2 (); + typename Vec::BaseType tmp = (v1 - p).length2 (); if (tmp < neardot) { @@ -80,7 +84,7 @@ closestVertex (const Vec& v0, const Vec& v1, const Vec& v2, const Vec& p) IMATH_ nearest = v1; } - tmp = (v2 - p).length2(); + tmp = (v2 - p).length2 (); if (tmp < neardot) { diff --git a/third_party/Imath-3.1.9/src/Imath/half.cpp b/third_party/Imath/src/Imath/half.cpp similarity index 89% rename from third_party/Imath-3.1.9/src/Imath/half.cpp rename to third_party/Imath/src/Imath/half.cpp index 85db22f5..75cdd131 100644 --- a/third_party/Imath-3.1.9/src/Imath/half.cpp +++ b/third_party/Imath/src/Imath/half.cpp @@ -76,14 +76,13 @@ operator>> (istream& is, half& h) IMATH_EXPORT void printBits (ostream& os, half h) { - unsigned short b = h.bits(); + unsigned short b = h.bits (); for (int i = 15; i >= 0; i--) { os << (((b >> i) & 1) ? '1' : '0'); - if (i == 15 || i == 10) - os << ' '; + if (i == 15 || i == 10) os << ' '; } } @@ -97,22 +96,20 @@ printBits (ostream& os, float f) { os << (((x.i >> i) & 1) ? '1' : '0'); - if (i == 31 || i == 23) - os << ' '; + if (i == 31 || i == 23) os << ' '; } } IMATH_EXPORT void printBits (char c[19], half h) { - unsigned short b = h.bits(); + unsigned short b = h.bits (); for (int i = 15, j = 0; i >= 0; i--, j++) { c[j] = (((b >> i) & 1) ? '1' : '0'); - if (i == 15 || i == 10) - c[++j] = ' '; + if (i == 15 || i == 10) c[++j] = ' '; } c[18] = 0; @@ -128,8 +125,7 @@ printBits (char c[35], float f) { c[j] = (((x.i >> i) & 1) ? '1' : '0'); - if (i == 31 || i == 23) - c[++j] = ' '; + if (i == 31 || i == 23) c[++j] = ' '; } c[34] = 0; diff --git a/third_party/Imath-3.1.9/src/Imath/half.h b/third_party/Imath/src/Imath/half.h similarity index 88% rename from third_party/Imath-3.1.9/src/Imath/half.h rename to third_party/Imath/src/Imath/half.h index 92b47013..828e0d82 100644 --- a/third_party/Imath-3.1.9/src/Imath/half.h +++ b/third_party/Imath/src/Imath/half.h @@ -235,7 +235,7 @@ #define HALF_DIG 3 /// Number of base-10 digits that are necessary to uniquely represent /// all distinct values: -/// +/// /// ``ceil(HALF_MANT_DIG * log10(2) + 1) => 4.31... -> 5`` #define HALF_DECIMAL_DIG 5 /// Base of the exponent @@ -257,7 +257,7 @@ typedef union imath_half_uif { uint32_t i; - float f; + float f; } imath_half_uif_t; /// a type for both C-only programs and C++ to use the same utilities @@ -296,7 +296,8 @@ imath_half_to_float (imath_half_bits_t h) # else return _cvtsh_ss (h); # endif -#elif defined(IMATH_HALF_USE_LOOKUP_TABLE) && !defined(IMATH_HALF_NO_LOOKUP_TABLE) +#elif defined(IMATH_HALF_USE_LOOKUP_TABLE) && \ + !defined(IMATH_HALF_NO_LOOKUP_TABLE) return imath_half_to_float_table[h].f; #else imath_half_uif_t v; @@ -304,8 +305,8 @@ imath_half_to_float (imath_half_bits_t h) // (1.06 vs 1.08 ns/call) to avoid the constants and just do 4 // shifts. // - uint32_t hexpmant = ( (uint32_t)(h) << 17 ) >> 4; - v.i = ((uint32_t)(h >> 15)) << 31; + uint32_t hexpmant = ((uint32_t) (h) << 17) >> 4; + v.i = ((uint32_t) (h >> 15)) << 31; // the likely really does help if most of your numbers are "normal" half numbers if (IMATH_LIKELY ((hexpmant >= 0x00800000))) @@ -327,8 +328,14 @@ imath_half_to_float (imath_half_bits_t h) // other compilers may provide count-leading-zeros primitives, // but we need the community to inform us of the variants uint32_t lc; -# if defined(_MSC_VER) && (_M_IX86 || _M_X64) - lc = __lzcnt (hexpmant); +# if defined(_MSC_VER) + // The direct intrinsic for this is __lznct, but that is not supported + // on older x86_64 hardware or ARM. Instead uses the bsr instruction + // and one additional subtraction. This assumes hexpmant != 0, for 0 + // bsr and lznct would behave differently. + unsigned long bsr; + _BitScanReverse (&bsr, hexpmant); + lc = (31 - bsr); # elif defined(__GNUC__) || defined(__clang__) lc = (uint32_t) __builtin_clz (hexpmant); # else @@ -370,16 +377,17 @@ imath_float_to_half (float f) # ifdef _MSC_VER // msvc does not seem to have cvtsh_ss :( return _mm_extract_epi16 ( - _mm_cvtps_ph (_mm_set_ss (f), (_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC)), + _mm_cvtps_ph ( + _mm_set_ss (f), (_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC)), 0); # else // preserve the fixed rounding mode to nearest return _cvtss_sh (f, (_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC)); # endif #else - imath_half_uif_t v; + imath_half_uif_t v; imath_half_bits_t ret; - uint32_t e, m, ui, r, shift; + uint32_t e, m, ui, r, shift; v.f = f; @@ -393,11 +401,10 @@ imath_float_to_half (float f) if (IMATH_UNLIKELY (ui >= 0x7f800000)) { ret |= 0x7c00; - if (ui == 0x7f800000) - return ret; + if (ui == 0x7f800000) return ret; m = (ui & 0x7fffff) >> 13; // make sure we have at least one bit after shift to preserve nan-ness - return ret | (uint16_t)m | (uint16_t)(m == 0); + return ret | (uint16_t) m | (uint16_t) (m == 0); } // too large, round to infinity @@ -411,15 +418,14 @@ imath_float_to_half (float f) ui -= 0x38000000; ui = ((ui + 0x00000fff + ((ui >> 13) & 1)) >> 13); - return ret | (uint16_t)ui; + return ret | (uint16_t) ui; } // zero or flush to 0 if (ui < 0x33000001) { # ifdef IMATH_HALF_ENABLE_FP_EXCEPTIONS - if (ui == 0) - return ret; + if (ui == 0) return ret; feraiseexcept (FE_UNDERFLOW); # endif return ret; @@ -431,8 +437,7 @@ imath_float_to_half (float f) m = 0x800000 | (ui & 0x7fffff); r = m << (32 - shift); ret |= (m >> shift); - if (r > 0x80000000 || (r == 0x80000000 && (ret & 0x1) != 0)) - ++ret; + if (r > 0x80000000 || (r == 0x80000000 && (ret & 0x1) != 0)) ++ret; return ret; #endif } @@ -492,7 +497,7 @@ IMATH_INTERNAL_NAMESPACE_HEADER_ENTER class IMATH_EXPORT_TYPE half { - public: +public: /// A special tag that lets us initialize a half from the raw bits. enum IMATH_EXPORT_ENUM FromBitsTag { @@ -504,7 +509,7 @@ class IMATH_EXPORT_TYPE half /// Default construction provides no initialization (hence it is /// not constexpr). - half() IMATH_NOEXCEPT = default; + half () IMATH_NOEXCEPT = default; /// Construct from float half (float f) IMATH_NOEXCEPT; @@ -519,18 +524,18 @@ class IMATH_EXPORT_TYPE half constexpr half (half&&) IMATH_NOEXCEPT = default; /// Destructor - ~half() IMATH_NOEXCEPT = default; + ~half () IMATH_NOEXCEPT = default; /// @} /// Conversion to float - operator float() const IMATH_NOEXCEPT; + operator float () const IMATH_NOEXCEPT; /// @{ /// @name Basic Algebra /// Unary minus - constexpr half operator-() const IMATH_NOEXCEPT; + constexpr half operator- () const IMATH_NOEXCEPT; /// Assignment half& operator= (const half& h) IMATH_NOEXCEPT = default; @@ -577,25 +582,25 @@ class IMATH_EXPORT_TYPE half /// Return true if a normalized number, a denormalized number, or /// zero. - constexpr bool isFinite() const IMATH_NOEXCEPT; + constexpr bool isFinite () const IMATH_NOEXCEPT; /// Return true if a normalized number. - constexpr bool isNormalized() const IMATH_NOEXCEPT; + constexpr bool isNormalized () const IMATH_NOEXCEPT; /// Return true if a denormalized number. - constexpr bool isDenormalized() const IMATH_NOEXCEPT; + constexpr bool isDenormalized () const IMATH_NOEXCEPT; /// Return true if zero. - constexpr bool isZero() const IMATH_NOEXCEPT; + constexpr bool isZero () const IMATH_NOEXCEPT; /// Return true if NAN. - constexpr bool isNan() const IMATH_NOEXCEPT; + constexpr bool isNan () const IMATH_NOEXCEPT; /// Return true if a positive or a negative infinity - constexpr bool isInfinity() const IMATH_NOEXCEPT; + constexpr bool isInfinity () const IMATH_NOEXCEPT; /// Return true if the sign bit is set (negative) - constexpr bool isNegative() const IMATH_NOEXCEPT; + constexpr bool isNegative () const IMATH_NOEXCEPT; /// @} @@ -603,16 +608,16 @@ class IMATH_EXPORT_TYPE half /// @name Special values /// Return +infinity - static constexpr half posInf() IMATH_NOEXCEPT; + static constexpr half posInf () IMATH_NOEXCEPT; /// Return -infinity - static constexpr half negInf() IMATH_NOEXCEPT; + static constexpr half negInf () IMATH_NOEXCEPT; /// Returns a NAN with the bit pattern 0111111111111111 - static constexpr half qNan() IMATH_NOEXCEPT; + static constexpr half qNan () IMATH_NOEXCEPT; /// Return a NAN with the bit pattern 0111110111111111 - static constexpr half sNan() IMATH_NOEXCEPT; + static constexpr half sNan () IMATH_NOEXCEPT; /// @} @@ -627,15 +632,15 @@ class IMATH_EXPORT_TYPE half /// @} - public: - static_assert (sizeof (float) == sizeof (uint32_t), - "Assumption about the size of floats correct"); +public: + static_assert ( + sizeof (float) == sizeof (uint32_t), + "Assumption about the size of floats correct"); using uif = imath_half_uif; - private: - - constexpr uint16_t mantissa() const IMATH_NOEXCEPT; - constexpr uint16_t exponent() const IMATH_NOEXCEPT; +private: + constexpr uint16_t mantissa () const IMATH_NOEXCEPT; + constexpr uint16_t exponent () const IMATH_NOEXCEPT; uint16_t _h; }; @@ -644,23 +649,22 @@ class IMATH_EXPORT_TYPE half // Half-from-float constructor //---------------------------- -inline half::half (float f) IMATH_NOEXCEPT - : _h (imath_float_to_half (f)) -{ -} +inline half::half (float f) IMATH_NOEXCEPT : _h (imath_float_to_half (f)) +{} //------------------------------------------ // Half from raw bits constructor //------------------------------------------ -inline constexpr half::half (FromBitsTag, uint16_t bits) IMATH_NOEXCEPT : _h (bits) +inline constexpr half::half (FromBitsTag, uint16_t bits) IMATH_NOEXCEPT + : _h (bits) {} //------------------------- // Half-to-float conversion //------------------------- -inline half::operator float() const IMATH_NOEXCEPT +inline half::operator float () const IMATH_NOEXCEPT { return imath_half_to_float (_h); } @@ -676,8 +680,7 @@ half::round (unsigned int n) const IMATH_NOEXCEPT // Parameter check. // - if (n >= 10) - return *this; + if (n >= 10) return *this; // // Disassemble h into the sign, s, @@ -727,9 +730,9 @@ half::round (unsigned int n) const IMATH_NOEXCEPT //----------------------- inline constexpr half -half::operator-() const IMATH_NOEXCEPT +half::operator- () const IMATH_NOEXCEPT { - return half (FromBits, bits() ^ 0x8000); + return half (FromBits, bits () ^ 0x8000); } inline half& @@ -796,85 +799,85 @@ half::operator/= (float f) IMATH_NOEXCEPT } inline constexpr uint16_t -half::mantissa() const IMATH_NOEXCEPT +half::mantissa () const IMATH_NOEXCEPT { return _h & 0x3ff; } inline constexpr uint16_t -half::exponent() const IMATH_NOEXCEPT +half::exponent () const IMATH_NOEXCEPT { return (_h >> 10) & 0x001f; } inline constexpr bool -half::isFinite() const IMATH_NOEXCEPT +half::isFinite () const IMATH_NOEXCEPT { - return exponent() < 31; + return exponent () < 31; } inline constexpr bool -half::isNormalized() const IMATH_NOEXCEPT +half::isNormalized () const IMATH_NOEXCEPT { - return exponent() > 0 && exponent() < 31; + return exponent () > 0 && exponent () < 31; } inline constexpr bool -half::isDenormalized() const IMATH_NOEXCEPT +half::isDenormalized () const IMATH_NOEXCEPT { - return exponent() == 0 && mantissa() != 0; + return exponent () == 0 && mantissa () != 0; } inline constexpr bool -half::isZero() const IMATH_NOEXCEPT +half::isZero () const IMATH_NOEXCEPT { return (_h & 0x7fff) == 0; } inline constexpr bool -half::isNan() const IMATH_NOEXCEPT +half::isNan () const IMATH_NOEXCEPT { - return exponent() == 31 && mantissa() != 0; + return exponent () == 31 && mantissa () != 0; } inline constexpr bool -half::isInfinity() const IMATH_NOEXCEPT +half::isInfinity () const IMATH_NOEXCEPT { - return exponent() == 31 && mantissa() == 0; + return exponent () == 31 && mantissa () == 0; } inline constexpr bool -half::isNegative() const IMATH_NOEXCEPT +half::isNegative () const IMATH_NOEXCEPT { return (_h & 0x8000) != 0; } inline constexpr half -half::posInf() IMATH_NOEXCEPT +half::posInf () IMATH_NOEXCEPT { return half (FromBits, 0x7c00); } inline constexpr half -half::negInf() IMATH_NOEXCEPT +half::negInf () IMATH_NOEXCEPT { return half (FromBits, 0xfc00); } inline constexpr half -half::qNan() IMATH_NOEXCEPT +half::qNan () IMATH_NOEXCEPT { return half (FromBits, 0x7fff); } inline constexpr half -half::sNan() IMATH_NOEXCEPT +half::sNan () IMATH_NOEXCEPT { return half (FromBits, 0x7dff); } inline constexpr uint16_t -half::bits() const IMATH_NOEXCEPT +half::bits () const IMATH_NOEXCEPT { return _h; } @@ -888,10 +891,12 @@ half::setBits (uint16_t bits) IMATH_NOEXCEPT IMATH_INTERNAL_NAMESPACE_HEADER_EXIT /// Output h to os, formatted as a float -IMATH_EXPORT std::ostream& operator<< (std::ostream& os, IMATH_INTERNAL_NAMESPACE::half h); +IMATH_EXPORT std::ostream& + operator<< (std::ostream& os, IMATH_INTERNAL_NAMESPACE::half h); /// Input h from is -IMATH_EXPORT std::istream& operator>> (std::istream& is, IMATH_INTERNAL_NAMESPACE::half& h); +IMATH_EXPORT std::istream& + operator>> (std::istream& is, IMATH_INTERNAL_NAMESPACE::half& h); #include @@ -974,7 +979,8 @@ template <> class numeric_limits // Debugging //---------- -IMATH_EXPORT void printBits (std::ostream& os, IMATH_INTERNAL_NAMESPACE::half h); +IMATH_EXPORT void +printBits (std::ostream& os, IMATH_INTERNAL_NAMESPACE::half h); IMATH_EXPORT void printBits (std::ostream& os, float f); IMATH_EXPORT void printBits (char c[19], IMATH_INTERNAL_NAMESPACE::half h); IMATH_EXPORT void printBits (char c[35], float f); diff --git a/third_party/Imath-3.1.9/src/Imath/halfFunction.h b/third_party/Imath/src/Imath/halfFunction.h similarity index 77% rename from third_party/Imath-3.1.9/src/Imath/halfFunction.h rename to third_party/Imath/src/Imath/halfFunction.h index c1e456f0..ab45198d 100644 --- a/third_party/Imath-3.1.9/src/Imath/halfFunction.h +++ b/third_party/Imath/src/Imath/halfFunction.h @@ -63,22 +63,23 @@ template class halfFunction { - public: +public: //------------ // Constructor //------------ template - halfFunction (Function f, - half domainMin = -HALF_MAX, - half domainMax = HALF_MAX, - T defaultValue = 0, - T posInfValue = 0, - T negInfValue = 0, - T nanValue = 0); + halfFunction ( + Function f, + half domainMin = -HALF_MAX, + half domainMax = HALF_MAX, + T defaultValue = 0, + T posInfValue = 0, + T negInfValue = 0, + T nanValue = 0); #ifndef IMATH_HAVE_LARGE_STACK - ~halfFunction() { delete[] _lut; } + ~halfFunction () { delete[] _lut; } halfFunction (const halfFunction&) = delete; halfFunction& operator= (const halfFunction&) = delete; halfFunction (halfFunction&&) = delete; @@ -91,7 +92,7 @@ template class halfFunction T operator() (half x) const; - private: +private: #ifdef IMATH_HAVE_LARGE_STACK T _lut[1 << 16]; #else @@ -105,13 +106,14 @@ template class halfFunction template template -halfFunction::halfFunction (Function f, - half domainMin, - half domainMax, - T defaultValue, - T posInfValue, - T negInfValue, - T nanValue) +halfFunction::halfFunction ( + Function f, + half domainMin, + half domainMax, + T defaultValue, + T posInfValue, + T negInfValue, + T nanValue) { #ifndef IMATH_HAVE_LARGE_STACK _lut = new T[1 << 16]; @@ -122,10 +124,10 @@ halfFunction::halfFunction (Function f, half x; x.setBits (i); - if (x.isNan()) + if (x.isNan ()) _lut[i] = nanValue; - else if (x.isInfinity()) - _lut[i] = x.isNegative() ? negInfValue : posInfValue; + else if (x.isInfinity ()) + _lut[i] = x.isNegative () ? negInfValue : posInfValue; else if (x < domainMin || x > domainMax) _lut[i] = defaultValue; else @@ -137,11 +139,9 @@ template inline T halfFunction::operator() (half x) const { - return _lut[x.bits()]; + return _lut[x.bits ()]; } - /// @endcond - #endif diff --git a/third_party/Imath-3.1.9/src/Imath/halfLimits.h b/third_party/Imath/src/Imath/halfLimits.h similarity index 100% rename from third_party/Imath-3.1.9/src/Imath/halfLimits.h rename to third_party/Imath/src/Imath/halfLimits.h diff --git a/third_party/Imath-3.1.9/src/Imath/toFloat.cpp b/third_party/Imath/src/Imath/toFloat.cpp similarity index 97% rename from third_party/Imath-3.1.9/src/Imath/toFloat.cpp rename to third_party/Imath/src/Imath/toFloat.cpp index 20e750dc..c77d256f 100644 --- a/third_party/Imath-3.1.9/src/Imath/toFloat.cpp +++ b/third_party/Imath/src/Imath/toFloat.cpp @@ -98,7 +98,7 @@ halfToFloat (unsigned short y) //--------------------------------------------- int -main() +main () { cout.precision (9); cout.setf (ios_base::hex, ios_base::basefield); @@ -120,8 +120,7 @@ main() { cout << "\n"; - if (i < iMax - 1) - cout << " "; + if (i < iMax - 1) cout << " "; } } diff --git a/third_party/Imath-3.1.9/src/Imath/toFloat.h b/third_party/Imath/src/Imath/toFloat.h similarity index 100% rename from third_party/Imath-3.1.9/src/Imath/toFloat.h rename to third_party/Imath/src/Imath/toFloat.h diff --git a/third_party/Imath-3.1.9/src/ImathTest/CMakeLists.txt b/third_party/Imath/src/ImathTest/CMakeLists.txt similarity index 100% rename from third_party/Imath-3.1.9/src/ImathTest/CMakeLists.txt rename to third_party/Imath/src/ImathTest/CMakeLists.txt diff --git a/third_party/Imath-3.1.9/src/ImathTest/eLut.h b/third_party/Imath/src/ImathTest/eLut.h similarity index 100% rename from third_party/Imath-3.1.9/src/ImathTest/eLut.h rename to third_party/Imath/src/ImathTest/eLut.h diff --git a/third_party/Imath-3.1.9/src/ImathTest/half_c_main.c b/third_party/Imath/src/ImathTest/half_c_main.c similarity index 84% rename from third_party/Imath-3.1.9/src/ImathTest/half_c_main.c rename to third_party/Imath/src/ImathTest/half_c_main.c index 5c928a28..cc5df971 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/half_c_main.c +++ b/third_party/Imath/src/ImathTest/half_c_main.c @@ -17,16 +17,16 @@ typedef union { uint32_t i; - float f; + float f; } c_half_uif; static const c_half_uif half_to_float[1 << 16] = #include "../Imath/toFloat.h" -static const unsigned short half_eLut[1 << 9] = + static const unsigned short half_eLut[1 << 9] = #include "eLut.h" -static short exp_long_convert (int i) + static short exp_long_convert (int i) { int s = (i >> 16) & 0x00008000; int e = ((i >> 23) & 0x000000ff) - (127 - 15); @@ -35,10 +35,7 @@ static short exp_long_convert (int i) //fprintf( stderr, "old_convert: s %d e = %d, m = %d\n", s, e, m ); if (e <= 0) { - if (e < -10) - { - return s; - } + if (e < -10) { return s; } m = m | 0x00800000; @@ -53,10 +50,7 @@ static short exp_long_convert (int i) } else if (e == 0xff - (127 - 15)) { - if (m == 0) - { - return s | 0x7c00; - } + if (m == 0) { return s | 0x7c00; } else { m >>= 13; @@ -84,8 +78,8 @@ static uint16_t exptable_method (float f) { c_half_uif x; - uint16_t _h = 0; - x.f = f; + uint16_t _h = 0; + x.f = f; if (f == 0) { @@ -142,21 +136,22 @@ exptable_method (float f) int main (int argc, char* argv[]) { - int ret = 0; + int ret = 0; c_half_uif conv; - half test, test2; + half test, test2; conv.f = HALF_DENORM_MIN + HALF_DENORM_MIN * 0.5f; test = imath_float_to_half (conv.f); test2 = exptable_method (conv.f); if (test != test2) { - fprintf (stderr, - "Invalid conversion of %.10g 0x%08X 0x%08X downconvert 0x%04X vs 0x%04X\n", - conv.f, - (conv.i >> 13) & 0x3ff, - (conv.i >> 13) & 0x3ff, - test, - test2); + fprintf ( + stderr, + "Invalid conversion of %.10g 0x%08X 0x%08X downconvert 0x%04X vs 0x%04X\n", + conv.f, + (conv.i >> 13) & 0x3ff, + (conv.i >> 13) & 0x3ff, + test, + test2); ret = 1; } @@ -208,17 +203,17 @@ main (int argc, char* argv[]) // adding a low bit, so it won't always align int e = (conv.i >> 23) & 0xff; int m = (conv.i & 0x007fffff); - if (e == 255 && m != 0) - continue; + if (e == 255 && m != 0) continue; - fprintf (stderr, - "float to half %d: %.10f (0x%08X) gives %d 0x%04X (e is %d)\n", - i, - conv.f, - conv.i, - (int) test, - test, - e); + fprintf ( + stderr, + "float to half %d: %.10f (0x%08X) gives %d 0x%04X (e is %d)\n", + i, + conv.f, + conv.i, + (int) test, + test, + e); ret = 1; } } diff --git a/third_party/Imath-3.1.9/src/ImathTest/half_perf_test.cpp b/third_party/Imath/src/ImathTest/half_perf_test.cpp similarity index 84% rename from third_party/Imath-3.1.9/src/ImathTest/half_perf_test.cpp rename to third_party/Imath/src/ImathTest/half_perf_test.cpp index 5a8faa5d..ca75ec38 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/half_perf_test.cpp +++ b/third_party/Imath/src/ImathTest/half_perf_test.cpp @@ -11,9 +11,9 @@ #include #include +#include #include #include -#include #include #ifdef _WIN32 # include @@ -26,13 +26,14 @@ static const unsigned short imath_float_half_exp_table[1 << 9] = #include "eLut.h" -using namespace IMATH_NAMESPACE; + using namespace IMATH_NAMESPACE; #ifdef IMATH_USE_HALF_LOOKUP_TABLE -static inline float table_half_cast(const half &h) +static inline float +table_half_cast (const half& h) { - return imath_half_to_float_table[h.bits()].f; + return imath_half_to_float_table[h.bits ()].f; } //----------------------------------------------- @@ -42,7 +43,7 @@ static inline float table_half_cast(const half &h) //----------------------------------------------- static float -half_overflow() +half_overflow () { float f = 1e10; @@ -70,9 +71,9 @@ long_convert (int i) // of float and half (127 versus 15). // - int s = (i >> 16) & 0x00008000; + int s = (i >> 16) & 0x00008000; int e = ((i >> 23) & 0x000000ff) - (127 - 15); - int m = i & 0x007fffff; + int m = i & 0x007fffff; // // Now reassemble s, e and m into a half: @@ -180,7 +181,7 @@ long_convert (int i) if (e > 30) { - half_overflow (); // Cause a hardware floating point overflow; + half_overflow (); // Cause a hardware floating point overflow; return s | 0x7c00; // if this returns, the half becomes an } // infinity with the same sign as f. @@ -192,9 +193,10 @@ long_convert (int i) } } -static inline half exptable_half_constructor(float f) +static inline half +exptable_half_constructor (float f) { - half ret; + half ret; imath_half_uif x; x.f = f; @@ -206,7 +208,7 @@ static inline half exptable_half_constructor(float f) // Preserve the zero's sign bit. // - ret.setBits( (x.i >> 16) ); + ret.setBits ((x.i >> 16)); } else { @@ -253,14 +255,16 @@ static inline half exptable_half_constructor(float f) } #else // provide a wrapping function for consistency/readability -static inline float table_half_cast(const half &h) +static inline float +table_half_cast (const half& h) { - return static_cast( h ); + return static_cast (h); } -static inline half exptable_half_constructor(float f) +static inline half +exptable_half_constructor (float f) { - return half {f}; + return half{f}; } #endif @@ -282,7 +286,7 @@ get_ticks (void) return ticks.QuadPart * scale; #else struct timespec t; - uint64_t nsecs; + uint64_t nsecs; static uint64_t start = 0; if (start == 0) @@ -303,25 +307,26 @@ perf_test_half_to_float (float* floats, const uint16_t* halfs, int numentries) { const half* halfvals = reinterpret_cast (halfs); - int64_t st = get_ticks(); + int64_t st = get_ticks (); for (int i = 0; i < numentries; ++i) floats[i] = imath_half_to_float (halfs[i]); - int64_t et = get_ticks(); + int64_t et = get_ticks (); - int64_t ost = get_ticks(); + int64_t ost = get_ticks (); for (int i = 0; i < numentries; ++i) floats[i] = table_half_cast (halfvals[i]); - int64_t oet = get_ticks(); + int64_t oet = get_ticks (); int64_t onanos = (oet - ost); int64_t nnanos = (et - st); - fprintf (stderr, - "half -> float Old: %10lld (%g ns) New: %10lld (%g ns) (%10lld)\n", - (long long) onanos, - (double) onanos / ((double) numentries), - (long long) nnanos, - (double) nnanos / ((double) numentries), - ((long long) (onanos - nnanos))); + fprintf ( + stderr, + "half -> float Old: %10lld (%g ns) New: %10lld (%g ns) (%10lld)\n", + (long long) onanos, + (double) onanos / ((double) numentries), + (long long) nnanos, + (double) nnanos / ((double) numentries), + ((long long) (onanos - nnanos))); } void @@ -329,25 +334,26 @@ perf_test_float_to_half (uint16_t* halfs, const float* floats, int numentries) { half* halfvals = reinterpret_cast (halfs); - int64_t st = get_ticks(); + int64_t st = get_ticks (); for (int i = 0; i < numentries; ++i) halfs[i] = imath_float_to_half (floats[i]); - int64_t et = get_ticks(); + int64_t et = get_ticks (); - int64_t ost = get_ticks(); + int64_t ost = get_ticks (); for (int i = 0; i < numentries; ++i) halfvals[i] = exptable_half_constructor (floats[i]); - int64_t oet = get_ticks(); + int64_t oet = get_ticks (); int64_t onanos = (oet - ost); int64_t nnanos = (et - st); - fprintf (stderr, - "float -> half Old: %10lld (%g ns) New: %10lld (%g ns) (%10lld)\n", - (long long) onanos, - (double) onanos / ((double) numentries), - (long long) nnanos, - (double) nnanos / ((double) numentries), - ((long long) (onanos - nnanos))); + fprintf ( + stderr, + "float -> half Old: %10lld (%g ns) New: %10lld (%g ns) (%10lld)\n", + (long long) onanos, + (double) onanos / ((double) numentries), + (long long) nnanos, + (double) nnanos / ((double) numentries), + ((long long) (onanos - nnanos))); } int @@ -368,8 +374,8 @@ main (int argc, char* argv[]) if (numentries > 0) { - uint16_t* halfs = new uint16_t[numentries]; - float* floats = new float[numentries]; + uint16_t* halfs = new uint16_t[numentries]; + float* floats = new float[numentries]; if (halfs && floats) { diff --git a/third_party/Imath-3.1.9/src/ImathTest/main.cpp b/third_party/Imath/src/ImathTest/main.cpp similarity index 93% rename from third_party/Imath-3.1.9/src/ImathTest/main.cpp rename to third_party/Imath/src/ImathTest/main.cpp index 427a01a0..cc8ab569 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/main.cpp +++ b/third_party/Imath/src/ImathTest/main.cpp @@ -9,25 +9,23 @@ #include "testArithmetic.h" #include "testBitPatterns.h" -#include "testClassification.h" -#include "testError.h" -#include "testFunction.h" -#include "testLimits.h" -#include "testSize.h" -#include "testToFloat.h" #include "testBox.h" #include "testBoxAlgo.h" +#include "testClassification.h" #include "testColor.h" +#include "testError.h" #include "testExtractEuler.h" #include "testExtractSHRT.h" #include "testFrustum.h" #include "testFrustumTest.h" #include "testFun.h" +#include "testFunction.h" #include "testInterop.h" #include "testNoInterop.h" #include "testInterval.h" #include "testInvert.h" #include "testJacobiEigenSolver.h" +#include "testLimits.h" #include "testLineAlgo.h" #include "testMatrix.h" #include "testMiscMatrixAlgo.h" @@ -38,15 +36,16 @@ #include "testRandom.h" #include "testRoots.h" #include "testShear.h" +#include "testSize.h" #include "testTinySVD.h" +#include "testToFloat.h" #include "testVec.h" #include #include -#define TEST(x) \ - if (argc < 2 || !strcmp (argv[1], #x)) \ - x(); +#define TEST(x) \ + if (argc < 2 || !strcmp (argv[1], #x)) x (); int main (int argc, char* argv[]) diff --git a/third_party/Imath-3.1.9/src/ImathTest/testArithmetic.cpp b/third_party/Imath/src/ImathTest/testArithmetic.cpp similarity index 95% rename from third_party/Imath-3.1.9/src/ImathTest/testArithmetic.cpp rename to third_party/Imath/src/ImathTest/testArithmetic.cpp index 0b1d60a5..ed66897d 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testArithmetic.cpp +++ b/third_party/Imath/src/ImathTest/testArithmetic.cpp @@ -7,22 +7,22 @@ # undef NDEBUG #endif -#include +#include "testArithmetic.h" #include +#include #include -#include "testArithmetic.h" using namespace std; void -testArithmetic() +testArithmetic () { cout << "basic arithmetic operations:\n"; float f1 (1); float f2 (2); - half h1 (3); - half h2 (4); + half h1 (3); + half h2 (4); cout << "f1 = " << f1 << ", " diff --git a/third_party/Imath-3.1.9/src/ImathTest/testArithmetic.h b/third_party/Imath/src/ImathTest/testArithmetic.h similarity index 80% rename from third_party/Imath-3.1.9/src/ImathTest/testArithmetic.h rename to third_party/Imath/src/ImathTest/testArithmetic.h index c7035796..8596d28c 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testArithmetic.h +++ b/third_party/Imath/src/ImathTest/testArithmetic.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testArithmetic(); +void testArithmetic (); diff --git a/third_party/Imath/src/ImathTest/testBitPatterns.cpp b/third_party/Imath/src/ImathTest/testBitPatterns.cpp new file mode 100644 index 00000000..b504958e --- /dev/null +++ b/third_party/Imath/src/ImathTest/testBitPatterns.cpp @@ -0,0 +1,537 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#ifdef NDEBUG +# undef NDEBUG +#endif + +#include "testBitPatterns.h" +#include +#include +#include +#include +#include + +using namespace std; + +namespace +{ + +bool +equalBitPatterns (const char* b1, const char* b2) +{ + // + // Returns true if the characters in zero-terminated string b1 + // are the same as the charaters in string b2, except for places + // where b1 or b2 contains an 'X'. For example: + // + // equalBitPatterns ("100", "100") returns true + // equalBitPatterns ("100", "101") returns false + // equalBitPatterns ("10X", "101") returns true + // equalBitPatterns ("10X", "100") returns true + // + + while (*b1 && *b2) + { + if (*b1 != *b2 && *b1 != 'X' && *b2 != 'X') return false; + + ++b1; + ++b2; + } + + return !(*b1 || *b2); +} + +void +testBits (float f, const char bh[19], const char bg[35]) +{ + half h (f); + float g (h); + + cout.width (15); + cout.precision (8); + cout << f << " "; + printBits (cout, f); + cout << " "; + printBits (cout, h); + cout << '\n'; + cout.width (15); + cout << g << " "; + printBits (cout, g); + cout << "\n\n"; + + if (bh || bg) + { + char ch[19], cg[35]; + + printBits (ch, h); + printBits (cg, g); + + if (!equalBitPatterns (ch, bh)) + { + cout << "error: expected " << bh << ", got " << ch << endl; + assert (false); + } + + if (!equalBitPatterns (cg, bg)) + { + cout << "error: expected " << bg << ", got " << cg << endl; + assert (false); + } + } +} + +float +floatPosInfinity () +{ + half::uif x; + x.i = 0x7f800000; + return x.f; +} + +float +floatNegInfinity () +{ + half::uif x; + x.i = 0xff800000; + return x.f; +} + +float +floatPosQNan1 () +{ + half::uif x; + x.i = 0x7fffffff; + return x.f; +} + +float +floatNegQNan1 () +{ + half::uif x; + x.i = 0xffffffff; + return x.f; +} + +float +floatPosQNan2 () +{ + half::uif x; + x.i = 0x7fd55555; + return x.f; +} + +float +floatNegQNan2 () +{ + half::uif x; + x.i = 0xffd55555; + return x.f; +} + +} // namespace + +void +testBitPatterns () +{ + cout << "specific bit patterns\n\n"; + + // + // Numbers close to 1.0 + // + + testBits (1.0f, "0 01111 0000000000", "0 01111111 00000000000000000000000"); + testBits ( + 1.0f + HALF_EPSILON, + "0 01111 0000000001", + "0 01111111 00000000010000000000000"); + testBits ( + 1.0f + HALF_EPSILON * 0.5f, + "0 01111 0000000000", + "0 01111111 00000000000000000000000"); + testBits ( + 1.0f + HALF_EPSILON * 0.4999f, + "0 01111 0000000000", + "0 01111111 00000000000000000000000"); + testBits ( + 1.0f + HALF_EPSILON * 0.5001f, + "0 01111 0000000001", + "0 01111111 00000000010000000000000"); + testBits ( + 1.0f + HALF_EPSILON + HALF_EPSILON, + "0 01111 0000000010", + "0 01111111 00000000100000000000000"); + testBits ( + 1.0f + HALF_EPSILON + HALF_EPSILON * 0.5f, + "0 01111 0000000010", + "0 01111111 00000000100000000000000"); + testBits ( + 1.0f + HALF_EPSILON + HALF_EPSILON * 0.4999f, + "0 01111 0000000001", + "0 01111111 00000000010000000000000"); + testBits ( + 1.0f + HALF_EPSILON + HALF_EPSILON * 0.5001f, + "0 01111 0000000010", + "0 01111111 00000000100000000000000"); + testBits ( + 1.0f - HALF_EPSILON * 0.5f, + "0 01110 1111111111", + "0 01111110 11111111110000000000000"); + testBits ( + 1.0f - HALF_EPSILON * 0.5f * 0.5f, + "0 01111 0000000000", + "0 01111111 00000000000000000000000"); + testBits ( + 1.0f - HALF_EPSILON * 0.5f * 0.4999f, + "0 01111 0000000000", + "0 01111111 00000000000000000000000"); + testBits ( + 1.0f - HALF_EPSILON * 0.5f * 0.5001f, + "0 01110 1111111111", + "0 01111110 11111111110000000000000"); + + // + // Numbers close to HALF_DENORM_MIN + // + + testBits ( + HALF_DENORM_MIN, + "0 00000 0000000001", + "0 01100111 00000000000000000000000"); + testBits ( + HALF_DENORM_MIN + HALF_DENORM_MIN, + "0 00000 0000000010", + "0 01101000 00000000000000000000000"); + testBits ( + HALF_DENORM_MIN + HALF_DENORM_MIN * 0.5f, + "0 00000 0000000010", + "0 01101000 00000000000000000000000"); + testBits ( + HALF_DENORM_MIN + HALF_DENORM_MIN * 0.4999f, + "0 00000 0000000001", + "0 01100111 00000000000000000000000"); + testBits ( + HALF_DENORM_MIN + HALF_DENORM_MIN * 0.5001f, + "0 00000 0000000010", + "0 01101000 00000000000000000000000"); + testBits ( + HALF_DENORM_MIN - + HALF_DENORM_MIN, // NOSONAR - suppress SonarCloud bug report. + "0 00000 0000000000", + "0 00000000 00000000000000000000000"); + testBits ( + HALF_DENORM_MIN - HALF_DENORM_MIN * 0.5f, + "0 00000 0000000000", + "0 00000000 00000000000000000000000"); + testBits ( + HALF_DENORM_MIN - HALF_DENORM_MIN * 0.4999f, + "0 00000 0000000001", + "0 01100111 00000000000000000000000"); + testBits ( + HALF_DENORM_MIN - HALF_DENORM_MIN * 0.5001f, + "0 00000 0000000000", + "0 00000000 00000000000000000000000"); + + // + // Numbers close to HALF_NRM_MIN + // + + testBits ( + HALF_NRM_MIN, + "0 00001 0000000000", + "0 01110001 00000000000000000000000"); + testBits ( + HALF_NRM_MIN + HALF_DENORM_MIN, + "0 00001 0000000001", + "0 01110001 00000000010000000000000"); + testBits ( + HALF_NRM_MIN + HALF_DENORM_MIN * 0.5f, + "0 00001 0000000000", + "0 01110001 00000000000000000000000"); + testBits ( + HALF_NRM_MIN + HALF_DENORM_MIN * 0.4999f, + "0 00001 0000000000", + "0 01110001 00000000000000000000000"); + testBits ( + HALF_NRM_MIN + HALF_DENORM_MIN * 0.5001f, + "0 00001 0000000001", + "0 01110001 00000000010000000000000"); + testBits ( + HALF_NRM_MIN - HALF_DENORM_MIN, + "0 00000 1111111111", + "0 01110000 11111111100000000000000"); + testBits ( + HALF_NRM_MIN - HALF_DENORM_MIN * 0.5f, + "0 00001 0000000000", + "0 01110001 00000000000000000000000"); + testBits ( + HALF_NRM_MIN - HALF_DENORM_MIN * 0.49995f, + "0 00001 0000000000", + "0 01110001 00000000000000000000000"); + testBits ( + HALF_NRM_MIN - HALF_DENORM_MIN * 0.50005f, + "0 00000 1111111111", + "0 01110000 11111111100000000000000"); + + // + // Small positive integers and simple decimal fractions + // + + testBits (2, "0 10000 0000000000", "0 10000000 00000000000000000000000"); + testBits (3, "0 10000 1000000000", "0 10000000 10000000000000000000000"); + testBits (10, "0 10010 0100000000", "0 10000010 01000000000000000000000"); + testBits (0.1f, "0 01011 1001100110", "0 01111011 10011001100000000000000"); + testBits (0.2f, "0 01100 1001100110", "0 01111100 10011001100000000000000"); + testBits (0.3f, "0 01101 0011001101", "0 01111101 00110011010000000000000"); + + // + // Numbers close to HALF_MAX + // + + testBits ( + HALF_MAX, "0 11110 1111111111", "0 10001110 11111111110000000000000"); + testBits ( + (1 << HALF_MAX_EXP) * 1.0, + "0 11111 0000000000", // +infinity + "0 11111111 00000000000000000000000"); // +infinity + testBits ( + (1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.25f), + "0 11111 0000000000", // +infinity + "0 11111111 00000000000000000000000"); // +infinity + testBits ( + (1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.25005f), + "0 11110 1111111111", + "0 10001110 11111111110000000000000"); + testBits ( + (1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.24995f), + "0 11111 0000000000", // +infinity + "0 11111111 00000000000000000000000"); // +infinity + + // + // Large positive numbers, positive infinity and NANs + // + + testBits ( + HALF_MAX * HALF_MAX, + "0 11111 0000000000", // +infinity + "0 11111111 00000000000000000000000"); // +infinity + testBits ( + FLT_MAX, + "0 11111 0000000000", // +infinity + "0 11111111 00000000000000000000000"); // +infinity + testBits ( + floatPosInfinity (), + "0 11111 0000000000", // +infinity + "0 11111111 00000000000000000000000"); // +infinity + testBits ( + floatPosQNan1 (), + "0 11111 1111111111", // nan + "0 11111111 11111111110000000000000"); // nan + testBits ( + floatPosQNan2 (), + "0 11111 1010101010", // nan + "0 11111111 10101010100000000000000"); // nan + + // + // Numbers close to -1.0 + // + + testBits (-1.0, "1 01111 0000000000", "1 01111111 00000000000000000000000"); + testBits ( + -(1.0f + HALF_EPSILON), + "1 01111 0000000001", + "1 01111111 00000000010000000000000"); + testBits ( + -(1.0f + HALF_EPSILON * 0.5f), + "1 01111 0000000000", + "1 01111111 00000000000000000000000"); + testBits ( + -(1.0f + HALF_EPSILON * 0.4999f), + "1 01111 0000000000", + "1 01111111 00000000000000000000000"); + testBits ( + -(1.0f + HALF_EPSILON * 0.5001f), + "1 01111 0000000001", + "1 01111111 00000000010000000000000"); + testBits ( + -(1.0f + HALF_EPSILON + HALF_EPSILON), + "1 01111 0000000010", + "1 01111111 00000000100000000000000"); + testBits ( + -(1.0f + HALF_EPSILON + HALF_EPSILON * 0.5f), + "1 01111 0000000010", + "1 01111111 00000000100000000000000"); + testBits ( + -(1.0f + HALF_EPSILON + HALF_EPSILON * 0.4999f), + "1 01111 0000000001", + "1 01111111 00000000010000000000000"); + testBits ( + -(1.0f + HALF_EPSILON + HALF_EPSILON * 0.5001f), + "1 01111 0000000010", + "1 01111111 00000000100000000000000"); + testBits ( + -(1.0f - HALF_EPSILON * 0.5f), + "1 01110 1111111111", + "1 01111110 11111111110000000000000"); + testBits ( + -(1.0f - HALF_EPSILON * 0.5f * 0.5f), + "1 01111 0000000000", + "1 01111111 00000000000000000000000"); + testBits ( + -(1.0f - HALF_EPSILON * 0.5f * 0.4999f), + "1 01111 0000000000", + "1 01111111 00000000000000000000000"); + testBits ( + -(1.0f - HALF_EPSILON * 0.5f * 0.5001f), + "1 01110 1111111111", + "1 01111110 11111111110000000000000"); + + // + // Numbers close to -HALF_DENORM_MIN + // + + testBits ( + -HALF_DENORM_MIN, + "1 00000 0000000001", + "1 01100111 00000000000000000000000"); + testBits ( + -(HALF_DENORM_MIN + HALF_DENORM_MIN), + "1 00000 0000000010", + "1 01101000 00000000000000000000000"); + testBits ( + -(HALF_DENORM_MIN + HALF_DENORM_MIN * 0.5f), + "1 00000 0000000010", + "1 01101000 00000000000000000000000"); + testBits ( + -(HALF_DENORM_MIN + HALF_DENORM_MIN * 0.4999f), + "1 00000 0000000001", + "1 01100111 00000000000000000000000"); + testBits ( + -(HALF_DENORM_MIN + HALF_DENORM_MIN * 0.5001f), + "1 00000 0000000010", + "1 01101000 00000000000000000000000"); + testBits ( + -(HALF_DENORM_MIN - + HALF_DENORM_MIN), // NOSONAR - suppress SonarCloud bug report. + "X 00000 0000000000", + "X 00000000 00000000000000000000000"); + testBits ( + -(HALF_DENORM_MIN - HALF_DENORM_MIN * 0.5f), + "1 00000 0000000000", + "1 00000000 00000000000000000000000"); + testBits ( + -(HALF_DENORM_MIN - HALF_DENORM_MIN * 0.4999f), + "1 00000 0000000001", + "1 01100111 00000000000000000000000"); + testBits ( + -(HALF_DENORM_MIN - HALF_DENORM_MIN * 0.5001f), + "1 00000 0000000000", + "1 00000000 00000000000000000000000"); + + // + // Numbers close to -HALF_NRM_MIN + // + + testBits ( + -HALF_NRM_MIN, + "1 00001 0000000000", + "1 01110001 00000000000000000000000"); + testBits ( + -(HALF_NRM_MIN + HALF_DENORM_MIN), + "1 00001 0000000001", + "1 01110001 00000000010000000000000"); + testBits ( + -(HALF_NRM_MIN + HALF_DENORM_MIN * 0.5f), + "1 00001 0000000000", + "1 01110001 00000000000000000000000"); + testBits ( + -(HALF_NRM_MIN + HALF_DENORM_MIN * 0.4999f), + "1 00001 0000000000", + "1 01110001 00000000000000000000000"); + testBits ( + -(HALF_NRM_MIN + HALF_DENORM_MIN * 0.5001f), + "1 00001 0000000001", + "1 01110001 00000000010000000000000"); + testBits ( + -(HALF_NRM_MIN - HALF_DENORM_MIN), + "1 00000 1111111111", + "1 01110000 11111111100000000000000"); + testBits ( + -(HALF_NRM_MIN - HALF_DENORM_MIN * 0.5f), + "1 00001 0000000000", + "1 01110001 00000000000000000000000"); + testBits ( + -(HALF_NRM_MIN - HALF_DENORM_MIN * 0.49995f), + "1 00001 0000000000", + "1 01110001 00000000000000000000000"); + testBits ( + -(HALF_NRM_MIN - HALF_DENORM_MIN * 0.50005f), + "1 00000 1111111111", + "1 01110000 11111111100000000000000"); + + // + // Small negative integers and simple decimal fractions + // + + testBits (-2, "1 10000 0000000000", "1 10000000 00000000000000000000000"); + testBits (-3, "1 10000 1000000000", "1 10000000 10000000000000000000000"); + testBits (-10, "1 10010 0100000000", "1 10000010 01000000000000000000000"); + testBits ( + -0.1f, "1 01011 1001100110", "1 01111011 10011001100000000000000"); + testBits ( + -0.2f, "1 01100 1001100110", "1 01111100 10011001100000000000000"); + testBits ( + -0.3f, "1 01101 0011001101", "1 01111101 00110011010000000000000"); + + // + // Numbers close to -HALF_MAX + // + + testBits ( + -HALF_MAX, "1 11110 1111111111", "1 10001110 11111111110000000000000"); + testBits ( + -(1 << HALF_MAX_EXP) * 1.0f, + "1 11111 0000000000", // +infinity + "1 11111111 00000000000000000000000"); // +infinity + testBits ( + -(1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.25f), + "1 11111 0000000000", // +infinity + "1 11111111 00000000000000000000000"); // +infinity + testBits ( + -(1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.25005f), + "1 11110 1111111111", + "1 10001110 11111111110000000000000"); + testBits ( + -(1 << HALF_MAX_EXP) * (1.0f - HALF_EPSILON * 0.24995f), + "1 11111 0000000000", // +infinity + "1 11111111 00000000000000000000000"); // +infinity + + // + // Large negative numbers, negative infinity and NANs + // + + testBits ( + -HALF_MAX * HALF_MAX, + "1 11111 0000000000", // +infinity + "1 11111111 00000000000000000000000"); // +infinity + testBits ( + -FLT_MAX, + "1 11111 0000000000", // +infinity + "1 11111111 00000000000000000000000"); // +infinity + testBits ( + floatNegInfinity (), + "1 11111 0000000000", // +infinity + "1 11111111 00000000000000000000000"); // +infinity + testBits ( + floatNegQNan1 (), + "1 11111 1111111111", // nan + "1 11111111 11111111110000000000000"); // nan + testBits ( + floatNegQNan2 (), + "1 11111 1010101010", // nan + "1 11111111 10101010100000000000000"); // nan + + cout << "ok\n\n" << flush; +} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testBitPatterns.h b/third_party/Imath/src/ImathTest/testBitPatterns.h similarity index 79% rename from third_party/Imath-3.1.9/src/ImathTest/testBitPatterns.h rename to third_party/Imath/src/ImathTest/testBitPatterns.h index 62192b98..f8cfbc82 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testBitPatterns.h +++ b/third_party/Imath/src/ImathTest/testBitPatterns.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testBitPatterns(); +void testBitPatterns (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testBox.cpp b/third_party/Imath/src/ImathTest/testBox.cpp similarity index 86% rename from third_party/Imath-3.1.9/src/ImathTest/testBox.cpp rename to third_party/Imath/src/ImathTest/testBox.cpp index d9c1f663..63ca564e 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testBox.cpp +++ b/third_party/Imath/src/ImathTest/testBox.cpp @@ -10,12 +10,12 @@ #include #include +#include "testBoxAlgo.h" #include #include #include #include #include -#include "testBoxAlgo.h" // Include ImathForward *after* other headers to validate forward declarations #include @@ -37,7 +37,7 @@ static void addItem (const std::vector& value, std::vector& perms) { T p; - for (unsigned int i = 0; i < value.size(); i++) + for (unsigned int i = 0; i < value.size (); i++) { p[i] = static_cast(value[i]); } @@ -55,8 +55,7 @@ visit (int& level, int n, int k, std::vector& value, std::vector& perms) addItem (value, perms); else for (int i = 0; i < n; i++) - if (value[i] == 0) - visit (level, n, i, value, perms); + if (value[i] == 0) visit (level, n, i, value, perms); level = level - 1; value[k] = 0; @@ -66,9 +65,9 @@ template static void permutations (std::vector& perms) { - std::vector value (T::dimensions()); - int level = -1; - int n = T::dimensions(); + std::vector value (T::dimensions ()); + int level = -1; + int n = T::dimensions (); visit (level, n, 0, value, perms); } @@ -84,7 +83,9 @@ testConstructors (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); + assert ( + b.min == T (T::baseTypeMax ()) && + b.max == T (T::baseTypeLowest ())); } // @@ -105,7 +106,7 @@ testConstructors (const char* type) { T p0; T p1; - for (unsigned int i = 0; i < T::dimensions(); i++) + for (unsigned int i = 0; i < T::dimensions (); i++) { p0[i] = static_cast(i); p1[i] = static_cast(10 * T::dimensions () - i - 1); @@ -127,8 +128,10 @@ testMakeEmpty (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - b.makeEmpty(); - assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); + b.makeEmpty (); + assert ( + b.min == T (T::baseTypeMax ()) && + b.max == T (T::baseTypeLowest ())); } // @@ -136,8 +139,10 @@ testMakeEmpty (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b (T (-1), T (1)); - b.makeEmpty(); - assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); + b.makeEmpty (); + assert ( + b.min == T (T::baseTypeMax ()) && + b.max == T (T::baseTypeLowest ())); } // @@ -150,11 +155,13 @@ testMakeEmpty (const char* type) { T min (0); T max (0); - max[T::dimensions() - 1] = 1; + max[T::dimensions () - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b (min, max); - b.makeEmpty(); - assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); + b.makeEmpty (); + assert ( + b.min == T (T::baseTypeMax ()) && + b.max == T (T::baseTypeLowest ())); } } @@ -191,8 +198,10 @@ testMakeInfinite (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b (T (-1), T (1)); - b.makeInfinite(); - assert (b.min == T (T::baseTypeLowest()) && b.max == T (T::baseTypeMax())); + b.makeInfinite (); + assert ( + b.min == T (T::baseTypeLowest ()) && + b.max == T (T::baseTypeMax ())); } // @@ -205,11 +214,13 @@ testMakeInfinite (const char* type) { T min (0); T max (0); - max[T::dimensions() - 1] = 1; + max[T::dimensions () - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b (min, max); - b.makeInfinite(); - assert (b.min == T (T::baseTypeLowest()) && b.max == T (T::baseTypeMax())); + b.makeInfinite (); + assert ( + b.min == T (T::baseTypeLowest ()) && + b.max == T (T::baseTypeMax ())); } } @@ -229,7 +240,7 @@ testExtendByPoint (const char* type) for (unsigned int i = 0; i < iters; i++) { T p; - for (unsigned int j = 0; j < T::dimensions(); j++) + for (unsigned int j = 0; j < T::dimensions (); j++) p[j] = typename T::BaseType (rand.nextf (-12345, 12345)); IMATH_INTERNAL_NAMESPACE::Box b; @@ -251,7 +262,7 @@ testExtendByPoint (const char* type) for (unsigned int j = 0; j < i; j++) { T p; - for (unsigned int k = 0; k < T::dimensions(); k++) + for (unsigned int k = 0; k < T::dimensions (); k++) p[k] = typename T::BaseType (rand.nextf (-12345, 12345)); if (j == 0) @@ -259,7 +270,7 @@ testExtendByPoint (const char* type) min = p; max = p; } - for (unsigned int k = 0; k < T::dimensions(); k++) + for (unsigned int k = 0; k < T::dimensions (); k++) { min[k] = std::min (min[k], p[k]); max[k] = std::max (max[k], p[k]); @@ -283,8 +294,10 @@ testExtendByBox (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - b.extendBy (IMATH_INTERNAL_NAMESPACE::Box()); - assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); + b.extendBy (IMATH_INTERNAL_NAMESPACE::Box ()); + assert ( + b.min == T (T::baseTypeMax ()) && + b.max == T (T::baseTypeLowest ())); } // @@ -294,9 +307,9 @@ testExtendByBox (const char* type) std::vector perms; permutations (perms); - for (unsigned int i = 0; i < perms.size(); i++) + for (unsigned int i = 0; i < perms.size (); i++) { - for (unsigned int j = 0; j < perms.size(); j++) + for (unsigned int j = 0; j < perms.size (); j++) { T p0 = -perms[i]; T p1 = perms[j]; @@ -306,7 +319,7 @@ testExtendByBox (const char* type) assert (b0.min == p0 && b0.max == p1); IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); - b1.extendBy (IMATH_INTERNAL_NAMESPACE::Box()); + b1.extendBy (IMATH_INTERNAL_NAMESPACE::Box ()); assert (b1.min == p0 && b1.max == p1); } } @@ -316,7 +329,7 @@ testExtendByBox (const char* type) // Extend non-empty box with non-empty box. Starts with empty, then builds. // IMATH_INTERNAL_NAMESPACE::Rand32 rand (0); - const unsigned int iters = 10; + const unsigned int iters = 10; { IMATH_INTERNAL_NAMESPACE::Box b; @@ -326,7 +339,7 @@ testExtendByBox (const char* type) { T p0; T p1; - for (unsigned int k = 0; k < T::dimensions(); k++) + for (unsigned int k = 0; k < T::dimensions (); k++) { p0[k] = typename T::BaseType (rand.nextf (0, 999)); p1[k] = typename T::BaseType (rand.nextf (1000, 1999)); @@ -334,7 +347,7 @@ testExtendByBox (const char* type) min = b.min; max = b.max; - for (unsigned int k = 0; k < T::dimensions(); k++) + for (unsigned int k = 0; k < T::dimensions (); k++) { min[k] = std::min (min[k], p0[k]); max[k] = std::max (max[k], p1[k]); @@ -372,9 +385,9 @@ testComparators (const char* type) std::vector perms; permutations (perms); - for (unsigned int i = 0; i < perms.size(); i++) + for (unsigned int i = 0; i < perms.size (); i++) { - for (unsigned int j = 0; j < perms.size(); j++) + for (unsigned int j = 0; j < perms.size (); j++) { T p0 = -perms[i]; T p1 = perms[j]; @@ -394,9 +407,9 @@ testComparators (const char* type) std::vector perms; permutations (perms); - for (unsigned int i = 0; i < perms.size(); i++) + for (unsigned int i = 0; i < perms.size (); i++) { - for (unsigned int j = 0; j < perms.size(); j++) + for (unsigned int j = 0; j < perms.size (); j++) { T p0 = -perms[i]; T p1 = perms[j]; @@ -438,7 +451,7 @@ testIntersects (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - T p (1); + T p (1); assert (!b.intersects (p)); } @@ -448,9 +461,9 @@ testIntersects (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b (T (-1), T (1)); - T p0 (0); - T p1 (5); - T p2 (-5); + T p0 (0); + T p1 (5); + T p2 (-5); assert (b.intersects (p0)); assert (!b.intersects (p1)); @@ -466,11 +479,11 @@ testIntersects (const char* type) // { T min (0); - T max = min; - max[T::dimensions() - 1] = 1; + T max = min; + max[T::dimensions () - 1] = 1; - T p0 (0); - T p1 (5); + T p0 (0); + T p1 (5); IMATH_INTERNAL_NAMESPACE::Box b (min, max); assert (b.intersects (p0)); @@ -512,8 +525,8 @@ testIntersects (const char* type) // { T min (0); - T max = min; - max[T::dimensions() - 1] = 1; + T max = min; + max[T::dimensions () - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1 (min, max); @@ -551,8 +564,8 @@ testIntersects (const char* type) IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); T min (0); - T max = min; - max[T::dimensions() - 1] = 1; + T max = min; + max[T::dimensions () - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b1 (min, max); IMATH_INTERNAL_NAMESPACE::Box b2 (min + T (2), max + T (2)); @@ -574,8 +587,8 @@ testIntersects (const char* type) // { T min (0); - T max = min; - max[T::dimensions() - 1] = 1; + T max = min; + max[T::dimensions () - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b0 (min, max); IMATH_INTERNAL_NAMESPACE::Box b1 (min, max + T (2)); @@ -600,7 +613,7 @@ testSize (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - assert (b.size() == T (0)); + assert (b.size () == T (0)); } // @@ -618,15 +631,15 @@ testSize (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); - assert (b0.size() == T (2)); + assert (b0.size () == T (2)); T p; - for (unsigned int i = 0; i < T::dimensions(); i++) + for (unsigned int i = 0; i < T::dimensions (); i++) { p[i] = static_cast(i); } IMATH_INTERNAL_NAMESPACE::Box b1 (-p, p); - assert (b1.size() == p * T (2)); + assert (b1.size () == p * T (2)); } // @@ -638,12 +651,12 @@ testSize (const char* type) // { T min (0); - T max = min; - max[T::dimensions() - 1] = 1; + T max = min; + max[T::dimensions () - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b (min, max); - assert (b.size() == max); + assert (b.size () == max); } } @@ -658,7 +671,7 @@ testCenter (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - assert (b.center() == T (0)); + assert (b.center () == T (0)); } // @@ -676,11 +689,11 @@ testCenter (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); - assert (b0.center() == T (0)); + assert (b0.center () == T (0)); T p0; T p1; - for (unsigned int i = 0; i < T::dimensions(); i++) + for (unsigned int i = 0; i < T::dimensions (); i++) { int lo = 1 << (i + 1); int hi = 1 << (T::dimensions () - i); @@ -688,7 +701,7 @@ testCenter (const char* type) p1[i] = static_cast(hi); } IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); - assert (b1.center() == (p1 + p0) / 2); + assert (b1.center () == (p1 + p0) / 2); } // @@ -700,12 +713,12 @@ testCenter (const char* type) // { T min (0); - T max = min; - max[T::dimensions() - 1] = 2; + T max = min; + max[T::dimensions () - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b (min, max); - assert (b.center() == max / 2); + assert (b.center () == max / 2); } } @@ -720,7 +733,7 @@ testIsEmpty (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - assert (b.isEmpty()); + assert (b.isEmpty ()); } // @@ -731,11 +744,11 @@ testIsEmpty (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); - assert (!b0.isEmpty()); + assert (!b0.isEmpty ()); T p0; T p1; - for (unsigned int i = 0; i < T::dimensions(); i++) + for (unsigned int i = 0; i < T::dimensions (); i++) { int lo = 1 << (i + 1); int hi = 1 << (T::dimensions () - i); @@ -743,7 +756,7 @@ testIsEmpty (const char* type) p1[i] = static_cast(hi); } IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); - assert (!b1.isEmpty()); + assert (!b1.isEmpty ()); } // @@ -755,12 +768,12 @@ testIsEmpty (const char* type) // { T min (0); - T max = min; - max[T::dimensions() - 1] = 2; + T max = min; + max[T::dimensions () - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b (min, max); - assert (!b.isEmpty()); + assert (!b.isEmpty ()); } } @@ -775,8 +788,8 @@ testIsInfinite (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - b.makeInfinite(); - assert (b.isInfinite()); + b.makeInfinite (); + assert (b.isInfinite ()); } // @@ -787,11 +800,11 @@ testIsInfinite (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); - assert (!b0.isInfinite()); + assert (!b0.isInfinite ()); T p0; T p1; - for (unsigned int i = 0; i < T::dimensions(); i++) + for (unsigned int i = 0; i < T::dimensions (); i++) { int lo = 1 << (i + 1); int hi = 1 << (T::dimensions () - i); @@ -799,7 +812,7 @@ testIsInfinite (const char* type) p1[i] = static_cast(hi); } IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); - assert (!b1.isInfinite()); + assert (!b1.isInfinite ()); } // @@ -811,12 +824,12 @@ testIsInfinite (const char* type) // { T min (0); - T max = min; - max[T::dimensions() - 1] = 2; + T max = min; + max[T::dimensions () - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b (min, max); - assert (!b.isInfinite()); + assert (!b.isInfinite ()); } } @@ -831,7 +844,7 @@ testHasVolume (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - assert (!b.hasVolume()); + assert (!b.hasVolume ()); } // @@ -839,8 +852,8 @@ testHasVolume (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - b.makeInfinite(); - assert (b.hasVolume()); + b.makeInfinite (); + assert (b.hasVolume ()); } // @@ -851,11 +864,11 @@ testHasVolume (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); - assert (b0.hasVolume()); + assert (b0.hasVolume ()); T p0; T p1; - for (unsigned int i = 0; i < T::dimensions(); i++) + for (unsigned int i = 0; i < T::dimensions (); i++) { int lo = 1 << (i + 1); int hi = 1 << (T::dimensions () - i); @@ -863,7 +876,7 @@ testHasVolume (const char* type) p1[i] = static_cast(hi); } IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); - assert (b1.hasVolume()); + assert (b1.hasVolume ()); } // @@ -875,12 +888,12 @@ testHasVolume (const char* type) // { T min (0); - T max = min; - max[T::dimensions() - 1] = 2; + T max = min; + max[T::dimensions () - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b (min, max); - assert (!b.hasVolume()); + assert (!b.hasVolume ()); } } @@ -895,7 +908,7 @@ testMajorAxis (const char* type) // { IMATH_INTERNAL_NAMESPACE::Box b; - assert (b.majorAxis() == 0); + assert (b.majorAxis () == 0); } // @@ -906,17 +919,16 @@ testMajorAxis (const char* type) std::vector perms; permutations (perms); - for (unsigned int i = 0; i < perms.size(); i++) + for (unsigned int i = 0; i < perms.size (); i++) { IMATH_INTERNAL_NAMESPACE::Box b (T (0), perms[i]); unsigned int major = 0; - T size = perms[i] - T (0); - for (unsigned int j = 1; j < T::dimensions(); j++) - if (size[j] > size[major]) - major = j; + T size = perms[i] - T (0); + for (unsigned int j = 1; j < T::dimensions (); j++) + if (size[j] > size[major]) major = j; - assert (b.majorAxis() == major); + assert (b.majorAxis () == major); } } @@ -933,15 +945,15 @@ testMajorAxis (const char* type) // and similarly for 4D // { - for (unsigned int i = 0; i < T::dimensions(); i++) + for (unsigned int i = 0; i < T::dimensions (); i++) { - for (unsigned int j = 0; j < T::dimensions(); j++) + for (unsigned int j = 0; j < T::dimensions (); j++) { T max (0); max[j] = 1; IMATH_INTERNAL_NAMESPACE::Box b (T (0), max); - assert (b.majorAxis() == j); + assert (b.majorAxis () == j); } } } @@ -950,7 +962,7 @@ testMajorAxis (const char* type) } // anonymous namespace void -testBox() +testBox () { cout << "Testing box methods" << endl; diff --git a/third_party/Imath-3.1.9/src/ImathTest/testBox.h b/third_party/Imath/src/ImathTest/testBox.h similarity index 85% rename from third_party/Imath-3.1.9/src/ImathTest/testBox.h rename to third_party/Imath/src/ImathTest/testBox.h index eb9352cf..ab5d86be 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testBox.h +++ b/third_party/Imath/src/ImathTest/testBox.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testBox(); +void testBox (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testBoxAlgo.cpp b/third_party/Imath/src/ImathTest/testBoxAlgo.cpp similarity index 77% rename from third_party/Imath-3.1.9/src/ImathTest/testBoxAlgo.cpp rename to third_party/Imath/src/ImathTest/testBoxAlgo.cpp index bdf97274..b11dd7aa 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testBoxAlgo.cpp +++ b/third_party/Imath/src/ImathTest/testBoxAlgo.cpp @@ -7,12 +7,12 @@ # undef NDEBUG #endif +#include "testBoxAlgo.h" #include #include #include #include #include -#include "testBoxAlgo.h" using namespace std; using namespace IMATH_INTERNAL_NAMESPACE; @@ -32,8 +32,7 @@ approximatelyEqual (const V3f& p1, const V3f& p2, float e) } for (int i = 0; i < 3; ++i) - if (!equalWithAbsError (p1[i], p2[i], m * e)) - return false; + if (!equalWithAbsError (p1[i], p2[i], m * e)) return false; return true; } @@ -43,9 +42,9 @@ testEntryAndExitPoints (const Box3f& box) { Rand48 random (2007); - float e = 50 * std::numeric_limits::epsilon(); + float e = 50 * std::numeric_limits::epsilon (); - if (box.isEmpty()) + if (box.isEmpty ()) { cout << " empty box, no rays intersect" << endl; @@ -71,12 +70,20 @@ testEntryAndExitPoints (const Box3f& box) { cout << " single-point box, ray intersects" << endl; - static const float off[6][3] = { { -1, 0, 0 }, { 1, 0, 0 }, { 0, -1, 0 }, - { 0, 1, 0 }, { 0, 0, -1 }, { 0, 0, 1 } }; + static const float off[6][3] = { + {-1, 0, 0}, + {1, 0, 0}, + {0, -1, 0}, + {0, 1, 0}, + {0, 0, -1}, + {0, 0, 1}}; for (int i = 0; i < 6; ++i) { - V3f p1 (box.min.x + off[i][0], box.min.y + off[i][1], box.min.z + off[i][2]); + V3f p1 ( + box.min.x + off[i][0], + box.min.y + off[i][1], + box.min.z + off[i][2]); V3f r, s; assert (findEntryAndExitPoints (Line3f (p1, box.min), box, r, s)); @@ -95,8 +102,8 @@ testEntryAndExitPoints (const Box3f& box) const float r1 = 0.00001f; const float r2 = 1.0f; - V3f p1 = box.min + r2 * hollowSphereRand (random); - V3f p2; + V3f p1 = box.min + r2 * hollowSphereRand (random); + V3f p2; float r3; do @@ -106,13 +113,13 @@ testEntryAndExitPoints (const Box3f& box) p2 = box.min + r2 * hollowSphereRand (random); } while (approximatelyEqual (p1, p2, e)); - V3f d1 = (p2 - p1).normalized(); + V3f d1 = (p2 - p1).normalized (); V3f d2 = (box.min - p1); - r3 = (d2 - d1 * (d1 ^ d2)).length(); + r3 = (d2 - d1 * (d1 ^ d2)).length (); } while (r3 < r1); Line3f ray (p1, p2); - V3f r, s; + V3f r, s; assert (!findEntryAndExitPoints (ray, box, r, s)); } @@ -152,7 +159,7 @@ testEntryAndExitPoints (const Box3f& box) Line3f ray (p1, p2); - V3f r, s; + V3f r, s; bool b = findEntryAndExitPoints (ray, box, r, s); // @@ -162,52 +169,42 @@ testEntryAndExitPoints (const Box3f& box) assert (b); - assert (r.x == box.min.x || r.x == box.max.x || r.y == box.min.y || r.y == box.max.y || - r.z == box.min.z || r.z == box.max.z); + assert ( + r.x == box.min.x || r.x == box.max.x || r.y == box.min.y || + r.y == box.max.y || r.z == box.min.z || r.z == box.max.z); - assert (s.x == box.min.x || s.x == box.max.x || s.y == box.min.y || s.y == box.max.y || - s.z == box.min.z || s.z == box.max.z); + assert ( + s.x == box.min.x || s.x == box.max.x || s.y == box.min.y || + s.y == box.max.y || s.z == box.min.z || s.z == box.max.z); // // Entry and exit points must be consistent // with the direction of the ray // - if (r.x == box.min.x) - assert (ray.dir.x >= 0); + if (r.x == box.min.x) assert (ray.dir.x >= 0); - if (r.x == box.max.x) - assert (ray.dir.x <= 0); + if (r.x == box.max.x) assert (ray.dir.x <= 0); - if (r.y == box.min.y) - assert (ray.dir.y >= 0); + if (r.y == box.min.y) assert (ray.dir.y >= 0); - if (r.y == box.max.y) - assert (ray.dir.y <= 0); + if (r.y == box.max.y) assert (ray.dir.y <= 0); - if (r.z == box.min.z) - assert (ray.dir.z >= 0); + if (r.z == box.min.z) assert (ray.dir.z >= 0); - if (r.z == box.max.z) - assert (ray.dir.z <= 0); + if (r.z == box.max.z) assert (ray.dir.z <= 0); - if (s.x == box.max.x) - assert (ray.dir.x >= 0); + if (s.x == box.max.x) assert (ray.dir.x >= 0); - if (s.x == box.min.x) - assert (ray.dir.x <= 0); + if (s.x == box.min.x) assert (ray.dir.x <= 0); - if (s.y == box.max.y) - assert (ray.dir.y >= 0); + if (s.y == box.max.y) assert (ray.dir.y >= 0); - if (s.y == box.min.y) - assert (ray.dir.y <= 0); + if (s.y == box.min.y) assert (ray.dir.y <= 0); - if (s.z == box.max.z) - assert (ray.dir.z >= 0); + if (s.z == box.max.z) assert (ray.dir.z >= 0); - if (s.z == box.min.z) - assert (ray.dir.z <= 0); + if (s.z == box.min.z) assert (ray.dir.z <= 0); // // Entry and exit points must be approximately on the ray @@ -216,8 +213,8 @@ testEntryAndExitPoints (const Box3f& box) // { - V3f p3 = p1 + ray.dir * (ray.dir ^ (r - p1)); - float m = 0; + V3f p3 = p1 + ray.dir * (ray.dir ^ (r - p1)); + float m = 0; for (int j = 0; j < 3; ++j) { @@ -225,13 +222,13 @@ testEntryAndExitPoints (const Box3f& box) m = max (abs (r[j]), m); } - float err = 30 * m * std::numeric_limits::epsilon(); + float err = 30 * m * std::numeric_limits::epsilon (); assert (p3.equalWithAbsError (r, err)); } { - V3f p3 = p1 + ray.dir * (ray.dir ^ (s - p1)); - float m = 0; + V3f p3 = p1 + ray.dir * (ray.dir ^ (s - p1)); + float m = 0; for (int j = 0; j < 3; ++j) { @@ -239,16 +236,16 @@ testEntryAndExitPoints (const Box3f& box) m = max (abs (s[j]), m); } - float err = 30 * m * std::numeric_limits::epsilon(); + float err = 30 * m * std::numeric_limits::epsilon (); assert (p3.equalWithAbsError (s, err)); } } cout << " ray starts outside box, does not intersect" << endl; - V3f center = (box.min + box.max) * 0.5f; - float r1 = (box.max - box.min).length() * 0.51f; - float r2 = 2 * r1; + V3f center = (box.min + box.max) * 0.5f; + float r1 = (box.max - box.min).length () * 0.51f; + float r2 = 2 * r1; for (int i = 0; i < 100000; ++i) { @@ -260,8 +257,8 @@ testEntryAndExitPoints (const Box3f& box) // of the box.) // - V3f p1 = center + r2 * hollowSphereRand (random); - V3f p2; + V3f p1 = center + r2 * hollowSphereRand (random); + V3f p2; float r3; do @@ -271,47 +268,47 @@ testEntryAndExitPoints (const Box3f& box) p2 = center + r2 * hollowSphereRand (random); } while (approximatelyEqual (p1, p2, e)); - V3f d1 = (p2 - p1).normalized(); + V3f d1 = (p2 - p1).normalized (); V3f d2 = (center - p1); - r3 = (d2 - d1 * (d1 ^ d2)).length(); + r3 = (d2 - d1 * (d1 ^ d2)).length (); } while (r3 < r1); Line3f ray (p1, p2); - V3f r, s; + V3f r, s; assert (!findEntryAndExitPoints (ray, box, r, s)); } } void -entryAndExitPoints1() +entryAndExitPoints1 () { cout << " ray-box entry and exit, random rays" << endl; - Box3f boxes[] = { // Boxes with a positive volume + Box3f boxes[] = { + // Boxes with a positive volume - Box3f (V3f (-1, -1, -1), V3f (1, 1, 1)), - Box3f (V3f (10, 20, 30), V3f (1010, 21, 31)), - Box3f (V3f (10, 20, 30), V3f (11, 1020, 31)), - Box3f (V3f (10, 20, 30), V3f (11, 21, 1030)), - Box3f (V3f (-1e10f, -2e10f, -3e10f), V3f (5e15f, 6e15f, 7e15f)), + Box3f (V3f (-1, -1, -1), V3f (1, 1, 1)), + Box3f (V3f (10, 20, 30), V3f (1010, 21, 31)), + Box3f (V3f (10, 20, 30), V3f (11, 1020, 31)), + Box3f (V3f (10, 20, 30), V3f (11, 21, 1030)), + Box3f (V3f (-1e10f, -2e10f, -3e10f), V3f (5e15f, 6e15f, 7e15f)), - // Non-empty, zero-volume boxes + // Non-empty, zero-volume boxes - Box3f (V3f (1, 1, 1), V3f (2, 1, 1)), - Box3f (V3f (1, 1, 1), V3f (1, 2, 1)), - Box3f (V3f (1, 1, 1), V3f (1, 1, 2)), - Box3f (V3f (1, 1, 1), V3f (1, 2, 3)), - Box3f (V3f (1, 1, 1), V3f (2, 3, 1)), - Box3f (V3f (1, 1, 1), V3f (2, 1, 3)), - Box3f (V3f (-1, -2, 1), V3f (-1, -2, 1)), - Box3f (V3f (1, 1, 1), V3f (1, 1, 1)), - Box3f (V3f (0, 0, 0), V3f (0, 0, 0)), + Box3f (V3f (1, 1, 1), V3f (2, 1, 1)), + Box3f (V3f (1, 1, 1), V3f (1, 2, 1)), + Box3f (V3f (1, 1, 1), V3f (1, 1, 2)), + Box3f (V3f (1, 1, 1), V3f (1, 2, 3)), + Box3f (V3f (1, 1, 1), V3f (2, 3, 1)), + Box3f (V3f (1, 1, 1), V3f (2, 1, 3)), + Box3f (V3f (-1, -2, 1), V3f (-1, -2, 1)), + Box3f (V3f (1, 1, 1), V3f (1, 1, 1)), + Box3f (V3f (0, 0, 0), V3f (0, 0, 0)), - // empty box + // empty box - Box3f() - }; + Box3f ()}; for (size_t i = 0; i < sizeof (boxes) / sizeof (boxes[0]); ++i) testEntryAndExitPoints (boxes[i]); @@ -327,7 +324,7 @@ testPerturbedRayBoxEntryExit (const Box3f& box, const Line3f& ray, bool result) assert (result == findEntryAndExitPoints (ray, box, r, s)); } - Rand48 random (19); + Rand48 random (19); const float e = 1e-25f; for (int i = 0; i < 10000; ++i) @@ -341,15 +338,15 @@ testPerturbedRayBoxEntryExit (const Box3f& box, const Line3f& ray, bool result) } void -entryAndExitPoints2() +entryAndExitPoints2 () { cout << " ray-box entry and exit, nearly axis-parallel rays" << endl; - Box3f box (V3f (-1e15f, -1e15f, -1e15f), V3f (1e15f, 1e15f, 1e15f)); + Box3f box (V3f (-1e15f, -1e15f, -1e15f), V3f (1e15f, 1e15f, 1e15f)); Line3f ray; - V3f r, s; - bool b; + V3f r, s; + bool b; ray = Line3f (V3f (-2e15f, 0, 0), V3f (2e15f, 0, 0)); b = findEntryAndExitPoints (ray, box, r, s); @@ -417,9 +414,9 @@ testRayBoxIntersection (const Box3f& box) { Rand48 random (2007); - float e = 50 * std::numeric_limits::epsilon(); + float e = 50 * std::numeric_limits::epsilon (); - if (box.isEmpty()) + if (box.isEmpty ()) { cout << " empty box, no rays intersect" << endl; @@ -445,12 +442,20 @@ testRayBoxIntersection (const Box3f& box) { cout << " single-point box, ray intersects" << endl; - static const float off[6][3] = { { -1, 0, 0 }, { 1, 0, 0 }, { 0, -1, 0 }, - { 0, 1, 0 }, { 0, 0, -1 }, { 0, 0, 1 } }; + static const float off[6][3] = { + {-1, 0, 0}, + {1, 0, 0}, + {0, -1, 0}, + {0, 1, 0}, + {0, 0, -1}, + {0, 0, 1}}; for (int i = 0; i < 6; ++i) { - V3f p1 (box.min.x + off[i][0], box.min.y + off[i][1], box.min.z + off[i][2]); + V3f p1 ( + box.min.x + off[i][0], + box.min.y + off[i][1], + box.min.z + off[i][2]); V3f ip; assert (intersects (box, Line3f (p1, box.min), ip)); @@ -469,8 +474,8 @@ testRayBoxIntersection (const Box3f& box) const float r1 = 0.00001f; const float r2 = 1.0f; - V3f p1 = box.min + r2 * hollowSphereRand (random); - V3f p2; + V3f p1 = box.min + r2 * hollowSphereRand (random); + V3f p2; float r3; do @@ -480,13 +485,13 @@ testRayBoxIntersection (const Box3f& box) p2 = box.min + r2 * hollowSphereRand (random); } while (approximatelyEqual (p1, p2, e)); - V3f d1 = (p2 - p1).normalized(); + V3f d1 = (p2 - p1).normalized (); V3f d2 = (box.min - p1); - r3 = (d2 - d1 * (d1 ^ d2)).length(); + r3 = (d2 - d1 * (d1 ^ d2)).length (); } while (r3 < r1); Line3f ray (p1, p2); - V3f ip; + V3f ip; assert (!intersects (box, ray, ip)); } @@ -505,7 +510,7 @@ testRayBoxIntersection (const Box3f& box) V3f p2 (p1 + hollowSphereRand (random)); - V3f ip; + V3f ip; bool b = intersects (box, Line3f (p1, p2), ip); assert (b && ip == p1); @@ -543,7 +548,7 @@ testRayBoxIntersection (const Box3f& box) Line3f ray (p1, p2); - V3f ip; + V3f ip; bool b = intersects (box, ray, ip); // @@ -553,8 +558,9 @@ testRayBoxIntersection (const Box3f& box) assert (b); - assert (ip.x == box.min.x || ip.x == box.max.x || ip.y == box.min.y || ip.y == box.max.y || - ip.z == box.min.z || ip.z == box.max.z); + assert ( + ip.x == box.min.x || ip.x == box.max.x || ip.y == box.min.y || + ip.y == box.max.y || ip.z == box.min.z || ip.z == box.max.z); // // Intersection point must be consistent with the origin @@ -585,8 +591,8 @@ testRayBoxIntersection (const Box3f& box) // are from the origin. // - V3f p3 = p1 + ray.dir * (ray.dir ^ (ip - p1)); - float m = 0; + V3f p3 = p1 + ray.dir * (ray.dir ^ (ip - p1)); + float m = 0; for (int j = 0; j < 3; ++j) { @@ -594,7 +600,7 @@ testRayBoxIntersection (const Box3f& box) m = max (abs (ip[j]), m); } - float err = 30 * m * std::numeric_limits::epsilon(); + float err = 30 * m * std::numeric_limits::epsilon (); assert (p3.equalWithAbsError (ip, err)); // @@ -609,9 +615,9 @@ testRayBoxIntersection (const Box3f& box) cout << " ray starts outside box, does not intersect" << endl; - V3f center = (box.min + box.max) * 0.5f; - float r1 = (box.max - box.min).length() * 0.51f; - float r2 = 2 * r1; + V3f center = (box.min + box.max) * 0.5f; + float r1 = (box.max - box.min).length () * 0.51f; + float r2 = 2 * r1; for (int i = 0; i < 100000; ++i) { @@ -623,8 +629,8 @@ testRayBoxIntersection (const Box3f& box) // of the box.) // - V3f p1 = center + r2 * hollowSphereRand (random); - V3f p2; + V3f p1 = center + r2 * hollowSphereRand (random); + V3f p2; float r3; do @@ -634,47 +640,47 @@ testRayBoxIntersection (const Box3f& box) p2 = center + r2 * hollowSphereRand (random); } while (approximatelyEqual (p1, p2, e)); - V3f d1 = (p2 - p1).normalized(); + V3f d1 = (p2 - p1).normalized (); V3f d2 = (center - p1); - r3 = (d2 - d1 * (d1 ^ d2)).length(); + r3 = (d2 - d1 * (d1 ^ d2)).length (); } while (r3 < r1); Line3f ray (p1, p2); - V3f ip; + V3f ip; assert (!intersects (box, ray, ip)); } } void -rayBoxIntersection1() +rayBoxIntersection1 () { cout << " ray-box intersection, random rays" << endl; - Box3f boxes[] = { // Boxes with a positive volume + Box3f boxes[] = { + // Boxes with a positive volume - Box3f (V3f (-1, -1, -1), V3f (1, 1, 1)), - Box3f (V3f (10, 20, 30), V3f (1010, 21, 31)), - Box3f (V3f (10, 20, 30), V3f (11, 1020, 31)), - Box3f (V3f (10, 20, 30), V3f (11, 21, 1030)), - Box3f (V3f (-1e10f, -2e10f, -3e10f), V3f (5e15f, 6e15f, 7e15f)), + Box3f (V3f (-1, -1, -1), V3f (1, 1, 1)), + Box3f (V3f (10, 20, 30), V3f (1010, 21, 31)), + Box3f (V3f (10, 20, 30), V3f (11, 1020, 31)), + Box3f (V3f (10, 20, 30), V3f (11, 21, 1030)), + Box3f (V3f (-1e10f, -2e10f, -3e10f), V3f (5e15f, 6e15f, 7e15f)), - // Non-empty, zero-volume boxes + // Non-empty, zero-volume boxes - Box3f (V3f (1, 1, 1), V3f (2, 1, 1)), - Box3f (V3f (1, 1, 1), V3f (1, 2, 1)), - Box3f (V3f (1, 1, 1), V3f (1, 1, 2)), - Box3f (V3f (1, 1, 1), V3f (1, 2, 3)), - Box3f (V3f (1, 1, 1), V3f (2, 3, 1)), - Box3f (V3f (1, 1, 1), V3f (2, 1, 3)), - Box3f (V3f (-1, -2, 1), V3f (-1, -2, 1)), - Box3f (V3f (1, 1, 1), V3f (1, 1, 1)), - Box3f (V3f (0, 0, 0), V3f (0, 0, 0)), + Box3f (V3f (1, 1, 1), V3f (2, 1, 1)), + Box3f (V3f (1, 1, 1), V3f (1, 2, 1)), + Box3f (V3f (1, 1, 1), V3f (1, 1, 2)), + Box3f (V3f (1, 1, 1), V3f (1, 2, 3)), + Box3f (V3f (1, 1, 1), V3f (2, 3, 1)), + Box3f (V3f (1, 1, 1), V3f (2, 1, 3)), + Box3f (V3f (-1, -2, 1), V3f (-1, -2, 1)), + Box3f (V3f (1, 1, 1), V3f (1, 1, 1)), + Box3f (V3f (0, 0, 0), V3f (0, 0, 0)), - // empty box + // empty box - Box3f() - }; + Box3f ()}; for (size_t i = 0; i < sizeof (boxes) / sizeof (boxes[0]); ++i) testRayBoxIntersection (boxes[i]); @@ -690,7 +696,7 @@ testPerturbedRayBox (const Box3f& box, const Line3f& ray, bool result) assert (result == intersects (box, ray, ip)); } - Rand48 random (19); + Rand48 random (19); const float e = 1e-25f; for (int i = 0; i < 10000; ++i) @@ -704,15 +710,15 @@ testPerturbedRayBox (const Box3f& box, const Line3f& ray, bool result) } void -rayBoxIntersection2() +rayBoxIntersection2 () { cout << " ray-box intersection, nearly axis-parallel rays" << endl; - Box3f box (V3f (-1e15f, -1e15f, -1e15f), V3f (1e15f, 1e15f, 1e15f)); + Box3f box (V3f (-1e15f, -1e15f, -1e15f), V3f (1e15f, 1e15f, 1e15f)); Line3f ray; - V3f ip; - bool b; + V3f ip; + bool b; ray = Line3f (V3f (-2e15f, 0, 0), V3f (2e15f, 0, 0)); b = intersects (box, ray, ip); @@ -794,11 +800,11 @@ transformSimple (const Box3f& b, const M44f& M) } void -boxMatrixTransform() +boxMatrixTransform () { cout << " transform box by matrix" << endl; - const float e = 5 * std::numeric_limits::epsilon(); + const float e = 5 * std::numeric_limits::epsilon (); Box3f b1 (V3f (4, 5, 6), V3f (7, 8, 9)); @@ -853,7 +859,7 @@ boxMatrixTransform() } void -pointInAndOnBox() +pointInAndOnBox () { cout << " closest points in and on box" << endl; @@ -914,16 +920,16 @@ pointInAndOnBox() } // namespace void -testBoxAlgo() +testBoxAlgo () { cout << "Testing box algorithms" << endl; - entryAndExitPoints1(); - entryAndExitPoints2(); - rayBoxIntersection1(); - rayBoxIntersection2(); - boxMatrixTransform(); - pointInAndOnBox(); + entryAndExitPoints1 (); + entryAndExitPoints2 (); + rayBoxIntersection1 (); + rayBoxIntersection2 (); + boxMatrixTransform (); + pointInAndOnBox (); cout << "ok\n" << endl; } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testBoxAlgo.h b/third_party/Imath/src/ImathTest/testBoxAlgo.h similarity index 82% rename from third_party/Imath-3.1.9/src/ImathTest/testBoxAlgo.h rename to third_party/Imath/src/ImathTest/testBoxAlgo.h index d6774def..e7acc0df 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testBoxAlgo.h +++ b/third_party/Imath/src/ImathTest/testBoxAlgo.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testBoxAlgo(); +void testBoxAlgo (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testClassification.cpp b/third_party/Imath/src/ImathTest/testClassification.cpp similarity index 60% rename from third_party/Imath-3.1.9/src/ImathTest/testClassification.cpp rename to third_party/Imath/src/ImathTest/testClassification.cpp index 69484b51..d87d6914 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testClassification.cpp +++ b/third_party/Imath/src/ImathTest/testClassification.cpp @@ -7,11 +7,11 @@ # undef NDEBUG #endif -#include +#include "testClassification.h" #include +#include #include #include -#include "testClassification.h" using namespace std; @@ -19,19 +19,21 @@ namespace { #if __cplusplus >= 201402L -static_assert (std::is_trivially_default_constructible::value, - "half is trivial and default constructible"); +static_assert ( + std::is_trivially_default_constructible::value, + "half is trivial and default constructible"); #endif void -testClass (half h, - bool finite, - bool normalized, - bool denormalized, - bool zero, - bool nan, - bool infinity, - bool negative) +testClass ( + half h, + bool finite, + bool normalized, + bool denormalized, + bool zero, + bool nan, + bool infinity, + bool negative) { cout.width (15); cout.precision (8); @@ -40,40 +42,33 @@ testClass (half h, printBits (cout, h); cout << " "; - if (h.isFinite()) - cout << "finite "; + if (h.isFinite ()) cout << "finite "; - if (h.isNormalized()) - cout << "normalized "; + if (h.isNormalized ()) cout << "normalized "; - if (h.isDenormalized()) - cout << "denormalized "; + if (h.isDenormalized ()) cout << "denormalized "; - if (h.isZero()) - cout << "zero "; + if (h.isZero ()) cout << "zero "; - if (h.isNan()) - cout << "nan "; + if (h.isNan ()) cout << "nan "; - if (h.isInfinity()) - cout << "infinity "; + if (h.isInfinity ()) cout << "infinity "; - if (h.isNegative()) - cout << "negative "; + if (h.isNegative ()) cout << "negative "; cout << endl; - assert (h.isFinite() == finite); - assert (h.isNormalized() == normalized); - assert (h.isDenormalized() == denormalized); - assert (h.isZero() == zero); - assert (h.isNan() == nan); - assert (h.isInfinity() == infinity); - assert (h.isNegative() == negative); + assert (h.isFinite () == finite); + assert (h.isNormalized () == normalized); + assert (h.isDenormalized () == denormalized); + assert (h.isZero () == zero); + assert (h.isNan () == nan); + assert (h.isInfinity () == infinity); + assert (h.isNegative () == negative); } float -floatPosInfinity() +floatPosInfinity () { half::uif x; x.i = 0x7f800000; @@ -81,7 +76,7 @@ floatPosInfinity() } float -floatNegInfinity() +floatNegInfinity () { half::uif x; x.i = 0xff800000; @@ -89,7 +84,7 @@ floatNegInfinity() } float -floatPosQNan1() +floatPosQNan1 () { half::uif x; x.i = 0x7fffffff; @@ -97,7 +92,7 @@ floatPosQNan1() } float -floatNegQNan1() +floatNegQNan1 () { half::uif x; x.i = 0xffffffff; @@ -105,7 +100,7 @@ floatNegQNan1() } float -floatPosQNan2() +floatPosQNan2 () { half::uif x; x.i = 0x7fd55555; @@ -113,7 +108,7 @@ floatPosQNan2() } float -floatNegQNan2() +floatNegQNan2 () { half::uif x; x.i = 0xffd55555; @@ -123,7 +118,7 @@ floatNegQNan2() } // namespace void -testClassification() +testClassification () { cout << "classification of bit patterns\n\n"; @@ -146,9 +141,9 @@ testClassification() testClass (0.2f, 1, 1, 0, 0, 0, 0, 0); testClass (0.3f, 1, 1, 0, 0, 0, 0, 0); testClass (HALF_MAX, 1, 1, 0, 0, 0, 0, 0); - testClass (floatPosInfinity(), 0, 0, 0, 0, 0, 1, 0); - testClass (floatPosQNan1(), 0, 0, 0, 0, 1, 0, 0); - testClass (floatPosQNan2(), 0, 0, 0, 0, 1, 0, 0); + testClass (floatPosInfinity (), 0, 0, 0, 0, 0, 1, 0); + testClass (floatPosQNan1 (), 0, 0, 0, 0, 1, 0, 0); + testClass (floatPosQNan2 (), 0, 0, 0, 0, 1, 0, 0); testClass (-1.0f, 1, 1, 0, 0, 0, 0, 1); testClass (-1.0f - HALF_EPSILON, 1, 1, 0, 0, 0, 0, 1); @@ -163,16 +158,16 @@ testClassification() testClass (-0.2f, 1, 1, 0, 0, 0, 0, 1); testClass (-0.3f, 1, 1, 0, 0, 0, 0, 1); testClass (-HALF_MAX, 1, 1, 0, 0, 0, 0, 1); - testClass (floatNegInfinity(), 0, 0, 0, 0, 0, 1, 1); - testClass (floatNegQNan1(), 0, 0, 0, 0, 1, 0, 1); - testClass (floatNegQNan2(), 0, 0, 0, 0, 1, 0, 1); + testClass (floatNegInfinity (), 0, 0, 0, 0, 0, 1, 1); + testClass (floatNegQNan1 (), 0, 0, 0, 0, 1, 0, 1); + testClass (floatNegQNan2 (), 0, 0, 0, 0, 1, 0, 1); cout << "\n"; - testClass (half::posInf(), 0, 0, 0, 0, 0, 1, 0); - testClass (half::negInf(), 0, 0, 0, 0, 0, 1, 1); - testClass (half::qNan(), 0, 0, 0, 0, 1, 0, 0); - testClass (half::sNan(), 0, 0, 0, 0, 1, 0, 0); + testClass (half::posInf (), 0, 0, 0, 0, 0, 1, 0); + testClass (half::negInf (), 0, 0, 0, 0, 0, 1, 1); + testClass (half::qNan (), 0, 0, 0, 0, 1, 0, 0); + testClass (half::sNan (), 0, 0, 0, 0, 1, 0, 0); cout << "ok\n\n" << flush; } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testClassification.h b/third_party/Imath/src/ImathTest/testClassification.h similarity index 77% rename from third_party/Imath-3.1.9/src/ImathTest/testClassification.h rename to third_party/Imath/src/ImathTest/testClassification.h index 8aa32901..8ece4bba 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testClassification.h +++ b/third_party/Imath/src/ImathTest/testClassification.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testClassification(); +void testClassification (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testColor.cpp b/third_party/Imath/src/ImathTest/testColor.cpp similarity index 60% rename from third_party/Imath-3.1.9/src/ImathTest/testColor.cpp rename to third_party/Imath/src/ImathTest/testColor.cpp index df86dad5..230dcc78 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testColor.cpp +++ b/third_party/Imath/src/ImathTest/testColor.cpp @@ -7,13 +7,13 @@ # undef NDEBUG #endif +#include "testColor.h" #include #include #include #include #include #include -#include "testColor.h" // Include ImathForward *after* other headers to validate forward declarations #include @@ -21,17 +21,17 @@ using namespace std; void -testColor() +testColor () { cout << "Testing functions in ImathColor.h & ImathColorAlgo.h" << endl; cout << "rgb2packed -> packed2rgb" << endl; - const float epsilon = std::numeric_limits::epsilon(); + const float epsilon = std::numeric_limits::epsilon (); IMATH_INTERNAL_NAMESPACE::PackedColor packed; - IMATH_INTERNAL_NAMESPACE::C3c in3 (52, 128, 254); - IMATH_INTERNAL_NAMESPACE::C3c out3; + IMATH_INTERNAL_NAMESPACE::C3c in3 (52, 128, 254); + IMATH_INTERNAL_NAMESPACE::C3c out3; packed = IMATH_INTERNAL_NAMESPACE::rgb2packed (in3); IMATH_INTERNAL_NAMESPACE::packed2rgb (packed, out3); @@ -42,7 +42,8 @@ testColor() IMATH_INTERNAL_NAMESPACE::C4c testConstructor1i (0); IMATH_INTERNAL_NAMESPACE::C4c testConstructor2 (testConstructor1i); - testConstructor1 = testConstructor2; // use these so the compiler doesn't emit a warning + testConstructor1 = + testConstructor2; // use these so the compiler doesn't emit a warning IMATH_INTERNAL_NAMESPACE::C4c testConstructor3 (52, 128, 254, 127); IMATH_INTERNAL_NAMESPACE::C4c A (testConstructor3); @@ -56,19 +57,25 @@ testColor() cout << "Imath::Color4 * f" << endl; - assert ((IMATH_INTERNAL_NAMESPACE::C4f (0.330f, 0.710f, 0.010f, 0.999f) * 0.999f) == - IMATH_INTERNAL_NAMESPACE::C4f (0.330f * 0.999f, - 0.710f * 0.999f, - 0.010f * 0.999f, - 0.999f * 0.999f)); + assert ( + (IMATH_INTERNAL_NAMESPACE::C4f (0.330f, 0.710f, 0.010f, 0.999f) * + 0.999f) == + IMATH_INTERNAL_NAMESPACE::C4f ( + 0.330f * 0.999f, + 0.710f * 0.999f, + 0.010f * 0.999f, + 0.999f * 0.999f)); cout << "Imath::Color4 / f" << endl; - assert ((IMATH_INTERNAL_NAMESPACE::C4f (0.330f, 0.710f, 0.010f, 0.999f) / 0.999f) == - IMATH_INTERNAL_NAMESPACE::C4f (0.330f / 0.999f, - 0.710f / 0.999f, - 0.010f / 0.999f, - 0.999f / 0.999f)); + assert ( + (IMATH_INTERNAL_NAMESPACE::C4f (0.330f, 0.710f, 0.010f, 0.999f) / + 0.999f) == + IMATH_INTERNAL_NAMESPACE::C4f ( + 0.330f / 0.999f, + 0.710f / 0.999f, + 0.010f / 0.999f, + 0.999f / 0.999f)); cout << "Assignment and comparison" << endl; @@ -80,77 +87,86 @@ testColor() X *= 0.001f; - assert (std::fabs ((Y.r * 0.001f) - X.r) <= epsilon && - std::fabs ((Y.g * 0.001f) - X.g) <= epsilon && - std::fabs ((Y.b * 0.001f) - X.b) <= epsilon && - std::fabs ((Y.a * 0.001f) - X.a) <= epsilon); + assert ( + std::fabs ((Y.r * 0.001f) - X.r) <= epsilon && + std::fabs ((Y.g * 0.001f) - X.g) <= epsilon && + std::fabs ((Y.b * 0.001f) - X.b) <= epsilon && + std::fabs ((Y.a * 0.001f) - X.a) <= epsilon); X = Y = IMATH_INTERNAL_NAMESPACE::C4f (0.123f, -0.420f, 0.501f, 0.998f); X /= -1.001f; - assert (std::fabs ((Y.r / -1.001f) - X.r) <= epsilon && - std::fabs ((Y.g / -1.001f) - X.g) <= epsilon && - std::fabs ((Y.b / -1.001f) - X.b) <= epsilon && - std::fabs ((Y.a / -1.001f) - X.a) <= epsilon); + assert ( + std::fabs ((Y.r / -1.001f) - X.r) <= epsilon && + std::fabs ((Y.g / -1.001f) - X.g) <= epsilon && + std::fabs ((Y.b / -1.001f) - X.b) <= epsilon && + std::fabs ((Y.a / -1.001f) - X.a) <= epsilon); Y = IMATH_INTERNAL_NAMESPACE::C4f (0.998f, -0.001f, 0.501f, 1.001f); X = IMATH_INTERNAL_NAMESPACE::C4f (0.011f, -0.420f, -0.501f, 0.998f); tmp = X + Y; - assert (std::fabs ((X.r + Y.r) - tmp.r) <= epsilon && - std::fabs ((X.g + Y.g) - tmp.g) <= epsilon && - std::fabs ((X.b + Y.b) - tmp.b) <= epsilon && - std::fabs ((X.a + Y.a) - tmp.a) <= epsilon); + assert ( + std::fabs ((X.r + Y.r) - tmp.r) <= epsilon && + std::fabs ((X.g + Y.g) - tmp.g) <= epsilon && + std::fabs ((X.b + Y.b) - tmp.b) <= epsilon && + std::fabs ((X.a + Y.a) - tmp.a) <= epsilon); tmp = X - Y; - assert (std::fabs ((X.r - Y.r) - tmp.r) <= epsilon && - std::fabs ((X.g - Y.g) - tmp.g) <= epsilon && - std::fabs ((X.b - Y.b) - tmp.b) <= epsilon && - std::fabs ((X.a - Y.a) - tmp.a) <= epsilon); + assert ( + std::fabs ((X.r - Y.r) - tmp.r) <= epsilon && + std::fabs ((X.g - Y.g) - tmp.g) <= epsilon && + std::fabs ((X.b - Y.b) - tmp.b) <= epsilon && + std::fabs ((X.a - Y.a) - tmp.a) <= epsilon); tmp = X * Y; - assert (std::fabs ((X.r * Y.r) - tmp.r) <= epsilon && - std::fabs ((X.g * Y.g) - tmp.g) <= epsilon && - std::fabs ((X.b * Y.b) - tmp.b) <= epsilon && - std::fabs ((X.a * Y.a) - tmp.a) <= epsilon); + assert ( + std::fabs ((X.r * Y.r) - tmp.r) <= epsilon && + std::fabs ((X.g * Y.g) - tmp.g) <= epsilon && + std::fabs ((X.b * Y.b) - tmp.b) <= epsilon && + std::fabs ((X.a * Y.a) - tmp.a) <= epsilon); tmp = X / Y; // // epsilon doesn't work here. // - assert (std::fabs ((X.r / Y.r) - tmp.r) <= 1e-5f && - std::fabs ((X.g / Y.g) - tmp.g) <= 1e-5f && - std::fabs ((X.b / Y.b) - tmp.b) <= 1e-5f && - std::fabs ((X.a / Y.a) - tmp.a) <= 1e-5f); + assert ( + std::fabs ((X.r / Y.r) - tmp.r) <= 1e-5f && + std::fabs ((X.g / Y.g) - tmp.g) <= 1e-5f && + std::fabs ((X.b / Y.b) - tmp.b) <= 1e-5f && + std::fabs ((X.a / Y.a) - tmp.a) <= 1e-5f); tmp = X; tmp += Y; - assert (std::fabs ((X.r + Y.r) - tmp.r) <= epsilon && - std::fabs ((X.g + Y.g) - tmp.g) <= epsilon && - std::fabs ((X.b + Y.b) - tmp.b) <= epsilon && - std::fabs ((X.a + Y.a) - tmp.a) <= epsilon); + assert ( + std::fabs ((X.r + Y.r) - tmp.r) <= epsilon && + std::fabs ((X.g + Y.g) - tmp.g) <= epsilon && + std::fabs ((X.b + Y.b) - tmp.b) <= epsilon && + std::fabs ((X.a + Y.a) - tmp.a) <= epsilon); tmp = X; tmp -= Y; - assert (std::fabs ((X.r - Y.r) - tmp.r) <= epsilon && - std::fabs ((X.g - Y.g) - tmp.g) <= epsilon && - std::fabs ((X.b - Y.b) - tmp.b) <= epsilon && - std::fabs ((X.a - Y.a) - tmp.a) <= epsilon); + assert ( + std::fabs ((X.r - Y.r) - tmp.r) <= epsilon && + std::fabs ((X.g - Y.g) - tmp.g) <= epsilon && + std::fabs ((X.b - Y.b) - tmp.b) <= epsilon && + std::fabs ((X.a - Y.a) - tmp.a) <= epsilon); tmp = X; tmp *= Y; - assert (std::fabs ((X.r * Y.r) - tmp.r) <= epsilon && - std::fabs ((X.g * Y.g) - tmp.g) <= epsilon && - std::fabs ((X.b * Y.b) - tmp.b) <= epsilon && - std::fabs ((X.a * Y.a) - tmp.a) <= epsilon); + assert ( + std::fabs ((X.r * Y.r) - tmp.r) <= epsilon && + std::fabs ((X.g * Y.g) - tmp.g) <= epsilon && + std::fabs ((X.b * Y.b) - tmp.b) <= epsilon && + std::fabs ((X.a * Y.a) - tmp.a) <= epsilon); tmp = X; tmp /= Y; @@ -158,10 +174,11 @@ testColor() // // epsilon doesn't work here. // - assert (std::fabs ((X.r / Y.r) - tmp.r) <= 1e-5f && - std::fabs ((X.g / Y.g) - tmp.g) <= 1e-5f && - std::fabs ((X.b / Y.b) - tmp.b) <= 1e-5f && - std::fabs ((X.a / Y.a) - tmp.a) <= 1e-5f); + assert ( + std::fabs ((X.r / Y.r) - tmp.r) <= 1e-5f && + std::fabs ((X.g / Y.g) - tmp.g) <= 1e-5f && + std::fabs ((X.b / Y.b) - tmp.b) <= 1e-5f && + std::fabs ((X.a / Y.a) - tmp.a) <= 1e-5f); cout << "rgb2hsv and hsv2rgb" << endl; diff --git a/third_party/Imath-3.1.9/src/ImathTest/testColor.h b/third_party/Imath/src/ImathTest/testColor.h similarity index 83% rename from third_party/Imath-3.1.9/src/ImathTest/testColor.h rename to third_party/Imath/src/ImathTest/testColor.h index 23a0d0de..d61fde37 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testColor.h +++ b/third_party/Imath/src/ImathTest/testColor.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testColor(); +void testColor (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testError.cpp b/third_party/Imath/src/ImathTest/testError.cpp similarity index 74% rename from third_party/Imath-3.1.9/src/ImathTest/testError.cpp rename to third_party/Imath/src/ImathTest/testError.cpp index 33e599c8..f1a806e6 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testError.cpp +++ b/third_party/Imath/src/ImathTest/testError.cpp @@ -7,12 +7,12 @@ # undef NDEBUG #endif +#include "testError.h" #include "half.h" #include #include #include #include -#include "testError.h" using namespace std; @@ -20,18 +20,18 @@ namespace { float -drand() +drand () { - static std::default_random_engine generator; + static std::default_random_engine generator; static std::uniform_real_distribution distribution (0.0f, 1.0f); - float r = distribution (generator); + float r = distribution (generator); return r; } } // namespace void -testNormalizedConversionError() +testNormalizedConversionError () { cout << "float-to-half conversion error for normalized half numbers\n"; @@ -39,29 +39,26 @@ testNormalizedConversionError() for (int i = 0; i < 20000000; i++) { - float f (drand() * HALF_MAX); + float f (drand () * HALF_MAX); - if (f < HALF_NRM_MIN) - continue; + if (f < HALF_NRM_MIN) continue; - if (i & 1) - f = -f; + if (i & 1) f = -f; - half h (f); + half h (f); float e = 1.0f - h / f; - if (e < 0) - e = -e; + if (e < 0) e = -e; if (e > HALF_EPSILON * 0.5) { - cout << "float = " << f << ", half = " << h << ", error = " << e << endl; + cout << "float = " << f << ", half = " << h << ", error = " << e + << endl; assert (false); } - if (e > eMax) - eMax = e; + if (e > eMax) eMax = e; } cout << "max error = " << eMax << endl; @@ -70,7 +67,7 @@ testNormalizedConversionError() } void -testDenormalizedConversionError() +testDenormalizedConversionError () { cout << "float-to-half conversion error for denormalized half numbers\n"; @@ -78,26 +75,24 @@ testDenormalizedConversionError() for (int i = 0; i < 20000000; i++) { - float f (drand() * (HALF_NRM_MIN - HALF_DENORM_MIN)); + float f (drand () * (HALF_NRM_MIN - HALF_DENORM_MIN)); - if (i & 1) - f = -f; + if (i & 1) f = -f; - half h (f); + half h (f); float e = h - f; - if (e < 0) - e = -e; + if (e < 0) e = -e; if (e > HALF_DENORM_MIN * 0.5) { - cout << "float = " << f << ", half = " << h << ", error = " << e << endl; + cout << "float = " << f << ", half = " << h << ", error = " << e + << endl; assert (false); } - if (e > eMax) - eMax = e; + if (e > eMax) eMax = e; } cout << "max error = " << eMax << endl; @@ -118,19 +113,16 @@ testNormalizedRounding (int n) for (int i = 0; i < 200000; i++) { - half h (drand() * HALF_MAX); + half h (drand () * HALF_MAX); - if (h < HALF_NRM_MIN) - continue; + if (h < HALF_NRM_MIN) continue; - if (i & 1) - h = -h; + if (i & 1) h = -h; - half r (h.round (n)); + half r (h.round (n)); float e = 1.0f - r / h; - if (e < 0) - e = -e; + if (e < 0) e = -e; if (e > eExpected) { @@ -145,8 +137,7 @@ testNormalizedRounding (int n) assert (false); } - if (e > eMax) - eMax = e; + if (e > eMax) eMax = e; } cout << "max error = " << eMax << endl; @@ -164,16 +155,14 @@ testDenormalizedRounding (int n) for (int i = 0; i < 200000; i++) { - half h (drand() * (HALF_NRM_MIN - HALF_DENORM_MIN)); + half h (drand () * (HALF_NRM_MIN - HALF_DENORM_MIN)); - if (i & 1) - h = -h; + if (i & 1) h = -h; - half r (h.round (n)); + half r (h.round (n)); float e = r - h; - if (e < 0) - e = -e; + if (e < 0) e = -e; if (e > eExpected) { @@ -188,8 +177,7 @@ testDenormalizedRounding (int n) assert (false); } - if (e > eMax) - eMax = e; + if (e > eMax) eMax = e; } cout << "max error = " << eMax << endl; @@ -200,7 +188,7 @@ testDenormalizedRounding (int n) } // namespace void -testRoundingError() +testRoundingError () { testNormalizedRounding (10); testDenormalizedRounding (10); diff --git a/third_party/Imath/src/ImathTest/testError.h b/third_party/Imath/src/ImathTest/testError.h new file mode 100644 index 00000000..a4912f0c --- /dev/null +++ b/third_party/Imath/src/ImathTest/testError.h @@ -0,0 +1,8 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +void testNormalizedConversionError (); +void testDenormalizedConversionError (); +void testRoundingError (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testExtractEuler.cpp b/third_party/Imath/src/ImathTest/testExtractEuler.cpp similarity index 89% rename from third_party/Imath-3.1.9/src/ImathTest/testExtractEuler.cpp rename to third_party/Imath/src/ImathTest/testExtractEuler.cpp index 506c3d12..b77e9b54 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testExtractEuler.cpp +++ b/third_party/Imath/src/ImathTest/testExtractEuler.cpp @@ -7,13 +7,13 @@ # undef NDEBUG #endif +#include "testExtractEuler.h" #include #include #include #include #include #include -#include "testExtractEuler.h" using namespace std; using namespace IMATH_INTERNAL_NAMESPACE; @@ -37,7 +37,7 @@ matrixEulerMatrix_1 (const M44f& M, Eulerf::Order order) else extractEulerZYX (M, f); - return Eulerf (f, order).toMatrix44(); + return Eulerf (f, order).toMatrix44 (); } M44f @@ -45,13 +45,14 @@ matrixEulerMatrix_2 (const M44f& M, Eulerf::Order order) { Eulerf f (order); f.extract (M); - return f.toMatrix44(); + return f.toMatrix44 (); } void -testMatrix (const M44f M, - M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), - Eulerf::Order order) +testMatrix ( + const M44f M, + M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), + Eulerf::Order order) { // // Extract Euler angles from M, and convert the @@ -90,7 +91,8 @@ testMatrix (const M44f M, } void -testRandomAngles (M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), Eulerf::Order order) +testRandomAngles ( + M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), Eulerf::Order order) { Rand48 r (0); @@ -106,7 +108,7 @@ testRandomAngles (M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), Eulerf rad (float(r.nextf (-180, 180))), Eulerf::XYZ); - M44f M (e.toMatrix44()); + M44f M (e.toMatrix44 ()); // // Add a small random error to the elements of M @@ -127,11 +129,14 @@ testRandomAngles (M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), Eulerf } void -testAngles (V3f angles, M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), Eulerf::Order order) +testAngles ( + V3f angles, + M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), + Eulerf::Order order) { Eulerf e (rad (angles.x), rad (angles.y), rad (angles.z), order); - M44f M (e.toMatrix44()); + M44f M (e.toMatrix44 ()); // // With rounding errors from e.toMatrix. @@ -157,7 +162,8 @@ testAngles (V3f angles, M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), } void -test (M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), Eulerf::Order order) +test ( + M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), Eulerf::Order order) { cout << "order = " << setbase (16) << int (order) << setbase (10) << endl; @@ -174,7 +180,7 @@ test (M44f (*matrixEulerMatrix) (const M44f&, Eulerf::Order), Eulerf::Order orde } void -testRandomAngles33() +testRandomAngles33 () { Rand48 r (0); @@ -197,10 +203,10 @@ testRandomAngles33() } // namespace void -testExtractEuler() +testExtractEuler () { cout << "Testing extraction of rotation angle from 3x3 matrices" << endl; - testRandomAngles33(); + testRandomAngles33 (); cout << "Testing extraction of Euler angles from matrices" << endl; diff --git a/third_party/Imath-3.1.9/src/ImathTest/testExtractEuler.h b/third_party/Imath/src/ImathTest/testExtractEuler.h similarity index 79% rename from third_party/Imath-3.1.9/src/ImathTest/testExtractEuler.h rename to third_party/Imath/src/ImathTest/testExtractEuler.h index cb8840db..030dbcf1 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testExtractEuler.h +++ b/third_party/Imath/src/ImathTest/testExtractEuler.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testExtractEuler(); +void testExtractEuler (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testExtractSHRT.cpp b/third_party/Imath/src/ImathTest/testExtractSHRT.cpp similarity index 91% rename from third_party/Imath-3.1.9/src/ImathTest/testExtractSHRT.cpp rename to third_party/Imath/src/ImathTest/testExtractSHRT.cpp index af4c3e0a..471119b8 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testExtractSHRT.cpp +++ b/third_party/Imath/src/ImathTest/testExtractSHRT.cpp @@ -7,6 +7,7 @@ # undef NDEBUG #endif +#include "testExtractSHRT.h" #include #include #include @@ -15,7 +16,6 @@ #include #include #include -#include "testExtractSHRT.h" #if 0 # define debug(x) (printf x, fflush (stdout)) @@ -43,7 +43,7 @@ testMatrix (const M33f M) // angle back to a matrix, N. // - V2f s (0.f), t (0.f); + V2f s (0.f), t (0.f); float h, r = 0.f; if (!extractSHRT (M, s, h, r, t, true)) @@ -54,10 +54,10 @@ testMatrix (const M33f M) M33f N; - N *= M33f().setScale (s); - N *= M33f().setShear (h); - N *= M33f().setRotation (r); - N *= M33f().setTranslation (t); + N *= M33f ().setScale (s); + N *= M33f ().setShear (h); + N *= M33f ().setRotation (r); + N *= M33f ().setTranslation (t); debug (("Re-scale: %f %f\n", s[0], s[1])); debug (("Re-shear: %f\n", h)); @@ -94,7 +94,7 @@ testMatrix (const M33f M) } void -testRandomAngles33() +testRandomAngles33 () { Rand48 random (0); @@ -112,10 +112,9 @@ testRandomAngles33() float(random.nextf (0.000001, 2.0))); for (int j = 0; j < 2; j++) - if (random.nextf (0.0, 1.0) >= 0.5) - s[j] *= -1; + if (random.nextf (0.0, 1.0) >= 0.5) s[j] *= -1; - M *= M33f().setScale (s); + M *= M33f ().setScale (s); // // Shear M. @@ -124,7 +123,7 @@ testRandomAngles33() float h = float(random.nextf (0.000001, 2.)); if (random.nextf (0.0, 1.0) >= 0.5) h *= -1; - M *= M33f().setShear (h); + M *= M33f ().setShear (h); // // Rotate M. @@ -132,7 +131,7 @@ testRandomAngles33() float r = rad (float(random.nextf (-180, 180))); - M *= M33f().setRotation (r); + M *= M33f ().setRotation (r); // // Translate M. @@ -141,7 +140,7 @@ testRandomAngles33() V2f t (float(random.nextf (-10, 10)), float(random.nextf (-10, 10))); - M *= M33f().setTranslation (t); + M *= M33f ().setTranslation (t); // // Add a small random error to the elements of M @@ -255,7 +254,7 @@ testMatrix (const M44f M) } void -testRandomAngles44() +testRandomAngles44 () { Rand48 random (0); @@ -297,8 +296,7 @@ testRandomAngles44() float(random.nextf (0.000001, 2.0))); for (int j = 0; j < 3; j++) - if (random.nextf (0.0, 1.0) >= 0.5) - h[j] *= -1; + if (random.nextf (0.0, 1.0) >= 0.5) h[j] *= -1; M.shear (h); @@ -312,8 +310,7 @@ testRandomAngles44() float(random.nextf (0.000001, 2.0))); for (int j = 0; j < 3; j++) - if (random.nextf (0.0, 1.0) >= 0.5) - s[j] *= -1; + if (random.nextf (0.0, 1.0) >= 0.5) s[j] *= -1; M.scale (s); @@ -347,7 +344,7 @@ testAngles44 (V3f angles) { Eulerf e (rad (angles.x), rad (angles.y), rad (angles.z)); - M44f M (e.toMatrix44()); + M44f M (e.toMatrix44 ()); // // With rounding errors from e.toMatrix. @@ -373,15 +370,15 @@ testAngles44 (V3f angles) } void -test() +test () { cout << " random angles" << endl; cout << " 3x3" << endl; - testRandomAngles33(); + testRandomAngles33 (); cout << " 4x4" << endl; - testRandomAngles44(); + testRandomAngles44 (); cout << " special angles" << endl; @@ -399,7 +396,7 @@ test() } // namespace void -testExtractSHRT() +testExtractSHRT () { try { @@ -407,12 +404,12 @@ testExtractSHRT() << "from matrices" << endl; cout << "Imath::extractSHRT()" << endl; - test(); + test (); cout << "ok\n" << endl; } catch (std::exception& e) { - cerr << " Caught exception: " << e.what() << endl; + cerr << " Caught exception: " << e.what () << endl; } } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testExtractSHRT.h b/third_party/Imath/src/ImathTest/testExtractSHRT.h similarity index 79% rename from third_party/Imath-3.1.9/src/ImathTest/testExtractSHRT.h rename to third_party/Imath/src/ImathTest/testExtractSHRT.h index ab5022f0..19873991 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testExtractSHRT.h +++ b/third_party/Imath/src/ImathTest/testExtractSHRT.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testExtractSHRT(); +void testExtractSHRT (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testFrustum.cpp b/third_party/Imath/src/ImathTest/testFrustum.cpp similarity index 62% rename from third_party/Imath-3.1.9/src/ImathTest/testFrustum.cpp rename to third_party/Imath/src/ImathTest/testFrustum.cpp index 3bc6dfc9..0b0f6c76 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testFrustum.cpp +++ b/third_party/Imath/src/ImathTest/testFrustum.cpp @@ -7,13 +7,13 @@ # undef NDEBUG #endif +#include "testFrustum.h" #include #include #include #include #include #include -#include "testFrustum.h" // Include ImathForward *after* other headers to validate forward declarations #include @@ -26,29 +26,42 @@ namespace void testFrustumPlanes (IMATH_INTERNAL_NAMESPACE::Frustumf& frustum) { - bool ortho = frustum.orthographic(); + bool ortho = frustum.orthographic (); IMATH_INTERNAL_NAMESPACE::V3f o (0.0f, 0.0f, 0.0f); float eps = 5.0e-4f; - for (auto xRo : { 0.0f, 100.0f, 200.0f }) + for (auto xRo: {0.0f, 100.0f, 200.0f}) { - for (auto yRo : { 0.0f, 105.0f, 210.0f, 315.0f }) + for (auto yRo: {0.0f, 105.0f, 210.0f, 315.0f}) { - for (auto zRo : { 0.0f, 110.0f, 220.0f, 330.0f }) + for (auto zRo: {0.0f, 110.0f, 220.0f, 330.0f}) { - for (auto xTr : - { -10.0f, -8.0f, -6.0f, -4.0f, -2.0f, 0.0f, 2.0f, 4.0f, 6.0f, 8.0f }) + for (auto xTr: + {-10.0f, + -8.0f, + -6.0f, + -4.0f, + -2.0f, + 0.0f, + 2.0f, + 4.0f, + 6.0f, + 8.0f}) { - for (auto yTr : { -10.0f, -7.0f, -4.0f, -1.0f, 2.0f, 5.0f, 8.0f }) + for (auto yTr: + {-10.0f, -7.0f, -4.0f, -1.0f, 2.0f, 5.0f, 8.0f}) { - for (auto zTr : { -10.0f, -6.0f, -2.0f, 2.0f, 6.0f }) + for (auto zTr: {-10.0f, -6.0f, -2.0f, 2.0f, 6.0f}) { float xRoRad = xRo * (2.0f * float (M_PI) / 360.0f); float yRoRad = yRo * (2.0f * float (M_PI) / 360.0f); float zRoRad = zRo * (2.0f * float (M_PI) / 360.0f); - IMATH_INTERNAL_NAMESPACE::Eulerf e (xRoRad, yRoRad, zRoRad); - IMATH_INTERNAL_NAMESPACE::M44f mView = e.toMatrix44(); - mView.translate (IMATH_INTERNAL_NAMESPACE::V3f (xTr, yTr, zTr)); + IMATH_INTERNAL_NAMESPACE::Eulerf e ( + xRoRad, yRoRad, zRoRad); + IMATH_INTERNAL_NAMESPACE::M44f mView = + e.toMatrix44 (); + mView.translate ( + IMATH_INTERNAL_NAMESPACE::V3f (xTr, yTr, zTr)); IMATH_INTERNAL_NAMESPACE::Plane3f planes0[6]; frustum.planes (planes0); @@ -63,9 +76,9 @@ testFrustumPlanes (IMATH_INTERNAL_NAMESPACE::Frustumf& frustum) assert ((up ^ planes[0].normal) > 0.0); IMATH_INTERNAL_NAMESPACE::V3f pt = - (!ortho) - ? o - : IMATH_INTERNAL_NAMESPACE::V3f (0.0f, frustum.top(), 0.0f); + (!ortho) ? o + : IMATH_INTERNAL_NAMESPACE::V3f ( + 0.0f, frustum.top (), 0.0f); float d = planes0[0].distanceTo (pt); assert (IMATH_INTERNAL_NAMESPACE::iszero (d, eps)); pt = pt * mView; @@ -78,10 +91,10 @@ testFrustumPlanes (IMATH_INTERNAL_NAMESPACE::Frustumf& frustum) mView.multDirMatrix (right, right); assert ((right ^ planes[1].normal) > 0.0); - pt = (!ortho) - ? o - : IMATH_INTERNAL_NAMESPACE::V3f (frustum.right(), 0.0f, 0.0f); - d = planes0[1].distanceTo (pt); + pt = (!ortho) ? o + : IMATH_INTERNAL_NAMESPACE::V3f ( + frustum.right (), 0.0f, 0.0f); + d = planes0[1].distanceTo (pt); assert (IMATH_INTERNAL_NAMESPACE::iszero (d, eps)); pt = pt * mView; d = planes[1].distanceTo (pt); @@ -93,10 +106,10 @@ testFrustumPlanes (IMATH_INTERNAL_NAMESPACE::Frustumf& frustum) mView.multDirMatrix (down, down); assert ((down ^ planes[2].normal) > 0.0); - pt = (!ortho) - ? o - : IMATH_INTERNAL_NAMESPACE::V3f (0.0f, frustum.bottom(), 0.0f); - d = planes0[2].distanceTo (pt); + pt = (!ortho) ? o + : IMATH_INTERNAL_NAMESPACE::V3f ( + 0.0f, frustum.bottom (), 0.0f); + d = planes0[2].distanceTo (pt); assert (IMATH_INTERNAL_NAMESPACE::iszero (d, eps)); pt = pt * mView; d = planes[2].distanceTo (pt); @@ -108,10 +121,10 @@ testFrustumPlanes (IMATH_INTERNAL_NAMESPACE::Frustumf& frustum) mView.multDirMatrix (left, left); assert ((left ^ planes[3].normal) > 0.0); - pt = (!ortho) - ? o - : IMATH_INTERNAL_NAMESPACE::V3f (frustum.left(), 0.0f, 0.0f); - d = planes0[3].distanceTo (pt); + pt = (!ortho) ? o + : IMATH_INTERNAL_NAMESPACE::V3f ( + frustum.left (), 0.0f, 0.0f); + d = planes0[3].distanceTo (pt); assert (IMATH_INTERNAL_NAMESPACE::iszero (d, eps)); pt = pt * mView; d = planes[3].distanceTo (pt); @@ -123,8 +136,9 @@ testFrustumPlanes (IMATH_INTERNAL_NAMESPACE::Frustumf& frustum) mView.multDirMatrix (front, front); assert ((front ^ planes[4].normal) > 0.0); - pt = IMATH_INTERNAL_NAMESPACE::V3f (0.0f, 0.0f, -frustum.nearPlane()); - d = planes0[4].distanceTo (pt); + pt = IMATH_INTERNAL_NAMESPACE::V3f ( + 0.0f, 0.0f, -frustum.nearPlane ()); + d = planes0[4].distanceTo (pt); assert (IMATH_INTERNAL_NAMESPACE::iszero (d, eps)); pt = pt * mView; d = planes[4].distanceTo (pt); @@ -136,8 +150,9 @@ testFrustumPlanes (IMATH_INTERNAL_NAMESPACE::Frustumf& frustum) mView.multDirMatrix (back, back); assert ((back ^ planes[5].normal) > 0.0); - pt = IMATH_INTERNAL_NAMESPACE::V3f (0.0f, 0.0f, -frustum.farPlane()); - d = planes0[5].distanceTo (pt); + pt = IMATH_INTERNAL_NAMESPACE::V3f ( + 0.0f, 0.0f, -frustum.farPlane ()); + d = planes0[5].distanceTo (pt); assert (IMATH_INTERNAL_NAMESPACE::iszero (d, eps)); pt = pt * mView; d = planes[5].distanceTo (pt); @@ -153,10 +168,12 @@ testFrustumPlanes (IMATH_INTERNAL_NAMESPACE::Frustumf& frustum) } // namespace void -testFrustum() +testFrustum () { cout << "Testing functions in ImathFrustum.h"; + bool caught; + cout << "\nperspective "; float n = 1.7f; @@ -168,14 +185,19 @@ testFrustum() IMATH_INTERNAL_NAMESPACE::Frustum frustum (n, f, l, r, t, b, false); - assert (IMATH_INTERNAL_NAMESPACE::abs (frustum.fovx() - (atan2 (r, n) - atan2 (l, n))) < - 1e-6); - assert (IMATH_INTERNAL_NAMESPACE::abs (frustum.fovy() - (atan2 (t, n) - atan2 (b, n))) < - 1e-6); + assert ( + IMATH_INTERNAL_NAMESPACE::abs ( + frustum.fovx () - (atan2 (r, n) - atan2 (l, n))) < 1e-6); + assert ( + IMATH_INTERNAL_NAMESPACE::abs ( + frustum.fovy () - (atan2 (t, n) - atan2 (b, n))) < 1e-6); cout << "1"; - assert (IMATH_INTERNAL_NAMESPACE::abs (frustum.aspectExc() - ((r - l) / (t - b))) < 1e-6); - assert (IMATH_INTERNAL_NAMESPACE::abs (frustum.aspect() - ((r - l) / (t - b))) < - 1e-6); + assert ( + IMATH_INTERNAL_NAMESPACE::abs ( + frustum.aspectExc () - ((r - l) / (t - b))) < 1e-6); + assert ( + IMATH_INTERNAL_NAMESPACE::abs ( + frustum.aspect () - ((r - l) / (t - b))) < 1e-6); cout << "2"; IMATH_INTERNAL_NAMESPACE::M44f m = frustum.projectionMatrixExc (); @@ -228,19 +250,91 @@ testFrustum() IMATH_INTERNAL_NAMESPACE::abs (m[3][3]) < 1e-6f); cout << "3"; + IMATH_INTERNAL_NAMESPACE::Frustum badFrustum; + + badFrustum.set(n, f, l, r, t, t, false); + + caught = false; + try + { + badFrustum.projectionMatrixExc(); + assert(!"projectionMatrixExc() didn't throw with bad frustum"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + cout << "4"; + + badFrustum.set(n, n, l, r, b, t, false); + + caught = false; + try + { + badFrustum.projectionMatrixExc(); + assert(!"projectionMatrixExc() didn't throw with bad frustum"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + cout << "5"; + + badFrustum.set(n, n, l, r, b, t, false); + + caught = false; + try + { + badFrustum.projectionMatrixExc(); + assert(!"projectionMatrixExc() didn't throw with bad frustum"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + cout << "6"; + + badFrustum.set(n, f, l, r, t, t, true); + + caught = false; + try + { + badFrustum.projectionMatrixExc(); + assert(!"projectionMatrixExc() didn't throw with bad frustum"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + cout << "7"; + + caught = false; + try + { + badFrustum.aspectExc(); + assert (!"aspectExc didn't throw when top-bottom==0"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + cout << "8"; + cout << "\nplanes "; testFrustumPlanes (frustum); cout << "\nexceptions "; - IMATH_INTERNAL_NAMESPACE::Frustum badFrustum; - - bool caught; badFrustum.set (n, n, l, r, t, b, false); caught = false; try { - (void) badFrustum.projectionMatrixExc(); + (void) badFrustum.projectionMatrixExc (); assert (!"near == far didn't throw an exception"); } catch (std::domain_error&) @@ -254,7 +348,7 @@ testFrustum() caught = false; try { - (void) badFrustum.projectionMatrixExc(); + (void) badFrustum.projectionMatrixExc (); assert (!"left == right didn't throw an exception"); } catch (std::domain_error&) @@ -268,7 +362,7 @@ testFrustum() caught = false; try { - (void) badFrustum.projectionMatrixExc(); + (void) badFrustum.projectionMatrixExc (); assert (!"top == bottom didn't throw an exception"); } catch (std::domain_error&) @@ -334,10 +428,10 @@ testFrustum() assert (f1 == f2); cout << "\npassed equality test"; - long zMax = 100; - long zMin = 1; - float zero = 0; - float one = 1; + long zMax = 100; + long zMin = 1; + float zero = 0; + float one = 1; IMATH_INTERNAL_NAMESPACE::Vec3 v3 (zero, zero, one); f1.set (n, f, one, zero, one); @@ -353,7 +447,110 @@ testFrustum() assert (f1.screenRadius (v3, one) == f1.screenRadiusExc (v3, one)); assert (f1.projectPointToScreen (v3) == f1.projectPointToScreenExc (v3)); + f1.set (n, f, zero, one, one); + f2.setExc (n, f, zero, one, one); + + assert (f1 == f2); + + assert ( + f1.ZToDepth (zMin, zMin, zMax) == f1.ZToDepthExc (zMin, zMin, zMax)); + assert (f1.normalizedZToDepth (float(zMin)) == f1.normalizedZToDepthExc (float(zMin))); + assert (f1.DepthToZ (n, zMin, zMax) == f1.DepthToZExc (n, zMin, zMax)); + assert (f1.worldRadius (v3, one) == f1.worldRadiusExc (v3, one)); + assert (f1.screenRadius (v3, one) == f1.screenRadiusExc (v3, one)); + assert (f1.projectPointToScreen (v3) == f1.projectPointToScreenExc (v3)); + + f1.setOrthographic (true); + assert ( + f1.ZToDepth (zMin, zMin, zMax) == f1.ZToDepthExc (zMin, zMin, zMax)); + assert (f1.normalizedZToDepth (float(zMin)) == f1.normalizedZToDepthExc (float(zMin))); + assert (f1.DepthToZ (n, zMin, zMax) == f1.DepthToZExc (n, zMin, zMax)); + assert (f1.worldRadius (v3, one) == f1.worldRadiusExc (v3, one)); + assert (f1.screenRadius (v3, one) == f1.screenRadiusExc (v3, one)); + assert (f1.projectPointToScreen (v3) == f1.projectPointToScreenExc (v3)); + + f1.set(n, n, l, l, b, b, true); + caught = false; + try + { + f1.projectPointToScreenExc (v3); + assert (!"projectPointToScreenExc failed to throw with bad frustum"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + + caught = false; + try + { + f1.ZToDepthExc(100, 100, 100); + assert (!"ZToDepthExc failed to throw with zmax=zmin"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + + caught = false; + try + { + f1.DepthToZExc (100, 100, 100); + assert (!"normalizedZToDepth failed to throw with bad frustum"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + + f1.setOrthographic(false); + + caught = false; + try + { + f1.DepthToZExc (100, 100, 100); + assert (!"DepthToZExc failed to throw with bad frustum"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + + f1.set(n, f, l, r, b, t, true); + caught = false; + try + { + v3.z = 1.0 / std::numeric_limits::max(); + f1.screenRadiusExc (v3, 1.0); + assert (!"screenRadiusExc failed to throw with bad p"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); + cout << "\npassed noexcept equality verification"; + + float fovx = 1.0; + float fovy = 1.0; + float aspect = 1.0; + + caught = false; + try + { + badFrustum.setExc (n, f, fovx, fovy, aspect); + assert (!"nfovx and fovy can't both be 0.0"); + } + catch (std::domain_error&) + { + caught = true; + } + assert (caught); cout << "\nok\n\n"; } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testFrustum.h b/third_party/Imath/src/ImathTest/testFrustum.h similarity index 82% rename from third_party/Imath-3.1.9/src/ImathTest/testFrustum.h rename to third_party/Imath/src/ImathTest/testFrustum.h index 9047932f..73df352a 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testFrustum.h +++ b/third_party/Imath/src/ImathTest/testFrustum.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testFrustum(); +void testFrustum (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testFrustumTest.cpp b/third_party/Imath/src/ImathTest/testFrustumTest.cpp similarity index 66% rename from third_party/Imath-3.1.9/src/ImathTest/testFrustumTest.cpp rename to third_party/Imath/src/ImathTest/testFrustumTest.cpp index 1f29b2ac..012cc043 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testFrustumTest.cpp +++ b/third_party/Imath/src/ImathTest/testFrustumTest.cpp @@ -7,13 +7,13 @@ # undef NDEBUG #endif +#include "testFrustumTest.h" #include #include #include #include #include #include -#include "testFrustumTest.h" // Include ImathForward *after* other headers to validate forward declarations #include @@ -21,7 +21,7 @@ using namespace std; void -testFrustumTest() +testFrustumTest () { cout << "Testing functions in ImathFrustumTest.h"; @@ -38,18 +38,24 @@ testFrustumTest() IMATH_INTERNAL_NAMESPACE::Matrix44 cameraMat; IMATH_INTERNAL_NAMESPACE::Vec3 cameraPos (100.0f, 200.0f, 300.0f); - cameraMat.makeIdentity(); + cameraMat.makeIdentity (); cameraMat.translate (cameraPos); - IMATH_INTERNAL_NAMESPACE::FrustumTest frustumTest (frustum, cameraMat); + IMATH_INTERNAL_NAMESPACE::FrustumTest frustumTest ( + frustum, cameraMat); ///////////////////////////////////////////////////// // Test Vec3's - IMATH_INTERNAL_NAMESPACE::Vec3 insideVec (100.0f, 200.0f, 300 - 2.0f); - IMATH_INTERNAL_NAMESPACE::Vec3 outsideVec_near (100.0f, 200.0f, 300 - 1.5f); - IMATH_INTERNAL_NAMESPACE::Vec3 outsideVec_far (100.0f, 200.0f, 300 - 568.0f); - IMATH_INTERNAL_NAMESPACE::Vec3 outsideVec_side (100.0f, 200.0f + 100.0f, 300 - 2.0f); - IMATH_INTERNAL_NAMESPACE::Vec3 outsideVec_up (100.0f + 100.0f, 200.0f, 300 - 2.0f); + IMATH_INTERNAL_NAMESPACE::Vec3 insideVec ( + 100.0f, 200.0f, 300 - 2.0f); + IMATH_INTERNAL_NAMESPACE::Vec3 outsideVec_near ( + 100.0f, 200.0f, 300 - 1.5f); + IMATH_INTERNAL_NAMESPACE::Vec3 outsideVec_far ( + 100.0f, 200.0f, 300 - 568.0f); + IMATH_INTERNAL_NAMESPACE::Vec3 outsideVec_side ( + 100.0f, 200.0f + 100.0f, 300 - 2.0f); + IMATH_INTERNAL_NAMESPACE::Vec3 outsideVec_up ( + 100.0f + 100.0f, 200.0f, 300 - 2.0f); assert (frustumTest.isVisible (insideVec)); assert (!frustumTest.isVisible (outsideVec_near)); @@ -65,14 +71,13 @@ testFrustumTest() IMATH_INTERNAL_NAMESPACE::Vec3 hugeSize (1000.0f, 1000.0f, 1000.0f); // Empty box should NOT be visible - assert (!frustumTest.isVisible ( - IMATH_INTERNAL_NAMESPACE::Box>())); + assert (!frustumTest.isVisible (IMATH_INTERNAL_NAMESPACE::Box< + IMATH_INTERNAL_NAMESPACE::Vec3> ())); // Tiny box inside the frust should be visible assert (frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - insideVec + tinySize, - insideVec + tinySize))); + insideVec + tinySize, insideVec + tinySize))); assert (frustumTest.completelyContains ( IMATH_INTERNAL_NAMESPACE::Box> ( @@ -81,42 +86,33 @@ testFrustumTest() // Huge boxes inside and outside should be visible assert (frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - insideVec - hugeSize, - insideVec + hugeSize))); + insideVec - hugeSize, insideVec + hugeSize))); assert (frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - outsideVec_near - hugeSize, - outsideVec_near + hugeSize))); + outsideVec_near - hugeSize, outsideVec_near + hugeSize))); assert (frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - outsideVec_far - hugeSize, - outsideVec_far + hugeSize))); + outsideVec_far - hugeSize, outsideVec_far + hugeSize))); assert (frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - outsideVec_side - hugeSize, - outsideVec_side + hugeSize))); + outsideVec_side - hugeSize, outsideVec_side + hugeSize))); assert (frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - outsideVec_up - hugeSize, - outsideVec_up + hugeSize))); + outsideVec_up - hugeSize, outsideVec_up + hugeSize))); // Tiny boxes outside should NOT be visible assert (!frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - outsideVec_near - tinySize, - outsideVec_near + tinySize))); + outsideVec_near - tinySize, outsideVec_near + tinySize))); assert (!frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - outsideVec_far - tinySize, - outsideVec_far + tinySize))); + outsideVec_far - tinySize, outsideVec_far + tinySize))); assert (!frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - outsideVec_side - tinySize, - outsideVec_side + tinySize))); + outsideVec_side - tinySize, outsideVec_side + tinySize))); assert (!frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Box> ( - outsideVec_up - tinySize, - outsideVec_up + tinySize))); + outsideVec_up - tinySize, outsideVec_up + tinySize))); cout << "passed Box\n"; ///////////////////////////////////////////////////// @@ -125,31 +121,31 @@ testFrustumTest() float hugeRadius = 1000.0f; // Tiny sphere inside the frust should be visible - assert ( - frustumTest.isVisible (IMATH_INTERNAL_NAMESPACE::Sphere3 (insideVec, tinyRadius))); + assert (frustumTest.isVisible ( + IMATH_INTERNAL_NAMESPACE::Sphere3 (insideVec, tinyRadius))); assert (frustumTest.completelyContains( IMATH_INTERNAL_NAMESPACE::Sphere3 (insideVec, tinyRadius))); // Huge spheres inside and outside should be visible - assert ( - frustumTest.isVisible (IMATH_INTERNAL_NAMESPACE::Sphere3 (insideVec, hugeRadius))); assert (frustumTest.isVisible ( - IMATH_INTERNAL_NAMESPACE::Sphere3 (outsideVec_near, hugeRadius))); + IMATH_INTERNAL_NAMESPACE::Sphere3 (insideVec, hugeRadius))); + assert (frustumTest.isVisible (IMATH_INTERNAL_NAMESPACE::Sphere3 ( + outsideVec_near, hugeRadius))); assert (frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Sphere3 (outsideVec_far, hugeRadius))); - assert (frustumTest.isVisible ( - IMATH_INTERNAL_NAMESPACE::Sphere3 (outsideVec_side, hugeRadius))); + assert (frustumTest.isVisible (IMATH_INTERNAL_NAMESPACE::Sphere3 ( + outsideVec_side, hugeRadius))); assert (frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Sphere3 (outsideVec_up, hugeRadius))); // Tiny spheres outside should NOT be visible - assert (!frustumTest.isVisible ( - IMATH_INTERNAL_NAMESPACE::Sphere3 (outsideVec_near, tinyRadius))); + assert (!frustumTest.isVisible (IMATH_INTERNAL_NAMESPACE::Sphere3 ( + outsideVec_near, tinyRadius))); assert (!frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Sphere3 (outsideVec_far, tinyRadius))); - assert (!frustumTest.isVisible ( - IMATH_INTERNAL_NAMESPACE::Sphere3 (outsideVec_side, tinyRadius))); + assert (!frustumTest.isVisible (IMATH_INTERNAL_NAMESPACE::Sphere3 ( + outsideVec_side, tinyRadius))); assert (!frustumTest.isVisible ( IMATH_INTERNAL_NAMESPACE::Sphere3 (outsideVec_up, tinyRadius))); cout << "passed Sphere\n"; diff --git a/third_party/Imath-3.1.9/src/ImathTest/testFrustumTest.h b/third_party/Imath/src/ImathTest/testFrustumTest.h similarity index 79% rename from third_party/Imath-3.1.9/src/ImathTest/testFrustumTest.h rename to third_party/Imath/src/ImathTest/testFrustumTest.h index 8bbe9872..cc2af86d 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testFrustumTest.h +++ b/third_party/Imath/src/ImathTest/testFrustumTest.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testFrustumTest(); +void testFrustumTest (); diff --git a/third_party/Imath/src/ImathTest/testFun.cpp b/third_party/Imath/src/ImathTest/testFun.cpp new file mode 100644 index 00000000..895da1c9 --- /dev/null +++ b/third_party/Imath/src/ImathTest/testFun.cpp @@ -0,0 +1,351 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#ifdef NDEBUG +# undef NDEBUG +#endif + +#include +#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L +# include +#endif +#include "testFun.h" +#include +#include +#include +#include +#include + +using namespace std; + +#if !defined(__cpp_lib_bit_cast) || __cpp_lib_bit_cast < 201806L +template +static inline To +bit_cast (From from) +{ + static_assert (sizeof (From) == sizeof (To), "Type sizes do not match"); + union + { + From f; + To t; + } u; + u.f = from; + return u.t; +} +#endif + +void +testf (float f, bool changeExpected = true) +{ + printf ("\n"); + + float sf = IMATH_INTERNAL_NAMESPACE::succf (f); + float pf = IMATH_INTERNAL_NAMESPACE::predf (f); + float spf = + IMATH_INTERNAL_NAMESPACE::succf (IMATH_INTERNAL_NAMESPACE::predf (f)); + float psf = + IMATH_INTERNAL_NAMESPACE::predf (IMATH_INTERNAL_NAMESPACE::succf (f)); + + printf ("f %.9g %" PRIx32 "\n", f, bit_cast (f)); + printf ("sf %.9g %" PRIx32 "\n", sf, bit_cast (sf)); + printf ("pf %.9g %" PRIx32 "\n", pf, bit_cast (pf)); + printf ("spf %.9g %" PRIx32 "\n", spf, bit_cast (spf)); + printf ("psf %.9g %" PRIx32 "\n", psf, bit_cast (psf)); + + fflush (stdout); + + if (changeExpected) + { + assert (pf < f); + assert (f < sf); + } + else + { + if (isnan (f)) + { + // If f is nan, pf and sf may be converted from signaling + // to quiet nan, but they'll still be nan's. + assert (isnan (pf)); + assert (isnan (sf)); + } + else + { + // No bit change expected if input was inf. + assert (bit_cast (pf) == bit_cast (f)); + assert (bit_cast (sf) == bit_cast (f)); + } + } +} + +void +testd (double d, bool changeExpected = true) +{ + printf ("\n"); + + double sd = IMATH_INTERNAL_NAMESPACE::succd (d); + double pd = IMATH_INTERNAL_NAMESPACE::predd (d); + double spd = + IMATH_INTERNAL_NAMESPACE::succd (IMATH_INTERNAL_NAMESPACE::predd (d)); + double psd = + IMATH_INTERNAL_NAMESPACE::predd (IMATH_INTERNAL_NAMESPACE::succd (d)); + + printf ("d %0.18lg %" PRIx64 "\n", d, bit_cast (d)); + printf ("sd %0.18lg %" PRIx64 "\n", sd, bit_cast (sd)); + printf ("pd %0.18lg %" PRIx64 "\n", pd, bit_cast (pd)); + printf ("spd %0.18lg %" PRIx64 "\n", spd, bit_cast (spd)); + printf ("psd %0.18lg %" PRIx64 "\n", psd, bit_cast (psd)); + + fflush (stdout); + + if (changeExpected) + { + assert (pd < d); + assert (d < sd); + } + else + { + if (isnan (d)) + { + // If f is nan, pf and sf may be converted from signaling + // to quiet nan, but they'll still be nan's. + assert (isnan (pd)); + assert (isnan (sd)); + } + else + { + // No bit change expected if input was inf. + assert (bit_cast (pd) == bit_cast (d)); + assert (bit_cast (sd) == bit_cast (d)); + } + } +} + +void +testFun () +{ + cout << "Testing functions in ImathFun.h" << endl; + + cout << "floor" << endl; + + assert (IMATH_INTERNAL_NAMESPACE::floor (0.0f) == 0); + assert (IMATH_INTERNAL_NAMESPACE::floor (0.5f) == 0); + assert (IMATH_INTERNAL_NAMESPACE::floor (-0.5f) == -1); + assert (IMATH_INTERNAL_NAMESPACE::floor (1.0f) == 1); + assert (IMATH_INTERNAL_NAMESPACE::floor (-1.0f) == -1); + assert (IMATH_INTERNAL_NAMESPACE::floor (1.5f) == 1); + assert (IMATH_INTERNAL_NAMESPACE::floor (-1.5f) == -2); + + cout << "ceil" << endl; + + assert (IMATH_INTERNAL_NAMESPACE::ceil (0.0f) == 0); + assert (IMATH_INTERNAL_NAMESPACE::ceil (0.5f) == 1); + assert (IMATH_INTERNAL_NAMESPACE::ceil (-0.5f) == 0); + assert (IMATH_INTERNAL_NAMESPACE::ceil (1.0f) == 1); + assert (IMATH_INTERNAL_NAMESPACE::ceil (-1.0f) == -1); + assert (IMATH_INTERNAL_NAMESPACE::ceil (1.5f) == 2); + assert (IMATH_INTERNAL_NAMESPACE::ceil (-1.5f) == -1); + + cout << "trunc" << endl; + + assert (IMATH_INTERNAL_NAMESPACE::trunc (0.0f) == 0); + assert (IMATH_INTERNAL_NAMESPACE::trunc (0.5f) == 0); + assert (IMATH_INTERNAL_NAMESPACE::trunc (-0.5f) == 0); + assert (IMATH_INTERNAL_NAMESPACE::trunc (1.0f) == 1); + assert (IMATH_INTERNAL_NAMESPACE::trunc (-1.0f) == -1); + assert (IMATH_INTERNAL_NAMESPACE::trunc (1.5f) == 1); + assert (IMATH_INTERNAL_NAMESPACE::trunc (-1.5f) == -1); + + cout << "divs / mods" << endl; + + assert ( + IMATH_INTERNAL_NAMESPACE::divs (5, 2) == 2 && + IMATH_INTERNAL_NAMESPACE::mods (5, 2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (4, 2) == 2 && + IMATH_INTERNAL_NAMESPACE::mods (4, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (3, 2) == 1 && + IMATH_INTERNAL_NAMESPACE::mods (3, 2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (2, 2) == 1 && + IMATH_INTERNAL_NAMESPACE::mods (2, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (1, 2) == 0 && + IMATH_INTERNAL_NAMESPACE::mods (1, 2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (0, 2) == 0 && + IMATH_INTERNAL_NAMESPACE::mods (0, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-1, 2) == 0 && + IMATH_INTERNAL_NAMESPACE::mods (-1, 2) == -1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-2, 2) == -1 && + IMATH_INTERNAL_NAMESPACE::mods (-2, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-3, 2) == -1 && + IMATH_INTERNAL_NAMESPACE::mods (-3, 2) == -1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-4, 2) == -2 && + IMATH_INTERNAL_NAMESPACE::mods (-4, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-5, 2) == -2 && + IMATH_INTERNAL_NAMESPACE::mods (-5, 2) == -1); + + assert ( + IMATH_INTERNAL_NAMESPACE::divs (5, -2) == -2 && + IMATH_INTERNAL_NAMESPACE::mods (5, -2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (4, -2) == -2 && + IMATH_INTERNAL_NAMESPACE::mods (4, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (3, -2) == -1 && + IMATH_INTERNAL_NAMESPACE::mods (3, -2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (2, -2) == -1 && + IMATH_INTERNAL_NAMESPACE::mods (2, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (1, -2) == 0 && + IMATH_INTERNAL_NAMESPACE::mods (1, -2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (0, -2) == 0 && + IMATH_INTERNAL_NAMESPACE::mods (0, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-1, -2) == 0 && + IMATH_INTERNAL_NAMESPACE::mods (-1, -2) == -1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-2, -2) == 1 && + IMATH_INTERNAL_NAMESPACE::mods (-2, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-3, -2) == 1 && + IMATH_INTERNAL_NAMESPACE::mods (-3, -2) == -1); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-4, -2) == 2 && + IMATH_INTERNAL_NAMESPACE::mods (-4, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divs (-5, -2) == 2 && + IMATH_INTERNAL_NAMESPACE::mods (-5, -2) == -1); + + cout << "divp / modp" << endl; + + assert ( + IMATH_INTERNAL_NAMESPACE::divp (5, 2) == 2 && + IMATH_INTERNAL_NAMESPACE::modp (5, 2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (4, 2) == 2 && + IMATH_INTERNAL_NAMESPACE::modp (4, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (3, 2) == 1 && + IMATH_INTERNAL_NAMESPACE::modp (3, 2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (2, 2) == 1 && + IMATH_INTERNAL_NAMESPACE::modp (2, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (1, 2) == 0 && + IMATH_INTERNAL_NAMESPACE::modp (1, 2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (0, 2) == 0 && + IMATH_INTERNAL_NAMESPACE::modp (0, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-1, 2) == -1 && + IMATH_INTERNAL_NAMESPACE::modp (-1, 2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-2, 2) == -1 && + IMATH_INTERNAL_NAMESPACE::modp (-2, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-3, 2) == -2 && + IMATH_INTERNAL_NAMESPACE::modp (-3, 2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-4, 2) == -2 && + IMATH_INTERNAL_NAMESPACE::modp (-4, 2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-5, 2) == -3 && + IMATH_INTERNAL_NAMESPACE::modp (-5, 2) == 1); + + assert ( + IMATH_INTERNAL_NAMESPACE::divp (5, -2) == -2 && + IMATH_INTERNAL_NAMESPACE::modp (5, -2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (4, -2) == -2 && + IMATH_INTERNAL_NAMESPACE::modp (4, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (3, -2) == -1 && + IMATH_INTERNAL_NAMESPACE::modp (3, -2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (2, -2) == -1 && + IMATH_INTERNAL_NAMESPACE::modp (2, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (1, -2) == 0 && + IMATH_INTERNAL_NAMESPACE::modp (1, -2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (0, -2) == 0 && + IMATH_INTERNAL_NAMESPACE::modp (0, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-1, -2) == 1 && + IMATH_INTERNAL_NAMESPACE::modp (-1, -2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-2, -2) == 1 && + IMATH_INTERNAL_NAMESPACE::modp (-2, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-3, -2) == 2 && + IMATH_INTERNAL_NAMESPACE::modp (-3, -2) == 1); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-4, -2) == 2 && + IMATH_INTERNAL_NAMESPACE::modp (-4, -2) == 0); + assert ( + IMATH_INTERNAL_NAMESPACE::divp (-5, -2) == 3 && + IMATH_INTERNAL_NAMESPACE::modp (-5, -2) == 1); + + cout << "successor, predecessor" << endl; + + testf (0); + testf (0.0f * -1.0f); + testf (1); + testf (-1); + testf (16); + testf (7); + testf (0.7f); + + union + { + float f; + uint32_t i; + } u; + u.i = 0x7f800000; // inf + testf (u.f, false); + u.i = 0xff800000; // -inf + testf (u.f, false); + u.i = 0x7f800001; // nan + testf (u.f, false); + u.i = 0x7f7fffff; // FLT_MAX + testf (u.f); + u.i = 0xff7fffff; // -FLT_MAX + testf (u.f); + + testd (0); + testd (0.0 * -1.0); + testd (1); + testd (-1); + testd (16); + testd (7); + testd (0.7); + + union + { + double d; + uint64_t i; + } v; + v.i = 0x7ff0000000000000ULL; // inf + testd (v.d, false); + v.i = 0xfff0000000000000ULL; // -inf + testd (v.d, false); + v.i = 0x7ff0000000000001ULL; // NAN + testd (v.d, false); + v.i = 0x7fefffffffffffffULL; // FLT_MAX + testd (v.d); + v.i = 0xffefffffffffffffULL; // -FLT_MAX + testd (v.d); + + cout << "ok\n" << endl; +} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testFun.h b/third_party/Imath/src/ImathTest/testFun.h similarity index 85% rename from third_party/Imath-3.1.9/src/ImathTest/testFun.h rename to third_party/Imath/src/ImathTest/testFun.h index 830b92d9..ecbf1f9d 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testFun.h +++ b/third_party/Imath/src/ImathTest/testFun.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testFun(); +void testFun (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testFunction.cpp b/third_party/Imath/src/ImathTest/testFunction.cpp similarity index 55% rename from third_party/Imath-3.1.9/src/ImathTest/testFunction.cpp rename to third_party/Imath/src/ImathTest/testFunction.cpp index ad235a82..aed1f50c 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testFunction.cpp +++ b/third_party/Imath/src/ImathTest/testFunction.cpp @@ -7,10 +7,10 @@ # undef NDEBUG #endif +#include "testFunction.h" #include "halfFunction.h" #include #include -#include "testFunction.h" using namespace std; @@ -33,7 +33,7 @@ struct timesN } // namespace void -testFunction() +testFunction () { cout << "halfFunction\n"; @@ -44,17 +44,18 @@ testFunction() assert (d2 (-2) == -1); assert (d2 (HALF_MAX) == HALF_MAX / 2); assert (d2 (-HALF_MAX) == -HALF_MAX / 2); - assert (d2 (half::posInf()) == 0); - assert (d2 (half::negInf()) == 0); - assert (d2 (half::qNan()) == 0); - - halfFunction t5 (timesN (5), // function - 0, - HALF_MAX / 8, // domain - -1, // default value - half::posInf(), // posInfValue - half::negInf(), // negInfValue - half::qNan()); // nanValue + assert (d2 (half::posInf ()) == 0); + assert (d2 (half::negInf ()) == 0); + assert (d2 (half::qNan ()) == 0); + + halfFunction t5 ( + timesN (5), // function + 0, + HALF_MAX / 8, // domain + -1, // default value + half::posInf (), // posInfValue + half::negInf (), // negInfValue + half::qNan ()); // nanValue assert (t5 (0) == 0); assert (t5 (2) == 10); @@ -62,13 +63,13 @@ testFunction() assert (t5 (HALF_MAX) == -1); assert (t5 (-HALF_MAX) == -1); - assert (t5 (half::posInf()).isInfinity()); - assert (!t5 (half::posInf()).isNegative()); + assert (t5 (half::posInf ()).isInfinity ()); + assert (!t5 (half::posInf ()).isNegative ()); - assert (t5 (half::negInf()).isInfinity()); - assert (t5 (half::negInf()).isNegative()); + assert (t5 (half::negInf ()).isInfinity ()); + assert (t5 (half::negInf ()).isNegative ()); - assert (t5 (half::qNan()).isNan()); + assert (t5 (half::qNan ()).isNan ()); cout << "ok\n\n" << flush; } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testFunction.h b/third_party/Imath/src/ImathTest/testFunction.h similarity index 81% rename from third_party/Imath-3.1.9/src/ImathTest/testFunction.h rename to third_party/Imath/src/ImathTest/testFunction.h index daa14a90..51d3f685 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testFunction.h +++ b/third_party/Imath/src/ImathTest/testFunction.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testFunction(); +void testFunction (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testInterop.cpp b/third_party/Imath/src/ImathTest/testInterop.cpp similarity index 52% rename from third_party/Imath-3.1.9/src/ImathTest/testInterop.cpp rename to third_party/Imath/src/ImathTest/testInterop.cpp index 8cbfc177..106ce027 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testInterop.cpp +++ b/third_party/Imath/src/ImathTest/testInterop.cpp @@ -7,15 +7,15 @@ # undef NDEBUG #endif +#include "testVec.h" #include -#include #include +#include #include #include #include #include #include -#include "testVec.h" using namespace std; using namespace IMATH_INTERNAL_NAMESPACE; @@ -26,159 +26,155 @@ using namespace IMATH_INTERNAL_NAMESPACE; // appear to be the length of N elements. Carve out an exception here that // allows this to work. IMATH_INTERNAL_NAMESPACE_SOURCE_ENTER -template -struct has_subscript, T, N> : public std::true_type { }; +template +struct has_subscript, T, N> : public std::true_type +{}; IMATH_INTERNAL_NAMESPACE_SOURCE_EXIT - namespace { // Extra simple vector that does nothing but allow element access, as an // example of a vector type that an app might use and want interop with // our vectors. -template -struct SimpleVec { +template struct SimpleVec +{ T elements[N]; - SimpleVec(T val = T(0)) { + SimpleVec (T val = T (0)) + { for (int i = 0; i < N; ++i) elements[i] = val; } - ~SimpleVec() = default; - constexpr T operator[](int i) const { return elements[i]; } - T& operator[](int i) { return elements[i]; } + ~SimpleVec () = default; + constexpr T operator[] (int i) const { return elements[i]; } + T& operator[] (int i) { return elements[i]; } }; - - // Extra simple matrix that does nothing but allow element access, as an // example of a matrix type that an app might use and want interop with // our vectors. -template -struct SimpleMx { +template struct SimpleMx +{ T elements[N][N]; - SimpleMx(T val = T(0)) { + SimpleMx (T val = T (0)) + { for (int j = 0; j < N; ++j) for (int i = 0; i < N; ++i) elements[j][i] = val; } - ~SimpleMx() = default; - const T* operator[](int i) const { return elements[i]; } - T* operator[](int i) { return elements[i]; } + ~SimpleMx () = default; + const T* operator[] (int i) const { return elements[i]; } + T* operator[] (int i) { return elements[i]; } }; - - // Small structs containing just x,y,z,w elements. -template -struct xy { +template struct xy +{ T x, y; }; - -template -struct xyz { +template struct xyz +{ T x, y, z; }; - -template -struct xyzw { +template struct xyzw +{ T x, y, z, w; }; - -template -struct xyz_wrong { - T x() { return 0; } - T y() { return 1; } - T z() { return 2; } +template struct xyz_wrong +{ + T x () { return 0; } + T y () { return 1; } + T z () { return 2; } }; - - // A class that has *both* subscripting and named members -template -struct ComboVec2 { - union { +template struct ComboVec2 +{ + union + { T elements[2]; - struct { T x, y; }; + struct + { + T x, y; + }; }; - ComboVec2(T val = T(0)) : x(val), y(val) { } - ~ComboVec2() = default; - constexpr T operator[](int i) const { return elements[i]; } - T& operator[](int i) { return elements[i]; } + ComboVec2 (T val = T (0)) : x (val), y (val) {} + ~ComboVec2 () = default; + constexpr T operator[] (int i) const { return elements[i]; } + T& operator[] (int i) { return elements[i]; } }; - - // A class that has *both* subscripting and named members -template -struct ComboVec3 { - union { +template struct ComboVec3 +{ + union + { T elements[3]; - struct { T x, y, z; }; + struct + { + T x, y, z; + }; }; - ComboVec3(T val = T(0)) : x(val), y(val), z(val) { } - ~ComboVec3() = default; - constexpr T operator[](int i) const { return elements[i]; } - T& operator[](int i) { return elements[i]; } + ComboVec3 (T val = T (0)) : x (val), y (val), z (val) {} + ~ComboVec3 () = default; + constexpr T operator[] (int i) const { return elements[i]; } + T& operator[] (int i) { return elements[i]; } }; - - // A class that has *both* subscripting and named members -template -struct ComboVec4 { - union { +template struct ComboVec4 +{ + union + { T elements[4]; - struct { T x, y, z, w; }; + struct + { + T x, y, z, w; + }; }; - ComboVec4(T val = T(0)) : x(val), y(val), z(val), w(val) { } - ~ComboVec4() = default; - constexpr T operator[](int i) const { return elements[i]; } - T& operator[](int i) { return elements[i]; } + ComboVec4 (T val = T (0)) : x (val), y (val), z (val), w (val) {} + ~ComboVec4 () = default; + constexpr T operator[] (int i) const { return elements[i]; } + T& operator[] (int i) { return elements[i]; } }; - - // Test whether a Vec contains the given elements. void -testVecVal2f(const V2f& v, float a, float b) +testVecVal2f (const V2f& v, float a, float b) { - assert(v[0] == a && v[1] == b); + assert (v[0] == a && v[1] == b); } void -testVecVal3f(const V3f& v, float a, float b, float c) +testVecVal3f (const V3f& v, float a, float b, float c) { - assert(v[0] == a && v[1] == b && v[2] == c); + assert (v[0] == a && v[1] == b && v[2] == c); } void -testVecVal4f(const V4f& v, float a, float b, float c, float d) +testVecVal4f (const V4f& v, float a, float b, float c, float d) { - assert(v[0] == a && v[1] == b && v[2] == c && v[3] == d); + assert (v[0] == a && v[1] == b && v[2] == c && v[3] == d); } - - - void -testInteropVec2() +testInteropVec2 () { std::cout << "has_xy, float>::value = " - << has_xy, float>::value << "\n"; + << has_xy, float>::value << "\n"; std::cout << "has_xy, float>::value = " - << has_xy, float>::value << "\n"; + << has_xy, float>::value << "\n"; std::cout << "has_xy, float>::value = " - << has_xy, float>::value << "\n"; + << has_xy, float>::value << "\n"; std::cout << "has_xy, float>::value = " << has_xy, float>::value << "\n"; std::cout << "has_xy, float>::value = " @@ -191,11 +187,11 @@ testInteropVec2() << has_xy, float>::value << "\n"; std::cout << "\n"; std::cout << "has_subscript, float, 2>::value = " - << has_subscript, float, 2>::value << "\n"; + << has_subscript, float, 2>::value << "\n"; std::cout << "has_subscript, float, 2>::value = " - << has_subscript, float, 2>::value << "\n"; + << has_subscript, float, 2>::value << "\n"; std::cout << "has_subscript, float, 2>::value = " - << has_subscript, float, 2>::value << "\n"; + << has_subscript, float, 2>::value << "\n"; std::cout << "has_subscript, float, 2>::value = " << has_subscript, float, 2>::value << "\n"; std::cout << "has_subscript, float, 2>::value = " @@ -221,92 +217,91 @@ testInteropVec2() << has_subscript, float, 2>::value << "\n"; std::cout << "\n"; - assert((!has_xy, float>::value)); - assert((has_xy, float>::value)); - assert((!has_xy, float>::value)); + assert ((!has_xy, float>::value)); + assert ((has_xy, float>::value)); + assert ((!has_xy, float>::value)); - assert((has_subscript, float, 2>::value)); - assert((!has_subscript, float, 2>::value)); - assert((!has_subscript, int, 2>::value)); - assert((!has_subscript, float, 2>::value)); - assert((!has_subscript, float, 2>::value)); + assert ((has_subscript, float, 2>::value)); + assert ((!has_subscript, float, 2>::value)); + assert ((!has_subscript, int, 2>::value)); + assert ((!has_subscript, float, 2>::value)); + assert ((!has_subscript, float, 2>::value)); // Test construction/assignment/paramater pass of a vector type with // subscripting to access components. { - SimpleVec s; + SimpleVec s; s[0] = 1; s[1] = 2; - Vec2 v(s); - assert(v[0] == 1 && v[1] == 2); + Vec2 v (s); + assert (v[0] == 1 && v[1] == 2); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42); - testVecVal2f(V2f(s), 1.0f, 42.0f); + v = s; + assert (v[0] == 1 && v[1] == 42); + testVecVal2f (V2f (s), 1.0f, 42.0f); } // Test construction/assignment/paramater pass of a vector type with // explicit .y, .y, .z components but no subscripting. { - xy s { 1, 2 }; - Vec2 v(s); - assert(v[0] == 1 && v[1] == 2); + xy s{1, 2}; + Vec2 v (s); + assert (v[0] == 1 && v[1] == 2); s.y = 42; - v = s; - assert(v[0] == 1 && v[1] == 42); - testVecVal2f(V2f(s), 1.0f, 42.0f); + v = s; + assert (v[0] == 1 && v[1] == 42); + testVecVal2f (V2f (s), 1.0f, 42.0f); } // Test construction/assignment/paramater pass of a std::vector of length 3 { - std::vector s { 1, 2 }; - Vec2 v(s); - assert(v[0] == 1 && v[1] == 2); + std::vector s{1, 2}; + Vec2 v (s); + assert (v[0] == 1 && v[1] == 2); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42); - testVecVal2f(V2f(s), 1.0f, 42.0f); + v = s; + assert (v[0] == 1 && v[1] == 42); + testVecVal2f (V2f (s), 1.0f, 42.0f); } // Test construction/assignment/paramater pass of a std::array of length 3 { - std::array s { 1, 2 }; - Vec2 v(s); - assert(v[0] == 1 && v[1] == 2); + std::array s{1, 2}; + Vec2 v (s); + assert (v[0] == 1 && v[1] == 2); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42); - testVecVal2f(V2f(s), 1.0f, 42.0f); + v = s; + assert (v[0] == 1 && v[1] == 42); + testVecVal2f (V2f (s), 1.0f, 42.0f); } // Test construction/assignment/paramater pass of initializer lists. { - Vec2 v({ 1.0f, 2.0f }); - assert(v[0] == 1 && v[1] == 2); - v = { 1.0f, 42.0f }; - assert(v[0] == 1 && v[1] == 42); - testVecVal2f({ 1.0f, 42.0f}, 1.0f, 42.0f); + Vec2 v ({1.0f, 2.0f}); + assert (v[0] == 1 && v[1] == 2); + v = {1.0f, 42.0f}; + assert (v[0] == 1 && v[1] == 42); + testVecVal2f ({1.0f, 42.0f}, 1.0f, 42.0f); } // Test construction/assignment/paramater pass of a C array { - float s[2] = { 1, 2 }; - Vec2 v(s); - assert(v[0] == 1 && v[1] == 2); + float s[2] = {1, 2}; + Vec2 v (s); + assert (v[0] == 1 && v[1] == 2); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42); - testVecVal2f(V2f(s), 1.0f, 42.0f); + v = s; + assert (v[0] == 1 && v[1] == 42); + testVecVal2f (V2f (s), 1.0f, 42.0f); } } - //--------- void -testInteropVec3() +testInteropVec3 () { std::cout << "has_xyz, float>::value = " - << has_xyz, float>::value << "\n"; + << has_xyz, float>::value << "\n"; std::cout << "has_xyz, float>::value = " - << has_xyz, float>::value << "\n"; + << has_xyz, float>::value << "\n"; std::cout << "has_xyz, float>::value = " - << has_xyz, float>::value << "\n"; + << has_xyz, float>::value << "\n"; std::cout << "has_xyz, float>::value = " << has_xyz, float>::value << "\n"; std::cout << "has_xyz, float>::value = " @@ -319,11 +314,11 @@ testInteropVec3() << has_xyz, float>::value << "\n"; std::cout << "\n"; std::cout << "has_subscript, float, 3>::value = " - << has_subscript, float, 3>::value << "\n"; + << has_subscript, float, 3>::value << "\n"; std::cout << "has_subscript, float, 3>::value = " - << has_subscript, float, 3>::value << "\n"; + << has_subscript, float, 3>::value << "\n"; std::cout << "has_subscript, float, 3>::value = " - << has_subscript, float, 3>::value << "\n"; + << has_subscript, float, 3>::value << "\n"; std::cout << "has_subscript, float, 3>::value = " << has_subscript, float, 3>::value << "\n"; std::cout << "has_subscript, float, 3>::value = " @@ -349,93 +344,92 @@ testInteropVec3() << has_subscript, float, 3>::value << "\n"; std::cout << "\n"; - assert((!has_xyz, float>::value)); - assert((has_xyz, float>::value)); - assert((!has_xyz, float>::value)); + assert ((!has_xyz, float>::value)); + assert ((has_xyz, float>::value)); + assert ((!has_xyz, float>::value)); - assert((has_subscript, float, 3>::value)); - assert((!has_subscript, float, 3>::value)); - assert((!has_subscript, int, 3>::value)); - assert((!has_subscript, float, 3>::value)); - assert((!has_subscript, float, 3>::value)); + assert ((has_subscript, float, 3>::value)); + assert ((!has_subscript, float, 3>::value)); + assert ((!has_subscript, int, 3>::value)); + assert ((!has_subscript, float, 3>::value)); + assert ((!has_subscript, float, 3>::value)); // Test construction/assignment/paramater pass of a vector type with // subscripting to access components. { - SimpleVec s; + SimpleVec s; s[0] = 1; s[1] = 2; s[2] = 3; - Vec3 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3); + Vec3 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3); - testVecVal3f(V3f(s), 1.0f, 42.0f, 3.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3); + testVecVal3f (V3f (s), 1.0f, 42.0f, 3.0f); } // Test construction/assignment/paramater pass of a vector type with // explicit .y, .y, .z components but no subscripting. { - xyz s { 1, 2, 3 }; - Vec3 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3); + xyz s{1, 2, 3}; + Vec3 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3); s.y = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3); - testVecVal3f(V3f(s), 1.0f, 42.0f, 3.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3); + testVecVal3f (V3f (s), 1.0f, 42.0f, 3.0f); } // Test construction/assignment/paramater pass of a std::vector of length 3 { - std::vector s { 1, 2, 3 }; - Vec3 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3); + std::vector s{1, 2, 3}; + Vec3 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3); - testVecVal3f(V3f(s), 1.0f, 42.0f, 3.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3); + testVecVal3f (V3f (s), 1.0f, 42.0f, 3.0f); } // Test construction/assignment/paramater pass of a std::array of length 3 { - std::array s { 1, 2, 3 }; - Vec3 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3); + std::array s{1, 2, 3}; + Vec3 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3); - testVecVal3f(V3f(s), 1.0f, 42.0f, 3.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3); + testVecVal3f (V3f (s), 1.0f, 42.0f, 3.0f); } // Test construction/assignment/paramater pass of initializer lists. { - Vec3 v({ 1.0f, 2.0f, 3.0f }); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3); - v = { 1.0f, 42.0f, 3.0f }; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3); - testVecVal3f({ 1.0f, 42.0f, 3.0f }, 1, 42, 3); + Vec3 v ({1.0f, 2.0f, 3.0f}); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3); + v = {1.0f, 42.0f, 3.0f}; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3); + testVecVal3f ({1.0f, 42.0f, 3.0f}, 1, 42, 3); } // Test construction/assignment/paramater pass of a C array { - float s[3] = { 1, 2, 3 }; - Vec3 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3); + float s[3] = {1, 2, 3}; + Vec3 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3); - testVecVal3f(V3f(s), 1.0f, 42.0f, 3.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3); + testVecVal3f (V3f (s), 1.0f, 42.0f, 3.0f); } } - //--------- void -testInteropVec4() +testInteropVec4 () { std::cout << "has_xyzw, float>::value = " - << has_xyzw, float>::value << "\n"; + << has_xyzw, float>::value << "\n"; std::cout << "has_xyzw, float>::value = " - << has_xyzw, float>::value << "\n"; + << has_xyzw, float>::value << "\n"; std::cout << "has_xyzw, float>::value = " - << has_xyzw, float>::value << "\n"; + << has_xyzw, float>::value << "\n"; std::cout << "has_xyzw, float>::value = " << has_xyzw, float>::value << "\n"; std::cout << "has_xyzw, float>::value = " @@ -448,11 +442,11 @@ testInteropVec4() << has_xyzw, float>::value << "\n"; std::cout << "\n"; std::cout << "has_subscript, float, 4>::value = " - << has_subscript, float, 4>::value << "\n"; + << has_subscript, float, 4>::value << "\n"; std::cout << "has_subscript, float, 4>::value = " - << has_subscript, float, 4>::value << "\n"; + << has_subscript, float, 4>::value << "\n"; std::cout << "has_subscript, float, 4>::value = " - << has_subscript, float, 4>::value << "\n"; + << has_subscript, float, 4>::value << "\n"; std::cout << "has_subscript, float, 4>::value = " << has_subscript, float, 4>::value << "\n"; std::cout << "has_subscript, float, 4>::value = " @@ -478,227 +472,235 @@ testInteropVec4() << has_subscript, float, 4>::value << "\n"; std::cout << "\n"; - assert((!has_xyzw, float>::value)); - assert((has_xyzw, float>::value)); - assert((!has_xyzw, float>::value)); + assert ((!has_xyzw, float>::value)); + assert ((has_xyzw, float>::value)); + assert ((!has_xyzw, float>::value)); - assert((has_subscript, float, 4>::value)); - assert((!has_subscript, float, 3>::value)); - assert((!has_subscript, int, 4>::value)); - assert((!has_subscript, float, 4>::value)); - assert((!has_subscript, float, 4>::value)); + assert ((has_subscript, float, 4>::value)); + assert ((!has_subscript, float, 3>::value)); + assert ((!has_subscript, int, 4>::value)); + assert ((!has_subscript, float, 4>::value)); + assert ((!has_subscript, float, 4>::value)); // Test construction/assignment/paramater pass of a vector type with // subscripting to access components. { - SimpleVec s; + SimpleVec s; s[0] = 1; s[1] = 2; s[2] = 3; s[3] = 4; - Vec4 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); + Vec4 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); - testVecVal4f(V4f(s), 1.0f, 42.0f, 3.0f, 4.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); + testVecVal4f (V4f (s), 1.0f, 42.0f, 3.0f, 4.0f); } // Test construction/assignment/paramater pass of a vector type with // explicit .y, .y, .z components but no subscripting. { - xyzw s { 1, 2, 3, 4 }; - Vec4 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); + xyzw s{1, 2, 3, 4}; + Vec4 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); s.y = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); - testVecVal4f(V4f(s), 1.0f, 42.0f, 3.0f, 4.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); + testVecVal4f (V4f (s), 1.0f, 42.0f, 3.0f, 4.0f); } // Test construction/assignment/paramater pass of a std::vector of length 3 { - std::vector s { 1, 2, 3, 4 }; - Vec4 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); + std::vector s{1, 2, 3, 4}; + Vec4 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); - testVecVal4f(V4f(s), 1.0f, 42.0f, 3.0f, 4.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); + testVecVal4f (V4f (s), 1.0f, 42.0f, 3.0f, 4.0f); } // Test construction/assignment/paramater pass of a std::array of length 3 { - std::array s { 1, 2, 3, 4 }; - Vec4 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); + std::array s{1, 2, 3, 4}; + Vec4 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); - testVecVal4f(V4f(s), 1.0f, 42.0f, 3.0f, 4.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); + testVecVal4f (V4f (s), 1.0f, 42.0f, 3.0f, 4.0f); } // Test construction/assignment/paramater pass of initializer lists. { - Vec4 v({ 1.0f, 2.0f, 3.0f, 4.0f }); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); - v = { 1.0f, 42.0f, 3.0f, 4.0f }; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); - testVecVal4f({ 1.0f, 42.0f, 3.0f, 4.0f }, 1, 42, 3, 4); + Vec4 v ({1.0f, 2.0f, 3.0f, 4.0f}); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); + v = {1.0f, 42.0f, 3.0f, 4.0f}; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); + testVecVal4f ({1.0f, 42.0f, 3.0f, 4.0f}, 1, 42, 3, 4); } // Test construction/assignment/paramater pass of a C array { - float s[4] = { 1, 2, 3, 4 }; - Vec4 v(s); - assert(v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); + float s[4] = {1, 2, 3, 4}; + Vec4 v (s); + assert (v[0] == 1 && v[1] == 2 && v[2] == 3 && v[3] == 4); s[1] = 42; - v = s; - assert(v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); - testVecVal4f(V4f(s), 1.0f, 42.0f, 3.0f, 4.0f); + v = s; + assert (v[0] == 1 && v[1] == 42 && v[2] == 3 && v[3] == 4); + testVecVal4f (V4f (s), 1.0f, 42.0f, 3.0f, 4.0f); } } - //--------- void -testInteropMx2() +testInteropMx2 () { - std::cout << "has_double_subscript, float, 2, 2>::value = " - << has_double_subscript, float, 2, 2>::value << "\n"; + std::cout + << "has_double_subscript, float, 2, 2>::value = " + << has_double_subscript, float, 2, 2>::value << "\n"; std::cout << "has_double_subscript, float, 2, 2>::value = " - << has_double_subscript, float, 2, 2>::value << "\n"; - std::cout << "has_double_subscript, float, 4, 4>::value = " - << has_double_subscript, float, 4, 4>::value << "\n"; + << has_double_subscript, float, 2, 2>::value + << "\n"; + std::cout + << "has_double_subscript, float, 4, 4>::value = " + << has_double_subscript, float, 4, 4>::value << "\n"; std::cout << "has_double_subscript, float, 2, 2>::value = " << has_double_subscript, float, 2, 2>::value << "\n"; std::cout << "has_double_subscript, float, 2, 2>::value = " - << has_double_subscript, float, 2, 2>::value << "\n"; + << has_double_subscript, float, 2, 2>::value + << "\n"; std::cout << "\n"; - assert((has_double_subscript, float, 2, 2>::value)); - assert((!has_double_subscript, float, 4, 4>::value)); - assert((!has_double_subscript, int, 2, 2>::value)); - assert((!has_double_subscript, float, 2, 2>::value)); - assert((!has_double_subscript, float, 2, 2>::value)); + assert ((has_double_subscript, float, 2, 2>::value)); + assert ((!has_double_subscript, float, 4, 4>::value)); + assert ((!has_double_subscript, int, 2, 2>::value)); + assert ((!has_double_subscript, float, 2, 2>::value)); + assert ((!has_double_subscript, float, 2, 2>::value)); // Test construction/assignment/paramater pass of a vector type with // subscripting to access components. { - Matrix22 ref; - SimpleMx s; + Matrix22 ref; + SimpleMx s; for (int j = 0; j < 2; ++j) for (int i = 0; i < 2; ++i) { s[j][i] = float(i + j * 2); ref[j][i] = float(i + j * 2); } - Matrix22 v(s); - assert(v[0][0] == 0 && v[0][1] == 1 && - v[1][0] == 2 && v[1][1] == 3); + Matrix22 v (s); + assert (v[0][0] == 0 && v[0][1] == 1 && v[1][0] == 2 && v[1][1] == 3); s[1][1] = 42; - v = s; - assert(v[0][0] == 0 && v[0][1] == 1 && - v[1][0] == 2 && v[1][1] == 42); + v = s; + assert (v[0][0] == 0 && v[0][1] == 1 && v[1][0] == 2 && v[1][1] == 42); } } - - void -testInteropMx3() +testInteropMx3 () { - std::cout << "has_double_subscript, float, 3, 3>::value = " - << has_double_subscript, float, 3, 3>::value << "\n"; + std::cout + << "has_double_subscript, float, 3, 3>::value = " + << has_double_subscript, float, 3, 3>::value << "\n"; std::cout << "has_double_subscript, float, 3, 3>::value = " - << has_double_subscript, float, 3, 3>::value << "\n"; - std::cout << "has_double_subscript, float, 4, 4>::value = " - << has_double_subscript, float, 4, 4>::value << "\n"; + << has_double_subscript, float, 3, 3>::value + << "\n"; + std::cout + << "has_double_subscript, float, 4, 4>::value = " + << has_double_subscript, float, 4, 4>::value << "\n"; std::cout << "has_double_subscript, float, 3, 3>::value = " << has_double_subscript, float, 3, 3>::value << "\n"; std::cout << "has_double_subscript, float, 3, 3>::value = " - << has_double_subscript, float, 3, 3>::value << "\n"; + << has_double_subscript, float, 3, 3>::value + << "\n"; std::cout << "\n"; - assert((has_double_subscript, float, 3, 3>::value)); - assert((!has_double_subscript, float, 4, 4>::value)); - assert((!has_double_subscript, int, 3, 3>::value)); - assert((!has_double_subscript, float, 3, 3>::value)); - assert((!has_double_subscript, float, 3, 3>::value)); + assert ((has_double_subscript, float, 3, 3>::value)); + assert ((!has_double_subscript, float, 4, 4>::value)); + assert ((!has_double_subscript, int, 3, 3>::value)); + assert ((!has_double_subscript, float, 3, 3>::value)); + assert ((!has_double_subscript, float, 3, 3>::value)); // Test construction/assignment/paramater pass of a vector type with // subscripting to access components. { - Matrix33 ref; - SimpleMx s; + Matrix33 ref; + SimpleMx s; for (int j = 0; j < 3; ++j) for (int i = 0; i < 3; ++i) { s[j][i] = float(i + j * 3); ref[j][i] = float(i + j * 3); } - Matrix33 v(s); - assert(v[0][0] == 0 && v[0][1] == 1 && v[0][2] == 2 && - v[1][0] == 3 && v[1][1] == 4 && v[1][2] == 5 && - v[2][0] == 6 && v[2][1] == 7 && v[2][2] == 8); + Matrix33 v (s); + assert ( + v[0][0] == 0 && v[0][1] == 1 && v[0][2] == 2 && v[1][0] == 3 && + v[1][1] == 4 && v[1][2] == 5 && v[2][0] == 6 && v[2][1] == 7 && + v[2][2] == 8); s[1][1] = 42; - v = s; - assert(v[0][0] == 0 && v[0][1] == 1 && v[0][2] == 2 && - v[1][0] == 3 && v[1][1] == 42 && v[1][2] == 5 && - v[2][0] == 6 && v[2][1] == 7 && v[2][2] == 8); + v = s; + assert ( + v[0][0] == 0 && v[0][1] == 1 && v[0][2] == 2 && v[1][0] == 3 && + v[1][1] == 42 && v[1][2] == 5 && v[2][0] == 6 && v[2][1] == 7 && + v[2][2] == 8); } } - - void -testInteropMx4() +testInteropMx4 () { - std::cout << "has_double_subscript, float, 4, 4>::value = " - << has_double_subscript, float, 4, 4>::value << "\n"; + std::cout + << "has_double_subscript, float, 4, 4>::value = " + << has_double_subscript, float, 4, 4>::value << "\n"; std::cout << "has_double_subscript, float, 4, 4>::value = " - << has_double_subscript, float, 4, 4>::value << "\n"; - std::cout << "has_double_subscript, float, 4, 4>::value = " - << has_double_subscript, float, 4, 4>::value << "\n"; + << has_double_subscript, float, 4, 4>::value + << "\n"; + std::cout + << "has_double_subscript, float, 4, 4>::value = " + << has_double_subscript, float, 4, 4>::value << "\n"; std::cout << "has_double_subscript, float, 4, 4>::value = " << has_double_subscript, float, 4, 4>::value << "\n"; std::cout << "has_double_subscript, float, 4, 4>::value = " - << has_double_subscript, float, 4, 4>::value << "\n"; + << has_double_subscript, float, 4, 4>::value + << "\n"; std::cout << "\n"; - assert((has_double_subscript, float, 4, 4>::value)); - assert((!has_double_subscript, float, 3, 3>::value)); - assert((!has_double_subscript, int, 4, 4>::value)); - assert((!has_double_subscript, float, 4, 4>::value)); - assert((!has_double_subscript, float, 4, 4>::value)); + assert ((has_double_subscript, float, 4, 4>::value)); + assert ((!has_double_subscript, float, 3, 3>::value)); + assert ((!has_double_subscript, int, 4, 4>::value)); + assert ((!has_double_subscript, float, 4, 4>::value)); + assert ((!has_double_subscript, float, 4, 4>::value)); // Test construction/assignment/paramater pass of a vector type with // subscripting to access components. { - Matrix44 ref; - SimpleMx s; + Matrix44 ref; + SimpleMx s; for (int j = 0; j < 4; ++j) for (int i = 0; i < 4; ++i) { s[j][i] = float(i + j * 4); ref[j][i] = float(i + j * 4); } - Matrix44 v(s); - assert(v[0][0] == 0 && v[0][1] == 1 && v[0][2] == 2 && v[0][3] == 3 && - v[1][0] == 4 && v[1][1] == 5 && v[1][2] == 6 && v[1][3] == 7 && - v[2][0] == 8 && v[2][1] == 9 && v[2][2] == 10 && v[2][3] == 11 && - v[3][0] == 12 && v[3][1] == 13 && v[3][2] == 14 && v[3][3] == 15); + Matrix44 v (s); + assert ( + v[0][0] == 0 && v[0][1] == 1 && v[0][2] == 2 && v[0][3] == 3 && + v[1][0] == 4 && v[1][1] == 5 && v[1][2] == 6 && v[1][3] == 7 && + v[2][0] == 8 && v[2][1] == 9 && v[2][2] == 10 && v[2][3] == 11 && + v[3][0] == 12 && v[3][1] == 13 && v[3][2] == 14 && v[3][3] == 15); s[1][1] = 42; - v = s; - assert(v[0][0] == 0 && v[0][1] == 1 && v[0][2] == 2 && v[0][3] == 3 && - v[1][0] == 4 && v[1][1] == 42 && v[1][2] == 6 && v[1][3] == 7 && - v[2][0] == 8 && v[2][1] == 9 && v[2][2] == 10 && v[2][3] == 11 && - v[3][0] == 12 && v[3][1] == 13 && v[3][2] == 14 && v[3][3] == 15); + v = s; + assert ( + v[0][0] == 0 && v[0][1] == 1 && v[0][2] == 2 && v[0][3] == 3 && + v[1][0] == 4 && v[1][1] == 42 && v[1][2] == 6 && v[1][3] == 7 && + v[2][0] == 8 && v[2][1] == 9 && v[2][2] == 10 && v[2][3] == 11 && + v[3][0] == 12 && v[3][1] == 13 && v[3][2] == 14 && v[3][3] == 15); } } } // namespace #endif - void -testInterop() +testInterop () { #if IMATH_FOREIGN_VECTOR_INTEROP @@ -708,9 +710,9 @@ testInterop() testInteropVec3 (); testInteropVec4 (); - testInteropMx2(); - testInteropMx3(); - testInteropMx4(); + testInteropMx2 (); + testInteropMx3 (); + testInteropMx4 (); cout << "ok\n" << endl; #else diff --git a/third_party/Imath-3.1.9/src/ImathTest/testInterop.h b/third_party/Imath/src/ImathTest/testInterop.h similarity index 82% rename from third_party/Imath-3.1.9/src/ImathTest/testInterop.h rename to third_party/Imath/src/ImathTest/testInterop.h index 9e3fd00e..c6ebc05f 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testInterop.h +++ b/third_party/Imath/src/ImathTest/testInterop.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testInterop(); +void testInterop (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testInterval.cpp b/third_party/Imath/src/ImathTest/testInterval.cpp similarity index 81% rename from third_party/Imath-3.1.9/src/ImathTest/testInterval.cpp rename to third_party/Imath/src/ImathTest/testInterval.cpp index 582e8ab2..66d9b4f8 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testInterval.cpp +++ b/third_party/Imath/src/ImathTest/testInterval.cpp @@ -36,14 +36,16 @@ testConstructors (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - assert (b.min == T (std::numeric_limits::max()) && b.max == T (std::numeric_limits::lowest())); + assert ( + b.min == T (std::numeric_limits::max ()) && + b.max == T (std::numeric_limits::lowest ())); } // // Single point // { - T p (42); + T p (42); IMATH_INTERNAL_NAMESPACE::Interval b (p); assert (b.min == p && b.max == p); } @@ -52,15 +54,15 @@ testConstructors (const char* type) // Min and max // { - T p0 (42); - T p1 (666); + T p0 (42); + T p1 (666); IMATH_INTERNAL_NAMESPACE::Interval b (p0, p1); assert (b.min == p0 && b.max == p1); } { - T p0 (666); - T p1 (42); + T p0 (666); + T p1 (42); IMATH_INTERNAL_NAMESPACE::Interval b (p0, p1); assert (b.min == p0 && b.max == p1); } @@ -77,8 +79,10 @@ testMakeEmpty (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - b.makeEmpty(); - assert (b.min == T (std::numeric_limits::max()) && b.max == T (std::numeric_limits::lowest())); + b.makeEmpty (); + assert ( + b.min == T (std::numeric_limits::max ()) && + b.max == T (std::numeric_limits::lowest ())); } // @@ -86,19 +90,23 @@ testMakeEmpty (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b (T (-1), T (1)); - b.makeEmpty(); - assert (b.min == T (std::numeric_limits::max()) && b.max == T (std::numeric_limits::lowest())); + b.makeEmpty (); + assert ( + b.min == T (std::numeric_limits::max ()) && + b.max == T (std::numeric_limits::lowest ())); } // // Non-empty, no volume // { - T min (0); - T max (10); + T min (0); + T max (10); IMATH_INTERNAL_NAMESPACE::Interval b (min, max); - b.makeEmpty(); - assert (b.min == T (std::numeric_limits::max()) && b.max == T (std::numeric_limits::lowest())); + b.makeEmpty (); + assert ( + b.min == T (std::numeric_limits::max ()) && + b.max == T (std::numeric_limits::lowest ())); } } @@ -113,8 +121,10 @@ testMakeInfinite (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - b.makeInfinite(); - assert (b.min == T (std::numeric_limits::lowest()) && b.max == T (std::numeric_limits::max())); + b.makeInfinite (); + assert ( + b.min == T (std::numeric_limits::lowest ()) && + b.max == T (std::numeric_limits::max ())); } // @@ -122,8 +132,10 @@ testMakeInfinite (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b (T (-1), T (1)); - b.makeInfinite(); - assert (b.min == T (std::numeric_limits::lowest()) && b.max == T (std::numeric_limits::max())); + b.makeInfinite (); + assert ( + b.min == T (std::numeric_limits::lowest ()) && + b.max == T (std::numeric_limits::max ())); } // @@ -134,8 +146,10 @@ testMakeInfinite (const char* type) T max (1); IMATH_INTERNAL_NAMESPACE::Interval b (min, max); - b.makeInfinite(); - assert (b.min == T (std::numeric_limits::lowest()) && b.max == T (std::numeric_limits::max())); + b.makeInfinite (); + assert ( + b.min == T (std::numeric_limits::lowest ()) && + b.max == T (std::numeric_limits::max ())); } } @@ -202,8 +216,10 @@ testExtendByInterval (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - b.extendBy (IMATH_INTERNAL_NAMESPACE::Interval()); - assert (b.min == T (std::numeric_limits::max()) && b.max == T (std::numeric_limits::lowest())); + b.extendBy (IMATH_INTERNAL_NAMESPACE::Interval ()); + assert ( + b.min == T (std::numeric_limits::max ()) && + b.max == T (std::numeric_limits::lowest ())); } // @@ -218,7 +234,7 @@ testExtendByInterval (const char* type) assert (b0.min == p0 && b0.max == p1); IMATH_INTERNAL_NAMESPACE::Interval b1 (p0, p1); - b1.extendBy (IMATH_INTERNAL_NAMESPACE::Interval()); + b1.extendBy (IMATH_INTERNAL_NAMESPACE::Interval ()); assert (b1.min == p0 && b1.max == p1); } @@ -226,7 +242,7 @@ testExtendByInterval (const char* type) // Extend non-empty interval with non-empty interval. Starts with empty, then builds. // IMATH_INTERNAL_NAMESPACE::Rand32 rand (0); - const unsigned int iters = 10; + const unsigned int iters = 10; { IMATH_INTERNAL_NAMESPACE::Interval b; @@ -316,7 +332,7 @@ testIntersects (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - T p (1); + T p (1); assert (!b.intersects (p)); } @@ -326,9 +342,9 @@ testIntersects (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b (T (-1), T (1)); - T p0 (0); - T p1 (5); - T p2 (-5); + T p0 (0); + T p1 (5); + T p2 (-5); assert (b.intersects (p0)); assert (!b.intersects (p1)); @@ -342,8 +358,8 @@ testIntersects (const char* type) T min (0); T max (1); - T p0 (0); - T p1 (5); + T p0 (0); + T p1 (5); IMATH_INTERNAL_NAMESPACE::Interval b (min, max); assert (b.intersects (p0)); @@ -381,8 +397,8 @@ testIntersects (const char* type) // { T min (0); - T max = min; - max[T::dimensions() - 1] = 1; + T max = min; + max[T::dimensions () - 1] = 1; IMATH_INTERNAL_NAMESPACE::Interval b0; IMATH_INTERNAL_NAMESPACE::Interval b1 (min, max); @@ -457,7 +473,7 @@ testSize (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - assert (b.size() == T (0)); + assert (b.size () == T (0)); } // @@ -465,12 +481,12 @@ testSize (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b0 (T (-1), T (1)); - assert (b0.size() == T (2)); - + assert (b0.size () == T (2)); + T p (42); IMATH_INTERNAL_NAMESPACE::Interval b1 (-p, p); - assert (b1.size() == p * T (2)); + assert (b1.size () == p * T (2)); } // @@ -482,7 +498,7 @@ testSize (const char* type) IMATH_INTERNAL_NAMESPACE::Interval b (min, max); - assert (b.size() == max); + assert (b.size () == max); } } @@ -497,7 +513,7 @@ testCenter (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - assert (b.center() == T (0)); + assert (b.center () == T (0)); } // @@ -505,13 +521,13 @@ testCenter (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b0 (T (-1), T (1)); - assert (b0.center() == T (0)); + assert (b0.center () == T (0)); T p0 (1); T p1 (2); IMATH_INTERNAL_NAMESPACE::Interval b1 (p0, p1); - assert (b1.center() == (p1 + p0) / 2); + assert (b1.center () == (p1 + p0) / 2); } // @@ -523,7 +539,7 @@ testCenter (const char* type) IMATH_INTERNAL_NAMESPACE::Interval b (min, max); - assert (b.center() == max / 2); + assert (b.center () == max / 2); } } @@ -538,7 +554,7 @@ testIsEmpty (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - assert (b.isEmpty()); + assert (b.isEmpty ()); } // @@ -546,12 +562,12 @@ testIsEmpty (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b0 (T (-1), T (1)); - assert (!b0.isEmpty()); + assert (!b0.isEmpty ()); - T p0 (2); - T p1 (4); + T p0 (2); + T p1 (4); IMATH_INTERNAL_NAMESPACE::Interval b1 (p0, p1); - assert (!b1.isEmpty()); + assert (!b1.isEmpty ()); } // @@ -563,7 +579,7 @@ testIsEmpty (const char* type) IMATH_INTERNAL_NAMESPACE::Interval b (min, max); - assert (!b.isEmpty()); + assert (!b.isEmpty ()); } } @@ -578,8 +594,8 @@ testIsInfinite (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - b.makeInfinite(); - assert (b.isInfinite()); + b.makeInfinite (); + assert (b.isInfinite ()); } // @@ -587,13 +603,13 @@ testIsInfinite (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b0 (T (-1), T (1)); - assert (!b0.isInfinite()); + assert (!b0.isInfinite ()); T p0 (2); T p1 (4); IMATH_INTERNAL_NAMESPACE::Interval b1 (p0, p1); - assert (!b1.isInfinite()); + assert (!b1.isInfinite ()); } // @@ -605,7 +621,7 @@ testIsInfinite (const char* type) IMATH_INTERNAL_NAMESPACE::Interval b (min, max); - assert (!b.isInfinite()); + assert (!b.isInfinite ()); } } @@ -620,7 +636,7 @@ testHasVolume (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - assert (!b.hasVolume()); + assert (!b.hasVolume ()); } // @@ -628,8 +644,8 @@ testHasVolume (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b; - b.makeInfinite(); - assert (b.hasVolume()); + b.makeInfinite (); + assert (b.hasVolume ()); } // @@ -637,13 +653,13 @@ testHasVolume (const char* type) // { IMATH_INTERNAL_NAMESPACE::Interval b0 (T (-1), T (1)); - assert (b0.hasVolume()); + assert (b0.hasVolume ()); T p0 (2); T p1 (4); IMATH_INTERNAL_NAMESPACE::Interval b1 (p0, p1); - assert (b1.hasVolume()); + assert (b1.hasVolume ()); } // @@ -654,8 +670,8 @@ testHasVolume (const char* type) T max (2); IMATH_INTERNAL_NAMESPACE::Interval b (min, max); - b.makeEmpty(); - assert (!b.hasVolume()); + b.makeEmpty (); + assert (!b.hasVolume ()); } } @@ -667,21 +683,21 @@ testStream (const char* type) T min (0); T max (1); - + IMATH_INTERNAL_NAMESPACE::Interval b (min, max); - std::stringstream s1; + std::stringstream s1; s1 << '(' << min << ' ' << max << ')'; std::stringstream s2; s2 << b; - assert (s1.str() == s2.str()); + assert (s1.str () == s2.str ()); } } // anonymous namespace void -testInterval() +testInterval () { cout << "Testing interval methods" << endl; @@ -708,7 +724,7 @@ testInterval() testMakeInfinite ("int"); testMakeInfinite ("float"); testMakeInfinite ("double"); - + // // extendBy() (point) // @@ -764,7 +780,7 @@ testInterval() testIsInfinite ("int"); testIsInfinite ("float"); testIsInfinite ("double"); - + // // hasVolume() // diff --git a/third_party/Imath-3.1.9/src/ImathTest/testInterval.h b/third_party/Imath/src/ImathTest/testInterval.h similarity index 81% rename from third_party/Imath-3.1.9/src/ImathTest/testInterval.h rename to third_party/Imath/src/ImathTest/testInterval.h index fefbe7bc..37f1ceac 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testInterval.h +++ b/third_party/Imath/src/ImathTest/testInterval.h @@ -2,4 +2,4 @@ // SPDX-License-Identifier: BSD-3-Clause // Copyright Contributors to the OpenEXR Project. // -void testInterval(); +void testInterval (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testInvert.cpp b/third_party/Imath/src/ImathTest/testInvert.cpp similarity index 91% rename from third_party/Imath-3.1.9/src/ImathTest/testInvert.cpp rename to third_party/Imath/src/ImathTest/testInvert.cpp index cf352605..32a30a69 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testInvert.cpp +++ b/third_party/Imath/src/ImathTest/testInvert.cpp @@ -7,11 +7,11 @@ # undef NDEBUG #endif +#include "testInvert.h" #include #include #include #include -#include "testInvert.h" using namespace std; using namespace IMATH_INTERNAL_NAMESPACE; @@ -20,10 +20,10 @@ namespace { void -invertM44f (const M44f &m, float e) +invertM44f (const M44f& m, float e) { - M44f inv1 = m.inverse(); - M44f inv2 = m.gjInverse(); + M44f inv1 = m.inverse (); + M44f inv2 = m.gjInverse (); M44f ident1 = m * inv1; M44f ident2 = m * inv2; @@ -35,12 +35,11 @@ invertM44f (const M44f &m, float e) assert (ident2.equalWithAbsError (identity44f, e)); } - void -invertM33f (const M33f &m, float e) +invertM33f (const M33f& m, float e) { - M33f inv1 = m.inverse(); - M33f inv2 = m.gjInverse(); + M33f inv1 = m.inverse (); + M33f inv2 = m.gjInverse (); M33f ident1 = m * inv1; M33f ident2 = m * inv2; @@ -52,17 +51,15 @@ invertM33f (const M33f &m, float e) assert (ident2.equalWithAbsError (identity33f, e)); } - } // namespace - void testInvert () { cout << "Testing 4x4 and 3x3 matrix inversion:" << endl; { - cout << "M44f" << endl; + cout << "M44f" << endl; // clang-format off @@ -101,7 +98,7 @@ testInvert () } { - cout << "M33f" << endl; + cout << "M33f" << endl; // clang-format off diff --git a/third_party/Imath-3.1.9/src/ImathTest/testInvert.h b/third_party/Imath/src/ImathTest/testInvert.h similarity index 83% rename from third_party/Imath-3.1.9/src/ImathTest/testInvert.h rename to third_party/Imath/src/ImathTest/testInvert.h index 2f27f174..aa5b12a2 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testInvert.h +++ b/third_party/Imath/src/ImathTest/testInvert.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testInvert(); +void testInvert (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testJacobiEigenSolver.cpp b/third_party/Imath/src/ImathTest/testJacobiEigenSolver.cpp similarity index 53% rename from third_party/Imath-3.1.9/src/ImathTest/testJacobiEigenSolver.cpp rename to third_party/Imath/src/ImathTest/testJacobiEigenSolver.cpp index 3b230923..b8aca0c5 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testJacobiEigenSolver.cpp +++ b/third_party/Imath/src/ImathTest/testJacobiEigenSolver.cpp @@ -64,43 +64,43 @@ verifyOrthonormal (const TM& A, const typename TM::BaseType threshold) template typename TM::BaseType -computeThreshold(const TM& A) +computeThreshold (const TM& A) { - typedef typename TM::BaseType T; - T maxAbsEntry(0); + typedef typename TM::BaseType T; + T maxAbsEntry (0); for (unsigned int i = 0; i < TM::dimensions (); ++i) for (unsigned int j = 0; j < TM::dimensions (); ++j) maxAbsEntry = std::max (maxAbsEntry, std::abs (A[i][j])); - const T eps = std::numeric_limits::epsilon(); - maxAbsEntry = std::max(maxAbsEntry, eps); + const T eps = std::numeric_limits::epsilon (); + maxAbsEntry = std::max (maxAbsEntry, eps); - return maxAbsEntry * T(100) * eps; + return maxAbsEntry * T (100) * eps; } -template +template void -testJacobiEigenSolver(const TM& A) +testJacobiEigenSolver (const TM& A) { using std::abs; - typedef typename TM::BaseType T; + typedef typename TM::BaseType T; typedef typename TM::BaseVecType TV; - const T threshold = computeThreshold(A); + const T threshold = computeThreshold (A); - TM AA(A); + TM AA (A); TV S; TM V; - jacobiEigenSolver(AA, S, V); + jacobiEigenSolver (AA, S, V); // Orthogonality of V - verifyOrthonormal(V, threshold); - + verifyOrthonormal (V, threshold); + // Determinant of V - assert(abs(V.determinant()) - 1 < threshold); + assert (abs (V.determinant ()) - 1 < threshold); // Determinant of A and S TM MS; @@ -111,175 +111,182 @@ testJacobiEigenSolver(const TM& A) else MS[i][j] = 0; - assert (abs (A.determinant()) - abs (MS.determinant()) < threshold); + assert (abs (A.determinant ()) - abs (MS.determinant ()) < threshold); // A = V * S * V^T - TM MA = V * MS * V.transposed(); + TM MA = V * MS * V.transposed (); for (unsigned int i = 0; i < TM::dimensions (); ++i) for (unsigned int j = 0; j < TM::dimensions (); ++j) assert (abs (A[i][j] - MA[i][j]) < threshold); } -template +template void -testMinMaxEigenValue(const TM& A) +testMinMaxEigenValue (const TM& A) { - typedef typename TM::BaseVecType TV; - typedef typename TM::BaseType T; - - TV minV, maxV, S; - TM U, V; - - const T threshold = computeThreshold(A); - - { - TM A1(A); - minEigenVector(A1, minV); - TM A2(A); - maxEigenVector(A2, maxV); - } - { - TM A3(A); - jacobiSVD(A3, U, S, V); - } - - const int dim = TM::dimensions(); + typedef typename TM::BaseVecType TV; + typedef typename TM::BaseType T; + + TV minV, maxV, S; + TM U, V; + + const T threshold = computeThreshold (A); + + { + TM A1 (A); + minEigenVector (A1, minV); + TM A2 (A); + maxEigenVector (A2, maxV); + } + { + TM A3 (A); + jacobiSVD (A3, U, S, V); + } + + const int dim = TM::dimensions (); for (int i = 0; i < dim; ++i) { - assert(abs(minV[i]-V[i][dim - 1]) < threshold); - assert(abs(maxV[i]-V[i][0]) < threshold); - } + assert (abs (minV[i] - V[i][dim - 1]) < threshold); + assert (abs (maxV[i] - V[i][0]) < threshold); + } } template void -testJacobiTiming() +testJacobiTiming () { - int rounds(100000); - clock_t tJacobi,tSVD, t; + int rounds (100000); + clock_t tJacobi, tSVD, t; { - Matrix33 A,V,U; - Vec3 S; + Matrix33 A, V, U; + Vec3 S; - t = clock(); + t = clock (); for (int i = 0; i < rounds; ++i) { - A = Matrix33(A33_7); - jacobiEigenSolver(A, S, V); - A = Matrix33(A33_8); - jacobiEigenSolver(A, S, V); + A = Matrix33 (A33_7); + jacobiEigenSolver (A, S, V); + A = Matrix33 (A33_8); + jacobiEigenSolver (A, S, V); } - tJacobi = clock() - t; - cout << "Jacobi EigenSolver of 3x3 matrices took " << tJacobi << " clocks." << endl; + tJacobi = clock () - t; + cout << "Jacobi EigenSolver of 3x3 matrices took " << tJacobi + << " clocks." << endl; - t = clock(); + t = clock (); for (int i = 0; i < rounds; ++i) { - A = Matrix33(A33_7); - jacobiSVD(A, U, S, V); - A = Matrix33(A33_8); - jacobiSVD(A, U, S, V); + A = Matrix33 (A33_7); + jacobiSVD (A, U, S, V); + A = Matrix33 (A33_8); + jacobiSVD (A, U, S, V); } - tSVD = clock() - t; - cout << "TinySVD of 3x3 matrices took " << tSVD << " clocks." << endl; - cout << (float)(tSVD-tJacobi)*100.0f/(float)(tSVD) << "% speed up." << endl; + tSVD = clock () - t; + cout << "TinySVD of 3x3 matrices took " << tSVD << " clocks." + << endl; + cout << (float) (tSVD - tJacobi) * 100.0f / (float) (tSVD) + << "% speed up." << endl; } { - Matrix44 A,V,U; - Vec4 S; + Matrix44 A, V, U; + Vec4 S; - t = clock(); + t = clock (); for (int i = 0; i < rounds; ++i) { - A = Matrix44(A44_7); - jacobiEigenSolver(A, S, V); - A = Matrix44(A44_8); - jacobiEigenSolver(A, S, V); + A = Matrix44 (A44_7); + jacobiEigenSolver (A, S, V); + A = Matrix44 (A44_8); + jacobiEigenSolver (A, S, V); } - tJacobi = clock() - t; - cout << "Jacobi EigenSolver of 4x4 matrices took " << tJacobi << " clocks" << endl; + tJacobi = clock () - t; + cout << "Jacobi EigenSolver of 4x4 matrices took " << tJacobi + << " clocks" << endl; - t = clock(); + t = clock (); for (int i = 0; i < rounds; ++i) { - A = Matrix44(A44_7); - jacobiSVD(A, U, S, V); - A = Matrix44(A44_8); - jacobiSVD(A, U, S, V); + A = Matrix44 (A44_7); + jacobiSVD (A, U, S, V); + A = Matrix44 (A44_8); + jacobiSVD (A, U, S, V); } - tSVD = clock() - t; - cout << "TinySVD of 4x4 matrices took " << tSVD << " clocks" << endl; - cout << (float)(tSVD-tJacobi)*100.0f/(float)(tSVD) << "% speed up." << endl; + tSVD = clock () - t; + cout << "TinySVD of 4x4 matrices took " << tSVD << " clocks" + << endl; + cout << (float) (tSVD - tJacobi) * 100.0f / (float) (tSVD) + << "% speed up." << endl; } } template void -testJacobiEigenSolverImp() +testJacobiEigenSolverImp () { - testJacobiEigenSolver(Matrix33(A33_1)); - testJacobiEigenSolver(Matrix33(A33_2)); - testJacobiEigenSolver(Matrix33(A33_3)); - testJacobiEigenSolver(Matrix33(A33_4)); - testJacobiEigenSolver(Matrix33(A33_5)); - testJacobiEigenSolver(Matrix33(A33_6)); - testJacobiEigenSolver(Matrix33(A33_7)); - testJacobiEigenSolver(Matrix33(A33_8)); - - testJacobiEigenSolver(Matrix44(A44_1)); - testJacobiEigenSolver(Matrix44(A44_2)); - testJacobiEigenSolver(Matrix44(A44_3)); - testJacobiEigenSolver(Matrix44(A44_4)); - testJacobiEigenSolver(Matrix44(A44_5)); - testJacobiEigenSolver(Matrix44(A44_6)); - testJacobiEigenSolver(Matrix44(A44_7)); - testJacobiEigenSolver(Matrix44(A44_8)); + testJacobiEigenSolver (Matrix33 (A33_1)); + testJacobiEigenSolver (Matrix33 (A33_2)); + testJacobiEigenSolver (Matrix33 (A33_3)); + testJacobiEigenSolver (Matrix33 (A33_4)); + testJacobiEigenSolver (Matrix33 (A33_5)); + testJacobiEigenSolver (Matrix33 (A33_6)); + testJacobiEigenSolver (Matrix33 (A33_7)); + testJacobiEigenSolver (Matrix33 (A33_8)); + + testJacobiEigenSolver (Matrix44 (A44_1)); + testJacobiEigenSolver (Matrix44 (A44_2)); + testJacobiEigenSolver (Matrix44 (A44_3)); + testJacobiEigenSolver (Matrix44 (A44_4)); + testJacobiEigenSolver (Matrix44 (A44_5)); + testJacobiEigenSolver (Matrix44 (A44_6)); + testJacobiEigenSolver (Matrix44 (A44_7)); + testJacobiEigenSolver (Matrix44 (A44_8)); } template void -testMinMaxEigenValueImp() +testMinMaxEigenValueImp () { - testMinMaxEigenValue(Matrix33(A33_7)); - testMinMaxEigenValue(Matrix33(A33_8)); + testMinMaxEigenValue (Matrix33 (A33_7)); + testMinMaxEigenValue (Matrix33 (A33_8)); - testMinMaxEigenValue(Matrix44(A44_7)); - testMinMaxEigenValue(Matrix44(A44_8)); + testMinMaxEigenValue (Matrix44 (A44_7)); + testMinMaxEigenValue (Matrix44 (A44_8)); } void -testJacobiEigenSolver() +testJacobiEigenSolver () { cout << endl; - cout << "************ Testing IMATH_INTERNAL_NAMESPACE::ImathJacobiEigenSolver ************" - << endl; - + cout + << "************ Testing IMATH_INTERNAL_NAMESPACE::ImathJacobiEigenSolver ************" + << endl; + cout << "Jacobi EigenSolver in single precision..."; - testJacobiEigenSolverImp(); + testJacobiEigenSolverImp (); cout << "PASS" << endl; cout << "Jacobi EigenSolver in double precision..."; - testJacobiEigenSolverImp(); + testJacobiEigenSolverImp (); cout << "PASS" << endl; cout << "Min/Max EigenValue in single precision..."; - testMinMaxEigenValueImp(); + testMinMaxEigenValueImp (); cout << "PASS" << endl; cout << "Min/Max EigenValue in double precision..."; - testMinMaxEigenValueImp(); + testMinMaxEigenValueImp (); cout << "PASS" << endl; cout << "Timing Jacobi EigenSolver in single precision...\n"; - testJacobiTiming(); + testJacobiTiming (); cout << "Timing Jacobi EigenSolver in double precision...\n"; - testJacobiTiming(); - + testJacobiTiming (); + cout << "************ ALL PASS ************" << endl; } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testJacobiEigenSolver.h b/third_party/Imath/src/ImathTest/testJacobiEigenSolver.h similarity index 75% rename from third_party/Imath-3.1.9/src/ImathTest/testJacobiEigenSolver.h rename to third_party/Imath/src/ImathTest/testJacobiEigenSolver.h index 2e9dbcd6..e7b7bd97 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testJacobiEigenSolver.h +++ b/third_party/Imath/src/ImathTest/testJacobiEigenSolver.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testJacobiEigenSolver(); +void testJacobiEigenSolver (); diff --git a/third_party/Imath/src/ImathTest/testLimits.cpp b/third_party/Imath/src/ImathTest/testLimits.cpp new file mode 100644 index 00000000..8b05b6b0 --- /dev/null +++ b/third_party/Imath/src/ImathTest/testLimits.cpp @@ -0,0 +1,209 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#ifdef NDEBUG +# undef NDEBUG +#endif + +#include "testLimits.h" +#include "half.h" +#include +#include +#include + +using namespace std; + +namespace +{ + +float +mypow (int x, int y) +{ + bool negative = false; + + if (y < 0) + { + negative = true; + y = -y; + } + + float z = 1; + + while (y > 0) + { + z *= x; + y -= 1; + } + + if (negative) z = 1 / z; + + return z; +} + +} // namespace + +void +testLimits () +{ + cout << "values in std::numeric_limits\n"; + + cout << "min_exponent\n"; + + { + half h (mypow (2, numeric_limits::min_exponent - 1)); + assert (h.isNormalized ()); + } + + { + half h (mypow (2, numeric_limits::min_exponent - 2)); + assert (h.isDenormalized ()); + } + + cout << "max_exponent\n"; + + { + half h (mypow (2, numeric_limits::max_exponent - 1)); + assert (h.isNormalized ()); + } + + { + half h (mypow (2, numeric_limits::max_exponent)); + assert (h.isInfinity ()); + } + + cout << "min_exponent10\n"; + + { + half h (mypow (10, numeric_limits::min_exponent10)); + assert (h.isNormalized ()); + } + + { + half h (mypow (10, numeric_limits::min_exponent10 - 1)); + assert (h.isDenormalized ()); + } + + cout << "max_exponent10\n"; + + { + half h (mypow (10, numeric_limits::max_exponent10)); + assert (h.isNormalized ()); + } + + { + half h (mypow (10, numeric_limits::max_exponent10 + 1)); + assert (h.isInfinity ()); + } + +#if __cplusplus >= 201103L + + cout << "max_digits10\n"; + assert ( + numeric_limits::max_digits10 == + std::ceil (numeric_limits::digits * std::log10 (2) + 1)); + + cout << "lowest\n"; + assert (numeric_limits::lowest () == -HALF_MAX); + +#endif + + cout << "ok\n\n" << flush; +} + +void +testHalfLimits () +{ + cout << "values in std::numeric_limits\n"; + + // For reference: + printf ( + "HALF_DENORM_MIN %g -> 0x%04x\n", + (float) HALF_DENORM_MIN, + half (HALF_DENORM_MIN).bits ()); + printf ( + "HALF_NRM_MIN %g -> 0x%04x\n", + (float) HALF_NRM_MIN, + half (HALF_NRM_MIN).bits ()); + printf ( + "HALF_MIN %g -> 0x%04x\n", (float) HALF_MIN, half (HALF_MIN).bits ()); + printf ( + "HALF_MAX %g -> 0x%04x\n", (float) HALF_MAX, half (HALF_MAX).bits ()); + printf ( + "HALF_LOWEST %g -> 0x%04x\n", + (float) -HALF_MAX, + half (-HALF_MAX).bits ()); + printf ( + "HALF_EPSILON %g -> 0x%04x\n", + (float) HALF_EPSILON, + half (HALF_EPSILON).bits ()); + printf ( + "half posInf %g -> 0x%04x\n", + (float) half::posInf (), + half::posInf ().bits ()); + printf ( + "half negInf %g -> 0x%04x\n", + (float) half::negInf (), + half::negInf ().bits ()); + printf ( + "half qNan %g -> 0x%04x\n", + (float) half::qNan (), + half::qNan ().bits ()); + printf ( + "half sNan %g -> 0x%04x\n", + (float) half::sNan (), + half::sNan ().bits ()); + printf ( + "numeric_limits min %g -> 0x%04x\n", + (float) std::numeric_limits::min (), + std::numeric_limits::min ().bits ()); + printf ( + "numeric_limits max %g -> 0x%04x\n", + (float) std::numeric_limits::max (), + std::numeric_limits::max ().bits ()); + printf ( + "numeric_limits lowest %g -> 0x%04x\n", + (float) std::numeric_limits::lowest (), + std::numeric_limits::lowest ().bits ()); + printf ( + "numeric_limits epsilon %g -> 0x%04x\n", + (float) std::numeric_limits::epsilon (), + std::numeric_limits::epsilon ().bits ()); + printf ( + "numeric_limits round_error %g -> 0x%04x\n", + (float) std::numeric_limits::round_error (), + std::numeric_limits::round_error ().bits ()); + printf ( + "numeric_limits infinity %g -> 0x%04x\n", + (float) std::numeric_limits::infinity (), + std::numeric_limits::infinity ().bits ()); + printf ( + "numeric_limits quiet_NaN %g -> 0x%04x\n", + (float) std::numeric_limits::quiet_NaN (), + std::numeric_limits::quiet_NaN ().bits ()); + printf ( + "numeric_limits signaling_NaN %g -> 0x%04x\n", + (float) std::numeric_limits::signaling_NaN (), + std::numeric_limits::signaling_NaN ().bits ()); + printf ( + "numeric_limits denorm_min %g -> 0x%04x\n", + (float) std::numeric_limits::denorm_min (), + std::numeric_limits::denorm_min ().bits ()); + + assert (std::numeric_limits::max () == half (HALF_MAX)); + assert (std::numeric_limits::min () == half (HALF_NRM_MIN)); + assert (std::numeric_limits::denorm_min () == half (HALF_DENORM_MIN)); + assert (std::numeric_limits::lowest () == half (-HALF_MAX)); + assert (std::numeric_limits::epsilon () == half (HALF_EPSILON)); + assert (std::numeric_limits::infinity () == half::posInf ()); + assert ( + std::numeric_limits::quiet_NaN ().bits () == + half::qNan ().bits ()); + assert ( + std::numeric_limits::signaling_NaN ().bits () == + half::sNan ().bits ()); + assert (std::numeric_limits::infinity () == half::posInf ()); + + cout << "ok\n\n" << flush; +} diff --git a/third_party/Imath/src/ImathTest/testLimits.h b/third_party/Imath/src/ImathTest/testLimits.h new file mode 100644 index 00000000..f91d9449 --- /dev/null +++ b/third_party/Imath/src/ImathTest/testLimits.h @@ -0,0 +1,7 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +void testLimits (); +void testHalfLimits (); diff --git a/third_party/Imath/src/ImathTest/testLineAlgo.cpp b/third_party/Imath/src/ImathTest/testLineAlgo.cpp new file mode 100644 index 00000000..ea873840 --- /dev/null +++ b/third_party/Imath/src/ImathTest/testLineAlgo.cpp @@ -0,0 +1,461 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#ifdef NDEBUG +# undef NDEBUG +#endif + +#include "testLineAlgo.h" +#include +#include +#include +#include + +// Include ImathForward *after* other headers to validate forward declarations +#include + +using namespace std; +using namespace IMATH_INTERNAL_NAMESPACE; + +namespace +{ + +void +testClosestPoints ( + const Line3f& line1, + const Line3f& line2, + bool returnValue, + const V3f& point1, + const V3f& point2) +{ + V3f p1; + V3f p2; + bool rv = closestPoints (line1, line2, p1, p2); + + assert (rv == returnValue); + + if (rv) + { + float e = 10 * std::numeric_limits::epsilon (); + assert (point1.equalWithAbsError (p1, e)); + assert (point2.equalWithAbsError (p2, e)); + } +} + +void +testClosestPoints () +{ + cout << "closest points on two lines" << endl; + + cout << " non-intersecting, non-parallel lines" << endl; + + testClosestPoints ( + Line3f (V3f (0, -1, -1), V3f (0, 1, -1)), + Line3f (V3f (-1, 0, 1), V3f (1, 0, 1)), + true, + V3f (0, 0, -1), + V3f (0, 0, 1)); + + testClosestPoints ( + Line3f (V3f (2, -1, -1), V3f (2, 1, -1)), + Line3f (V3f (-1, 3, 1), V3f (1, 3, 1)), + true, + V3f (2, 3, -1), + V3f (2, 3, 1)); + + cout << " intersecting, non-parallel lines" << endl; + + testClosestPoints ( + Line3f (V3f (2, -1, 0), V3f (2, 1, 0)), + Line3f (V3f (-1, 3, 0), V3f (1, 3, 0)), + true, + V3f (2, 3, 0), + V3f (2, 3, 0)); + + cout << " parallel lines" << endl; + + testClosestPoints ( + Line3f (V3f (2, -1, 0), V3f (2, 1, 0)), + Line3f (V3f (2, -1, 1), V3f (2, 1, 1)), + false, + V3f (0, 0, 0), + V3f (0, 0, 0)); + + testClosestPoints ( + Line3f (V3f (2, -1, 0), V3f (2, 1, 0)), + Line3f (V3f (2, 1, 1), V3f (2, -1, 1)), + false, + V3f (0, 0, 0), + V3f (0, 0, 0)); + + cout << " coincident lines" << endl; + + testClosestPoints ( + Line3f (V3f (2, -1, 0), V3f (2, -1, 1)), + Line3f (V3f (2, -1, 0), V3f (2, -1, 1)), + false, + V3f (0, 0, 0), + V3f (0, 0, 0)); + + cout << " random lines" << endl; + + Rand48 rand (7); + + for (int i = 0; i < 10000; ++i) + { + Line3f line1 ( + solidSphereRand (rand) * 100.f, + solidSphereRand (rand) * 100.f); + + Line3f line2 ( + solidSphereRand (rand) * 100.f, + solidSphereRand (rand) * 100.f); + + V3f point1; + V3f point2; + bool rv = closestPoints (line1, line2, point1, point2); + + if (rv) + { + // + // We test if the line that connects point1 and point2 + // is perpendicular to line1 and line2. The numerical + // accuracy of point1 and point2 depends strongly on + // the relative directions of line1 and line2; accuracy + // degrades rather quickly if line1 and line2 become + // close to parallel. + // + + float e = 2000 * std::numeric_limits::epsilon (); + float d = 1 - (line1.dir ^ line2.dir) * (line1.dir ^ line2.dir); + V3f n = point1 - point2; + + assert (equalWithAbsError (0.0f, (line1.dir ^ n) * d, e)); + assert (equalWithAbsError (0.0f, (line2.dir ^ n) * d, e)); + } + } +} + +void +testIntersect ( + const Line3f& line, + const V3f& v0, + const V3f& v1, + const V3f& v2, + const V3f& point, + bool front, + bool returnValue) +{ + V3f pt; + V3f bary; + bool fr; + + bool rv = intersect (line, v0, v1, v2, pt, bary, fr); + + assert (rv == returnValue); + + float e = 10 * std::numeric_limits::epsilon (); + + if (rv) + { + assert (front == fr); + assert (pt.equalWithAbsError (point, e)); + V3f pt2 = v0 * bary.x + v1 * bary.y + v2 * bary.z; + assert (pt.equalWithAbsError (pt2, e)); + } +} + +void +testIntersect () +{ + cout << "line-triangle intersection" << endl; + + cout << " line-plane intersection inside triangle" << endl; + + testIntersect ( + Line3f (V3f (0, 0, -1), V3f (0, 0, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 7), + true, + true); + + testIntersect ( + Line3f (V3f (0, 0, -1), V3f (-1, -2, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (-1, -2, 7), + true, + true); + + testIntersect ( + Line3f (V3f (0, 0, -1), V3f (-1, 1, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (-1, 1, 7), + true, + true); + + testIntersect ( + Line3f (V3f (0, 0, -1), V3f (-1, 1, 7)), + V3f (4, -4, 7), + V3f (-4, -4, 7), + V3f (0, 6, 7), + V3f (-1, 1, 7), + false, + true); + + testIntersect ( + Line3f (V3f (1, 1, 2), V3f (0, 0, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 7), + true, + true); + + testIntersect ( + Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (-1, -2, 7), + true, + true); + + testIntersect ( + Line3f (V3f (2, 8, -10), V3f (-1, 1, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (-1, 1, 7), + true, + true); + + testIntersect ( + Line3f (V3f (-10, 2, -1), V3f (-1, 1, 7)), + V3f (4, -4, 7), + V3f (-4, -4, 7), + V3f (0, 6, 7), + V3f (-1, 1, 7), + false, + true); + + cout << " line-plane intersection outside triangle" << endl; + + testIntersect ( + Line3f (V3f (0, 0, -1), V3f (4, 0, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 0), + false, + false); + + testIntersect ( + Line3f (V3f (0, 0, -1), V3f (-4, 1, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 0), + false, + false); + + testIntersect ( + Line3f (V3f (0, 0, -1), V3f (0, -5, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 0), + false, + false); + + testIntersect ( + Line3f (V3f (0, 0, -1), V3f (0, -7, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 0), + false, + false); + + cout << " line parallel to triangle" << endl; + + testIntersect ( + Line3f (V3f (0, 0, -1), V3f (4, 0, -1)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 0), + false, + false); + + testIntersect ( + Line3f (V3f (0, 4, 7), V3f (4, 0, 7)), + V3f (-4, -4, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 0), + false, + false); + + cout << " zero-area triangle" << endl; + + testIntersect ( + Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), + V3f (0, 6, 7), + V3f (4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 0), + false, + false); + + testIntersect ( + Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), + V3f (-4, -4, 7), + V3f (-4, -4, 7), + V3f (0, 6, 7), + V3f (0, 0, 0), + false, + false); + + testIntersect ( + Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), + V3f (-4, -4, 7), + V3f (0, 6, 7), + V3f (0, 6, 7), + V3f (0, 0, 0), + false, + false); + + testIntersect ( + Line3f (V3f (2, 3, -5), V3f (-1, -2, 7)), + V3f (-4, -4, 7), + V3f (-4, -4, 7), + V3f (-4, -4, 7), + V3f (0, 0, 0), + false, + false); + + cout << " random lines and triangles" << endl; + + Rand48 rand (8); + + for (int i = 0; i < 10000; ++i) + { + // + // Generate a random triangle with non-zero area + // + + V3f v0, v1, v2; + V3f normal; + + do + { + v0 = solidSphereRand (rand); + v1 = solidSphereRand (rand); + v2 = solidSphereRand (rand); + normal = (v2 - v1) % (v1 - v0); + } while (normal.length () < 0.01); + + { + // + // Generate a line that intersects inside the triangle + // + + V3f b; + + do + { + b.x = float(rand.nextf (0.001, 0.999)); + b.y = float(rand.nextf (0.001, 0.999)); + b.z = 1 - b.x - b.y; + } while (b.x + b.y > 0.999); + + V3f p1 = v0 * b.x + v1 * b.y + v2 * b.z; + + V3f p0; + + do + { + p0 = solidSphereRand (rand); + } while (abs (normal.normalized () ^ (p1 - p0).normalized ()) < + 0.1); + + // + // Test for intersection + // + + V3f point; + V3f bary; + bool front; + + bool rv = + intersect (Line3f (p0, p1), v0, v1, v2, point, bary, front); + + assert (rv == true); + + float nd = abs (normal.normalized () ^ (p1 - p0).normalized ()); + float ep = 20 * std::numeric_limits::epsilon () / nd; + + assert (point.equalWithAbsError (p1, ep)); + } + + { + // + // Generate a line that intersects the triangle's plane + // but outside the triangle + // + + V3f b; + + do + { + b.x = float(rand.nextf (-3, 3)); + b.y = float(rand.nextf (-3, 3)); + b.z = 1 - b.x - b.y; + } while (b.x > -0.001 && b.y > -0.001 && b.z > -0.001); + + V3f p1 = v0 * b.x + v1 * b.y + v2 * b.z; + + V3f p0; + + do + { + p0 = solidSphereRand (rand) * 10; + } while (abs (normal.normalized () ^ (p1 - p0).normalized ()) < + 0.1); + + // + // Test for intersection + // + + V3f point; + V3f bary; + bool front; + + bool rv = + intersect (Line3f (p0, p1), v0, v1, v2, point, bary, front); + + assert (rv == false); + } + } +} + +} // namespace + +void +testLineAlgo () +{ + cout << "Testing line algorithms" << endl; + + testClosestPoints (); + testIntersect (); + + cout << "ok\n" << endl; +} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testLineAlgo.h b/third_party/Imath/src/ImathTest/testLineAlgo.h similarity index 81% rename from third_party/Imath-3.1.9/src/ImathTest/testLineAlgo.h rename to third_party/Imath/src/ImathTest/testLineAlgo.h index bfd81ca5..274dd24a 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testLineAlgo.h +++ b/third_party/Imath/src/ImathTest/testLineAlgo.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testLineAlgo(); +void testLineAlgo (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testMatrix.cpp b/third_party/Imath/src/ImathTest/testMatrix.cpp similarity index 63% rename from third_party/Imath-3.1.9/src/ImathTest/testMatrix.cpp rename to third_party/Imath/src/ImathTest/testMatrix.cpp index 28d3a06b..d718b7ca 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testMatrix.cpp +++ b/third_party/Imath/src/ImathTest/testMatrix.cpp @@ -7,6 +7,7 @@ # undef NDEBUG #endif +#include "testMatrix.h" #include #include #include @@ -15,7 +16,6 @@ #include #include #include -#include "testMatrix.h" #include // Include ImathForward *after* other headers to validate forward declarations @@ -64,13 +64,13 @@ testMatrix () union { float f; - int i; + int i; } nanf; nanf.i = 0x7f800001; // NAN union { - double d; + double d; uint64_t i; } nand; nand.i = 0x7ff0000000000001ULL; // NAN @@ -89,7 +89,7 @@ testMatrix () assert (test != test2); IMATH_INTERNAL_NAMESPACE::M22f test3; - test3.makeIdentity(); + test3.makeIdentity (); assert (test2 == test3); const float a[2][2] = { @@ -133,12 +133,13 @@ testMatrix () assert (test != test2); IMATH_INTERNAL_NAMESPACE::M22d test3; - test3.makeIdentity(); + test3.makeIdentity (); assert (test2 == test3); IMATH_INTERNAL_NAMESPACE::M22f test4 (1.0f, 2.0f, 3.0f, 4.0f); - IMATH_INTERNAL_NAMESPACE::M22d test5 = IMATH_INTERNAL_NAMESPACE::M22d (test4); + IMATH_INTERNAL_NAMESPACE::M22d test5 = + IMATH_INTERNAL_NAMESPACE::M22d (test4); assert (test5[0][0] == 1.0); assert (test5[0][1] == 2.0); @@ -159,17 +160,17 @@ testMatrix () IMATH_INTERNAL_NAMESPACE::M22f m1 (3.0f, 3.0f, 5.0f, 5.0f); IMATH_INTERNAL_NAMESPACE::M22f m2 = m1; - assert(m1.inverse(false) == m1.inverse()); - m2.invert(false); - m1.invert(); - assert(m1 == m2); + assert (m1.inverse (false) == m1.inverse ()); + m2.invert (false); + m1.invert (); + assert (m1 == m2); IMATH_INTERNAL_NAMESPACE::M22f m3 (4.0f, 7.0f, 2.0f, 6.0f); m2 = m3; - assert(m2.inverse(true) == m2.inverse()); - m3.invert(true); - m2.invert(); - assert(m3 == m2); + assert (m2.inverse (true) == m2.inverse ()); + m3.invert (true); + m2.invert (); + assert (m3 == m2); } { @@ -177,24 +178,28 @@ testMatrix () IMATH_INTERNAL_NAMESPACE::M33f m1, m2; m1.setShear (2.0f); - assert (m1[0][0] == 1.0f && m1[0][1] == 0.0f && m1[0][2] == 0.0f && m1[1][0] == 2.0f && - m1[1][1] == 1.0f && m1[1][2] == 0.0f && m1[2][0] == 0.0f && m1[2][1] == 0.0f && - m1[2][2] == 1.0f); + assert ( + m1[0][0] == 1.0f && m1[0][1] == 0.0f && m1[0][2] == 0.0f && + m1[1][0] == 2.0f && m1[1][1] == 1.0f && m1[1][2] == 0.0f && + m1[2][0] == 0.0f && m1[2][1] == 0.0f && m1[2][2] == 1.0f); m2.setShear (IMATH_INTERNAL_NAMESPACE::V2f (3.0f, 4.0f)); - assert (m2[0][0] == 1.0f && m2[0][1] == 4.0f && m2[0][2] == 0.0f && m2[1][0] == 3.0f && - m2[1][1] == 1.0f && m2[1][2] == 0.0f && m2[2][0] == 0.0f && m2[2][1] == 0.0f && - m2[2][2] == 1.0f); + assert ( + m2[0][0] == 1.0f && m2[0][1] == 4.0f && m2[0][2] == 0.0f && + m2[1][0] == 3.0f && m2[1][1] == 1.0f && m2[1][2] == 0.0f && + m2[2][0] == 0.0f && m2[2][1] == 0.0f && m2[2][2] == 1.0f); m1.shear (IMATH_INTERNAL_NAMESPACE::V2f (5.0f, 6.0f)); - assert (m1[0][0] == 13.0f && m1[0][1] == 6.0f && m1[0][2] == 0.0f && m1[1][0] == 7.0f && - m1[1][1] == 1.0f && m1[1][2] == 0.0f && m1[2][0] == 0.0f && m1[2][1] == 0.0f && - m1[2][2] == 1.0f); + assert ( + m1[0][0] == 13.0f && m1[0][1] == 6.0f && m1[0][2] == 0.0f && + m1[1][0] == 7.0f && m1[1][1] == 1.0f && m1[1][2] == 0.0f && + m1[2][0] == 0.0f && m1[2][1] == 0.0f && m1[2][2] == 1.0f); m2.shear (7.0f); - assert (m2[0][0] == 1.0f && m2[0][1] == 4.0f && m2[0][2] == 0.0f && m2[1][0] == 10.0f && - m2[1][1] == 29.0f && m2[1][2] == 0.0f && m2[2][0] == 0.0f && m2[2][1] == 0.0f && - m2[2][2] == 1.0f); + assert ( + m2[0][0] == 1.0f && m2[0][1] == 4.0f && m2[0][2] == 0.0f && + m2[1][0] == 10.0f && m2[1][1] == 29.0f && m2[1][2] == 0.0f && + m2[2][0] == 0.0f && m2[2][1] == 0.0f && m2[2][2] == 1.0f); cout << "M33f constructors and equality operators" << endl; @@ -205,7 +210,7 @@ testMatrix () assert (test != test2); IMATH_INTERNAL_NAMESPACE::M33f test3; - test3.makeIdentity(); + test3.makeIdentity (); assert (test2 == test3); m1 = 42; @@ -240,35 +245,39 @@ testMatrix () } { - cout << "M33f inversion operators" << endl; + cout << "M33f inversion operators" << endl; - IMATH_INTERNAL_NAMESPACE::M33f m1 (0.0f, 2.0f, -1.0f, 3.0f, -2.0f, 1.0f, 3.0f, 2.0f, -1.0f); - IMATH_INTERNAL_NAMESPACE::M33f m2 = m1; - assert(m1.inverse(false) == m1.inverse()); - m2.invert(false); - m1.invert(); - assert(m1 == m2); + IMATH_INTERNAL_NAMESPACE::M33f m1 ( + 0.0f, 2.0f, -1.0f, 3.0f, -2.0f, 1.0f, 3.0f, 2.0f, -1.0f); + IMATH_INTERNAL_NAMESPACE::M33f m2 = m1; + assert (m1.inverse (false) == m1.inverse ()); + m2.invert (false); + m1.invert (); + assert (m1 == m2); - IMATH_INTERNAL_NAMESPACE::M33f m3 (1.0f, 0.0f, 5.0f, 2.0f, 1.0f, 6.0f, 3.0f, 4.0f, 0.0f); - m2 = m3; - assert(m3.inverse(true) == m3.inverse()); - m3.invert(true); - m2.invert(); - assert(m3 == m2); + IMATH_INTERNAL_NAMESPACE::M33f m3 ( + 1.0f, 0.0f, 5.0f, 2.0f, 1.0f, 6.0f, 3.0f, 4.0f, 0.0f); + m2 = m3; + assert (m3.inverse (true) == m3.inverse ()); + m3.invert (true); + m2.invert (); + assert (m3 == m2); - IMATH_INTERNAL_NAMESPACE::M33f m4 (0.0f, 2.0f, -1.0f, 3.0f, -2.0f, 1.0f, 3.0f, 2.0f, -1.0f); - m2 = m4; - assert(m4.gjInverse(false) == m4.gjInverse()); - m2.gjInvert(false); - m4.gjInvert(); - assert(m4 == m2); + IMATH_INTERNAL_NAMESPACE::M33f m4 ( + 0.0f, 2.0f, -1.0f, 3.0f, -2.0f, 1.0f, 3.0f, 2.0f, -1.0f); + m2 = m4; + assert (m4.gjInverse (false) == m4.gjInverse ()); + m2.gjInvert (false); + m4.gjInvert (); + assert (m4 == m2); - IMATH_INTERNAL_NAMESPACE::M33f m5 (1.0f, 0.0f, 5.0f, 2.0f, 1.0f, 6.0f, 3.0f, 4.0f, 0.0f); - m2 = m5; - assert(m5.gjInverse(true) == m5.gjInverse()); - m5.gjInvert(true); - m2.gjInvert(); - assert(m5 == m2); + IMATH_INTERNAL_NAMESPACE::M33f m5 ( + 1.0f, 0.0f, 5.0f, 2.0f, 1.0f, 6.0f, 3.0f, 4.0f, 0.0f); + m2 = m5; + assert (m5.gjInverse (true) == m5.gjInverse ()); + m5.gjInvert (true); + m2.gjInvert (); + assert (m5 == m2); } { @@ -285,12 +294,14 @@ testMatrix () assert (test != test2); IMATH_INTERNAL_NAMESPACE::M33d test3; - test3.makeIdentity(); + test3.makeIdentity (); assert (test2 == test3); - IMATH_INTERNAL_NAMESPACE::M33f test4 (1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); + IMATH_INTERNAL_NAMESPACE::M33f test4 ( + 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f); - IMATH_INTERNAL_NAMESPACE::M33d test5 = IMATH_INTERNAL_NAMESPACE::M33d (test4); + IMATH_INTERNAL_NAMESPACE::M33d test5 = + IMATH_INTERNAL_NAMESPACE::M33d (test4); assert (test5[0][0] == 1.0); assert (test5[0][1] == 2.0); @@ -319,7 +330,7 @@ testMatrix () assert (test != test2); IMATH_INTERNAL_NAMESPACE::M44f test3; - test3.makeIdentity(); + test3.makeIdentity (); assert (test2 == test3); // @@ -346,7 +357,7 @@ testMatrix () assert (test != test2); IMATH_INTERNAL_NAMESPACE::M44d test3; - test3.makeIdentity(); + test3.makeIdentity (); assert (test2 == test3); const float a[4][4] = { @@ -366,24 +377,26 @@ testMatrix () test3 = test2; assert (test2 != test3); - IMATH_INTERNAL_NAMESPACE::M44f test4 (1.0f, - 2.0f, - 3.0f, - 4.0f, - 5.0f, - 6.0f, - 7.0f, - 8.0f, - 9.0f, - 10.0f, - 11.0f, - 12.0f, - 13.0f, - 14.0f, - 15.0f, - 16.0f); - - IMATH_INTERNAL_NAMESPACE::M44d test5 = IMATH_INTERNAL_NAMESPACE::M44d (test4); + IMATH_INTERNAL_NAMESPACE::M44f test4 ( + 1.0f, + 2.0f, + 3.0f, + 4.0f, + 5.0f, + 6.0f, + 7.0f, + 8.0f, + 9.0f, + 10.0f, + 11.0f, + 12.0f, + 13.0f, + 14.0f, + 15.0f, + 16.0f); + + IMATH_INTERNAL_NAMESPACE::M44d test5 = + IMATH_INTERNAL_NAMESPACE::M44d (test4); assert (test5[0][0] == 1.0); assert (test5[0][1] == 2.0); @@ -465,93 +478,97 @@ testMatrix () { cout << "M44f inversion operators" << endl; - IMATH_INTERNAL_NAMESPACE::M44f m1 (1.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 1.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 1.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f); - IMATH_INTERNAL_NAMESPACE::M44f m2 = m1; - assert(m1.inverse(false) == m1.inverse()); - m2.invert(false); - m1.invert(); - assert(m1 == m2); - - IMATH_INTERNAL_NAMESPACE::M44f m3 (5.0f, - 6.0f, - 6.0f, - 8.0f, - 2.0f, - 2.0f, - 2.0f, - 8.0f, - 6.0f, - 6.0f, - 2.0f, - 8.0f, - 2.0f, - 3.0f, - 6.0f, - 7.0f); - m2 = m3; - assert(m3.inverse(true) == m3.inverse()); - m3.invert(true); - m2.invert(); - assert(m3 == m2); - - IMATH_INTERNAL_NAMESPACE::M44f m4 (1.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 1.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 1.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f); - m2 = m4; - assert(m4.gjInverse(false) == m4.gjInverse()); - m2.gjInvert(false); - m4.gjInvert(); - assert(m4 == m2); - - IMATH_INTERNAL_NAMESPACE::M44f m5 (5.0f, - 6.0f, - 6.0f, - 8.0f, - 2.0f, - 2.0f, - 2.0f, - 8.0f, - 6.0f, - 6.0f, - 2.0f, - 8.0f, - 2.0f, - 3.0f, - 6.0f, - 7.0f); - m2 = m5; - assert(m5.gjInverse(true) == m5.gjInverse()); - m5.gjInvert(true); - m2.gjInvert(); - assert(m5 == m2); + IMATH_INTERNAL_NAMESPACE::M44f m1 ( + 1.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 1.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 1.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f); + IMATH_INTERNAL_NAMESPACE::M44f m2 = m1; + assert (m1.inverse (false) == m1.inverse ()); + m2.invert (false); + m1.invert (); + assert (m1 == m2); + + IMATH_INTERNAL_NAMESPACE::M44f m3 ( + 5.0f, + 6.0f, + 6.0f, + 8.0f, + 2.0f, + 2.0f, + 2.0f, + 8.0f, + 6.0f, + 6.0f, + 2.0f, + 8.0f, + 2.0f, + 3.0f, + 6.0f, + 7.0f); + m2 = m3; + assert (m3.inverse (true) == m3.inverse ()); + m3.invert (true); + m2.invert (); + assert (m3 == m2); + + IMATH_INTERNAL_NAMESPACE::M44f m4 ( + 1.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 1.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 1.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f); + m2 = m4; + assert (m4.gjInverse (false) == m4.gjInverse ()); + m2.gjInvert (false); + m4.gjInvert (); + assert (m4 == m2); + + IMATH_INTERNAL_NAMESPACE::M44f m5 ( + 5.0f, + 6.0f, + 6.0f, + 8.0f, + 2.0f, + 2.0f, + 2.0f, + 8.0f, + 6.0f, + 6.0f, + 2.0f, + 8.0f, + 2.0f, + 3.0f, + 6.0f, + 7.0f); + m2 = m5; + assert (m5.gjInverse (true) == m5.gjInverse ()); + m5.gjInvert (true); + m2.gjInvert (); + assert (m5 == m2); } { @@ -608,13 +625,15 @@ testMatrix () IMATH_INTERNAL_NAMESPACE::M22f v; IMATH_INTERNAL_NAMESPACE::M22f s; - u.setRotation (random.nextf()); - v.setRotation (random.nextf()); - s[0][0] = random.nextf(); - s[1][1] = random.nextf(); + u.setRotation (random.nextf ()); + v.setRotation (random.nextf ()); + s[0][0] = random.nextf (); + s[1][1] = random.nextf (); - IMATH_INTERNAL_NAMESPACE::M22f c = u * s * v.transpose(); - assert (fabsf (c.determinant() - s[0][0] * s[1][1]) <= u.baseTypeEpsilon()); + IMATH_INTERNAL_NAMESPACE::M22f c = u * s * v.transpose (); + assert ( + fabsf (c.determinant () - s[0][0] * s[1][1]) <= + u.baseTypeEpsilon ()); } { IMATH_INTERNAL_NAMESPACE::Rand32 random; @@ -623,13 +642,15 @@ testMatrix () IMATH_INTERNAL_NAMESPACE::M22d v; IMATH_INTERNAL_NAMESPACE::M22d s; - u.setRotation ((double) random.nextf()); - v.setRotation ((double) random.nextf()); - s[0][0] = (double) random.nextf(); - s[1][1] = (double) random.nextf(); + u.setRotation ((double) random.nextf ()); + v.setRotation ((double) random.nextf ()); + s[0][0] = (double) random.nextf (); + s[1][1] = (double) random.nextf (); - IMATH_INTERNAL_NAMESPACE::M22d c = u * s * v.transpose(); - assert (fabs (c.determinant() - s[0][0] * s[1][1]) <= u.baseTypeEpsilon()); + IMATH_INTERNAL_NAMESPACE::M22d c = u * s * v.transpose (); + assert ( + fabs (c.determinant () - s[0][0] * s[1][1]) <= + u.baseTypeEpsilon ()); } { @@ -641,14 +662,16 @@ testMatrix () IMATH_INTERNAL_NAMESPACE::M33f v; IMATH_INTERNAL_NAMESPACE::M33f s; - u.setRotation (random.nextf()); - v.setRotation (random.nextf()); - s[0][0] = random.nextf(); - s[1][1] = random.nextf(); - s[2][2] = random.nextf(); + u.setRotation (random.nextf ()); + v.setRotation (random.nextf ()); + s[0][0] = random.nextf (); + s[1][1] = random.nextf (); + s[2][2] = random.nextf (); - IMATH_INTERNAL_NAMESPACE::M33f c = u * s * v.transpose(); - assert (fabsf (c.determinant() - s[0][0] * s[1][1] * s[2][2]) <= u.baseTypeEpsilon()); + IMATH_INTERNAL_NAMESPACE::M33f c = u * s * v.transpose (); + assert ( + fabsf (c.determinant () - s[0][0] * s[1][1] * s[2][2]) <= + u.baseTypeEpsilon ()); } { IMATH_INTERNAL_NAMESPACE::Rand32 random; @@ -657,23 +680,26 @@ testMatrix () IMATH_INTERNAL_NAMESPACE::M33d v; IMATH_INTERNAL_NAMESPACE::M33d s; - u.setRotation ((double) random.nextf()); - v.setRotation ((double) random.nextf()); - s[0][0] = (double) random.nextf(); - s[1][1] = (double) random.nextf(); - s[2][2] = (double) random.nextf(); + u.setRotation ((double) random.nextf ()); + v.setRotation ((double) random.nextf ()); + s[0][0] = (double) random.nextf (); + s[1][1] = (double) random.nextf (); + s[2][2] = (double) random.nextf (); - IMATH_INTERNAL_NAMESPACE::M33d c = u * s * v.transpose(); - assert (fabs (c.determinant() - s[0][0] * s[1][1] * s[2][2]) <= u.baseTypeEpsilon()); + IMATH_INTERNAL_NAMESPACE::M33d c = u * s * v.transpose (); + assert ( + fabs (c.determinant () - s[0][0] * s[1][1] * s[2][2]) <= + u.baseTypeEpsilon ()); } // Outer product of two 3D vectors { cout << "Outer product of two 3D vectors" << endl; - IMATH_INTERNAL_NAMESPACE::V3f a (1, 2, 3); - IMATH_INTERNAL_NAMESPACE::V3f b (4, 5, 6); - IMATH_INTERNAL_NAMESPACE::M33f p = IMATH_INTERNAL_NAMESPACE::outerProduct (a, b); + IMATH_INTERNAL_NAMESPACE::V3f a (1, 2, 3); + IMATH_INTERNAL_NAMESPACE::V3f b (4, 5, 6); + IMATH_INTERNAL_NAMESPACE::M33f p = + IMATH_INTERNAL_NAMESPACE::outerProduct (a, b); for (int i = 0; i < 3; i++) { @@ -684,9 +710,10 @@ testMatrix () } } { - IMATH_INTERNAL_NAMESPACE::V3d a (1, 2, 3); - IMATH_INTERNAL_NAMESPACE::V3d b (4, 5, 6); - IMATH_INTERNAL_NAMESPACE::M33d p = IMATH_INTERNAL_NAMESPACE::outerProduct (a, b); + IMATH_INTERNAL_NAMESPACE::V3d a (1, 2, 3); + IMATH_INTERNAL_NAMESPACE::V3d b (4, 5, 6); + IMATH_INTERNAL_NAMESPACE::M33d p = + IMATH_INTERNAL_NAMESPACE::outerProduct (a, b); for (int i = 0; i < 3; i++) { @@ -703,50 +730,64 @@ testMatrix () IMATH_INTERNAL_NAMESPACE::Rand32 random; - IMATH_INTERNAL_NAMESPACE::M44f u = IMATH_INTERNAL_NAMESPACE::rotationMatrix ( - IMATH_INTERNAL_NAMESPACE::V3f (random.nextf(), random.nextf(), random.nextf()) - .normalize(), - IMATH_INTERNAL_NAMESPACE::V3f (random.nextf(), random.nextf(), random.nextf()) - .normalize()); - IMATH_INTERNAL_NAMESPACE::M44f v = IMATH_INTERNAL_NAMESPACE::rotationMatrix ( - IMATH_INTERNAL_NAMESPACE::V3f (random.nextf(), random.nextf(), random.nextf()) - .normalize(), - IMATH_INTERNAL_NAMESPACE::V3f (random.nextf(), random.nextf(), random.nextf()) - .normalize()); + IMATH_INTERNAL_NAMESPACE::M44f u = + IMATH_INTERNAL_NAMESPACE::rotationMatrix ( + IMATH_INTERNAL_NAMESPACE::V3f ( + random.nextf (), random.nextf (), random.nextf ()) + .normalize (), + IMATH_INTERNAL_NAMESPACE::V3f ( + random.nextf (), random.nextf (), random.nextf ()) + .normalize ()); + IMATH_INTERNAL_NAMESPACE::M44f v = + IMATH_INTERNAL_NAMESPACE::rotationMatrix ( + IMATH_INTERNAL_NAMESPACE::V3f ( + random.nextf (), random.nextf (), random.nextf ()) + .normalize (), + IMATH_INTERNAL_NAMESPACE::V3f ( + random.nextf (), random.nextf (), random.nextf ()) + .normalize ()); IMATH_INTERNAL_NAMESPACE::M44f s; - s[0][0] = random.nextf(); - s[1][1] = random.nextf(); - s[2][2] = random.nextf(); - s[3][3] = random.nextf(); + s[0][0] = random.nextf (); + s[1][1] = random.nextf (); + s[2][2] = random.nextf (); + s[3][3] = random.nextf (); - IMATH_INTERNAL_NAMESPACE::M44f c = u * s * v.transpose(); - assert (fabsf (c.determinant() - s[0][0] * s[1][1] * s[2][2] * s[3][3]) <= - u.baseTypeEpsilon()); + IMATH_INTERNAL_NAMESPACE::M44f c = u * s * v.transpose (); + assert ( + fabsf (c.determinant () - s[0][0] * s[1][1] * s[2][2] * s[3][3]) <= + u.baseTypeEpsilon ()); } { IMATH_INTERNAL_NAMESPACE::Rand32 random; - IMATH_INTERNAL_NAMESPACE::M44d u = IMATH_INTERNAL_NAMESPACE::rotationMatrix ( - IMATH_INTERNAL_NAMESPACE::V3d (random.nextf(), random.nextf(), random.nextf()) - .normalize(), - IMATH_INTERNAL_NAMESPACE::V3d (random.nextf(), random.nextf(), random.nextf()) - .normalize()); - IMATH_INTERNAL_NAMESPACE::M44d v = IMATH_INTERNAL_NAMESPACE::rotationMatrix ( - IMATH_INTERNAL_NAMESPACE::V3d (random.nextf(), random.nextf(), random.nextf()) - .normalize(), - IMATH_INTERNAL_NAMESPACE::V3d (random.nextf(), random.nextf(), random.nextf()) - .normalize()); + IMATH_INTERNAL_NAMESPACE::M44d u = + IMATH_INTERNAL_NAMESPACE::rotationMatrix ( + IMATH_INTERNAL_NAMESPACE::V3d ( + random.nextf (), random.nextf (), random.nextf ()) + .normalize (), + IMATH_INTERNAL_NAMESPACE::V3d ( + random.nextf (), random.nextf (), random.nextf ()) + .normalize ()); + IMATH_INTERNAL_NAMESPACE::M44d v = + IMATH_INTERNAL_NAMESPACE::rotationMatrix ( + IMATH_INTERNAL_NAMESPACE::V3d ( + random.nextf (), random.nextf (), random.nextf ()) + .normalize (), + IMATH_INTERNAL_NAMESPACE::V3d ( + random.nextf (), random.nextf (), random.nextf ()) + .normalize ()); IMATH_INTERNAL_NAMESPACE::M44d s; - s[0][0] = random.nextf(); - s[1][1] = random.nextf(); - s[2][2] = random.nextf(); - s[3][3] = random.nextf(); + s[0][0] = random.nextf (); + s[1][1] = random.nextf (); + s[2][2] = random.nextf (); + s[3][3] = random.nextf (); - IMATH_INTERNAL_NAMESPACE::M44d c = u * s * v.transpose(); - assert (fabs (c.determinant() - s[0][0] * s[1][1] * s[2][2] * s[3][3]) <= - u.baseTypeEpsilon()); + IMATH_INTERNAL_NAMESPACE::M44d c = u * s * v.transpose (); + assert ( + fabs (c.determinant () - s[0][0] * s[1][1] * s[2][2] * s[3][3]) <= + u.baseTypeEpsilon ()); } // Trace @@ -863,7 +904,8 @@ testMatrix () { cout << "4x4 matrix minors" << endl; - IMATH_INTERNAL_NAMESPACE::M44d a (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + IMATH_INTERNAL_NAMESPACE::M44d a ( + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); assert (a.minorOf (0, 0) == a.fastMinor (1, 2, 3, 1, 2, 3)); assert (a.minorOf (0, 1) == a.fastMinor (1, 2, 3, 0, 2, 3)); @@ -883,7 +925,8 @@ testMatrix () assert (a.minorOf (3, 3) == a.fastMinor (0, 1, 2, 0, 1, 2)); } { - IMATH_INTERNAL_NAMESPACE::M44f a (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + IMATH_INTERNAL_NAMESPACE::M44f a ( + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); assert (a.minorOf (0, 0) == a.fastMinor (1, 2, 3, 1, 2, 3)); assert (a.minorOf (0, 1) == a.fastMinor (1, 2, 3, 0, 2, 3)); @@ -909,25 +952,26 @@ testMatrix () // and ignores __restrict. { cout << "M44 multiplicaftion test" << endl; - IMATH_INTERNAL_NAMESPACE::M44f M (1.0f, - 2.0f, - 3.0f, - 4.0f, - 5.0f, - 6.0f, - 7.0f, - 8.0f, - 9.0f, - 10.0f, - 11.0f, - 12.0f, - 13.0f, - 14.0f, - 15.0f, - 16.0f); + IMATH_INTERNAL_NAMESPACE::M44f M ( + 1.0f, + 2.0f, + 3.0f, + 4.0f, + 5.0f, + 6.0f, + 7.0f, + 8.0f, + 9.0f, + 10.0f, + 11.0f, + 12.0f, + 13.0f, + 14.0f, + 15.0f, + 16.0f); IMATH_INTERNAL_NAMESPACE::M44f N; - N.makeIdentity(); + N.makeIdentity (); // N should be equal to M // This typical test fails diff --git a/third_party/Imath-3.1.9/src/ImathTest/testMatrix.h b/third_party/Imath/src/ImathTest/testMatrix.h similarity index 83% rename from third_party/Imath-3.1.9/src/ImathTest/testMatrix.h rename to third_party/Imath/src/ImathTest/testMatrix.h index b4f72457..66edce4d 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testMatrix.h +++ b/third_party/Imath/src/ImathTest/testMatrix.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testMatrix(); +void testMatrix (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testMiscMatrixAlgo.cpp b/third_party/Imath/src/ImathTest/testMiscMatrixAlgo.cpp similarity index 83% rename from third_party/Imath-3.1.9/src/ImathTest/testMiscMatrixAlgo.cpp rename to third_party/Imath/src/ImathTest/testMiscMatrixAlgo.cpp index e9155478..62dd5629 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testMiscMatrixAlgo.cpp +++ b/third_party/Imath/src/ImathTest/testMiscMatrixAlgo.cpp @@ -7,13 +7,13 @@ # undef NDEBUG #endif +#include "testMiscMatrixAlgo.h" #include #include #include #include #include #include -#include "testMiscMatrixAlgo.h" #if 0 # define debug(x) (printf x, fflush (stdout)) @@ -34,7 +34,7 @@ rad (float deg) } void -testComputeLocalFrame() +testComputeLocalFrame () { float eps = 0.00005f; Rand48 random (0); @@ -66,35 +66,30 @@ testComputeLocalFrame() // test position for (int j = 0; j < 3; j++) { - if (abs (L[3][j] - p[j]) > eps) - assert (false); + if (abs (L[3][j] - p[j]) > eps) assert (false); } - if (abs (L[3][3] - 1.0) > eps) - assert (false); + if (abs (L[3][3] - 1.0) > eps) assert (false); // check that xAxis has the same dir as xDir and that is is normalized V3f x (L[0][0], L[0][1], L[0][2]); - assert ((x % xDir).length() < eps); - if (abs (L[0][3]) > eps) - assert (false); - assert ((abs (x.length() - 1.f) < eps)); + assert ((x % xDir).length () < eps); + if (abs (L[0][3]) > eps) assert (false); + assert ((abs (x.length () - 1.f) < eps)); // Check that y is normal to x and to normalDir, and is normalized V3f y (L[1][0], L[1][1], L[1][2]); - if (abs (L[1][3]) > eps) - assert (false); + if (abs (L[1][3]) > eps) assert (false); assert (abs (x ^ y) < eps); /*std::cout< eps) - assert (false); - assert ((abs (z.length() - 1.f) < eps)); + if (abs (L[2][3]) > eps) assert (false); + assert ((abs (z.length () - 1.f) < eps)); assert (abs (x ^ z) < eps); assert (abs (y ^ z) < eps); assert (((x % y) ^ z) > 0); @@ -121,8 +116,7 @@ getRandTRS (Rand48& random, V3f& trans, V3f& rot, V3f& scale) float(random.nextf (0.000001, 2.0)), float(random.nextf (0.000001, 2.0))); for (int j = 0; j < 3; j++) - if (random.nextf (0.0, 1.0) >= 0.5) - s[j] *= -1; + if (random.nextf (0.0, 1.0) >= 0.5) s[j] *= -1; scale = s; } @@ -131,7 +125,7 @@ createRandomMat (Rand48& random, V3f& trans, V3f& rot, V3f& scale) { M44f M; - V3f t, r, s; + V3f t, r, s; getRandTRS (random, t, r, s); M.translate (t); @@ -144,8 +138,7 @@ createRandomMat (Rand48& random, V3f& trans, V3f& rot, V3f& scale) float(random.nextf (0.000001, 2.0))); for (int j = 0; j < 3; j++) - if (random.nextf (0.0, 1.0) >= 0.5) - h[j] *= -1; + if (random.nextf (0.0, 1.0) >= 0.5) h[j] *= -1; M.shear (h); M.scale (s); @@ -200,7 +193,7 @@ compareMat (M44f& M, M44f& N) } void -testAddOffset() +testAddOffset () { Rand48 random (0); @@ -208,8 +201,8 @@ testAddOffset() { debug (("iteration: %d\n", i)); - V3f transA, transB, rotA, rotB, scaleA, scaleB; - V3f tOffset, rOffset, sOffset; + V3f transA, transB, rotA, rotB, scaleA, scaleB; + V3f tOffset, rOffset, sOffset; M44f inMat = createRandomMat (random, transA, rotA, scaleA); M44f refMat = createRandomMat (random, transB, rotB, scaleB); getRandTRS (random, tOffset, rOffset, sOffset); @@ -219,15 +212,16 @@ testAddOffset() // add the inverse offset M44f invO; - invO.rotate (V3f (rad (rOffset[0]), rad (rOffset[1]), rad (rOffset[2]))); + invO.rotate ( + V3f (rad (rOffset[0]), rad (rOffset[1]), rad (rOffset[2]))); invO[3][0] = tOffset[0]; invO[3][1] = tOffset[1]; invO[3][2] = tOffset[2]; - invO.invert(); + invO.invert (); M44f invS; invS.scale (sOffset); - invS.invert(); // zero scale is avoided in getRandTRS + invS.invert (); // zero scale is avoided in getRandTRS // in ref mat from the function result M44f outInRefMat = invO * invS * outMat; @@ -244,7 +238,7 @@ void testRSMatrix (M44f& M, V3f& t, V3f& r, V3f& s) { M44f N; - N.makeIdentity(); + N.makeIdentity (); N.translate (t); // ... matrix compositions N.rotate (r); N.scale (s); @@ -253,7 +247,7 @@ testRSMatrix (M44f& M, V3f& t, V3f& r, V3f& s) } void -testComputeRSMatrix() +testComputeRSMatrix () { Rand48 random (0); @@ -283,17 +277,18 @@ testComputeRSMatrix() } // namespace void -testMiscMatrixAlgo() +testMiscMatrixAlgo () { try { cout << "Testing misc functions in ImathMatrixAlgo.h" << endl; - cout << "Testing the building of an orthonormal direct frame from : a position, " - << "an x axis direction and a normal to the y axis" << endl; + cout + << "Testing the building of an orthonormal direct frame from : a position, " + << "an x axis direction and a normal to the y axis" << endl; cout << "IMATH_INTERNAL_NAMESPACE::computeLocalFrame()" << endl; - testComputeLocalFrame(); + testComputeLocalFrame (); cout << "ok\n" << endl; @@ -301,7 +296,7 @@ testMiscMatrixAlgo() << "and put it in another frame of reference" << endl; cout << "IMATH_INTERNAL_NAMESPACE::addOffset()" << endl; - testAddOffset(); + testAddOffset (); cout << "ok\n" << endl; @@ -309,12 +304,12 @@ testMiscMatrixAlgo() cout << "with the Rotate/Scale of Matrix B" << endl; cout << "IMATH_INTERNAL_NAMESPACE::computeRSMatrix()" << endl; - testComputeRSMatrix(); + testComputeRSMatrix (); cout << "ok\n" << endl; } catch (std::exception& e) { - cerr << " Caught exception: " << e.what() << endl; + cerr << " Caught exception: " << e.what () << endl; } } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testMiscMatrixAlgo.h b/third_party/Imath/src/ImathTest/testMiscMatrixAlgo.h similarity index 77% rename from third_party/Imath-3.1.9/src/ImathTest/testMiscMatrixAlgo.h rename to third_party/Imath/src/ImathTest/testMiscMatrixAlgo.h index fdc67dc8..5dfd2e82 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testMiscMatrixAlgo.h +++ b/third_party/Imath/src/ImathTest/testMiscMatrixAlgo.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testMiscMatrixAlgo(); +void testMiscMatrixAlgo (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testNoInterop.cpp b/third_party/Imath/src/ImathTest/testNoInterop.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/ImathTest/testNoInterop.cpp rename to third_party/Imath/src/ImathTest/testNoInterop.cpp diff --git a/third_party/Imath-3.1.9/src/ImathTest/testNoInterop.h b/third_party/Imath/src/ImathTest/testNoInterop.h similarity index 100% rename from third_party/Imath-3.1.9/src/ImathTest/testNoInterop.h rename to third_party/Imath/src/ImathTest/testNoInterop.h diff --git a/third_party/Imath-3.1.9/src/ImathTest/testProcrustes.cpp b/third_party/Imath/src/ImathTest/testProcrustes.cpp similarity index 68% rename from third_party/Imath-3.1.9/src/ImathTest/testProcrustes.cpp rename to third_party/Imath/src/ImathTest/testProcrustes.cpp index 15660833..61e33350 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testProcrustes.cpp +++ b/third_party/Imath/src/ImathTest/testProcrustes.cpp @@ -27,23 +27,24 @@ testTranslationRotationMatrix (const IMATH_INTERNAL_NAMESPACE::M44d& mat) static IMATH_INTERNAL_NAMESPACE::Rand48 rand (2047); - size_t numPoints = 7; + size_t numPoints = 7; std::vector from; from.reserve (numPoints); std::vector to; to.reserve (numPoints); for (size_t i = 0; i < numPoints; ++i) { - IMATH_INTERNAL_NAMESPACE::V3d a (rand.nextf(), rand.nextf(), rand.nextf()); + IMATH_INTERNAL_NAMESPACE::V3d a ( + rand.nextf (), rand.nextf (), rand.nextf ()); IMATH_INTERNAL_NAMESPACE::V3d b = a * mat; from.push_back (Vec (a)); to.push_back (Vec (b)); } - std::vector weights (numPoints, T (1)); - const IMATH_INTERNAL_NAMESPACE::M44d m1 = - procrustesRotationAndTranslation (&from[0], &to[0], &weights[0], numPoints); + std::vector weights (numPoints, T (1)); + const IMATH_INTERNAL_NAMESPACE::M44d m1 = procrustesRotationAndTranslation ( + &from[0], &to[0], &weights[0], numPoints); const IMATH_INTERNAL_NAMESPACE::M44d m2 = procrustesRotationAndTranslation (&from[0], &to[0], numPoints); @@ -55,8 +56,8 @@ testTranslationRotationMatrix (const IMATH_INTERNAL_NAMESPACE::M44d& mat) const IMATH_INTERNAL_NAMESPACE::V3d b1 = a * m1; const IMATH_INTERNAL_NAMESPACE::V3d b2 = a * m2; - assert ((b - b1).length() < eps); - assert ((b - b2).length() < eps); + assert ((b - b1).length () < eps); + assert ((b - b2).length () < eps); } std::cout << " OK\n"; } @@ -71,8 +72,8 @@ testWithTranslateRotateAndScale (const IMATH_INTERNAL_NAMESPACE::M44d& m) IMATH_INTERNAL_NAMESPACE::Rand48 rand (5376); typedef IMATH_INTERNAL_NAMESPACE::Vec3 V3; - std::vector from; - std::vector weights; + std::vector from; + std::vector weights; const float eps = 1e-4f; std::cout << "numPoints: " << std::flush; @@ -86,46 +87,44 @@ testWithTranslateRotateAndScale (const IMATH_INTERNAL_NAMESPACE::M44d& m) std::cout << from.size () << " "; std::vector to; - for (size_t i = 0; i < from.size(); ++i) + for (size_t i = 0; i < from.size (); ++i) to.push_back (from[i] * m); // weighted: IMATH_INTERNAL_NAMESPACE::M44d res = - IMATH_INTERNAL_NAMESPACE::procrustesRotationAndTranslation (&from[0], - &to[0], - &weights[0], - from.size(), - true); - for (size_t i = 0; i < from.size(); ++i) - assert ((from[i] * res - to[i]).length() < eps); + IMATH_INTERNAL_NAMESPACE::procrustesRotationAndTranslation ( + &from[0], &to[0], &weights[0], from.size (), true); + for (size_t i = 0; i < from.size (); ++i) + assert ((from[i] * res - to[i]).length () < eps); // unweighted: - res = IMATH_INTERNAL_NAMESPACE::procrustesRotationAndTranslation (&from[0], - &to[0], - from.size(), - true); - for (size_t i = 0; i < from.size(); ++i) - assert ((from[i] * res - to[i]).length() < eps); + res = IMATH_INTERNAL_NAMESPACE::procrustesRotationAndTranslation ( + &from[0], &to[0], from.size (), true); + for (size_t i = 0; i < from.size (); ++i) + assert ((from[i] * res - to[i]).length () < eps); } std::cout << " OK\n"; } template double -procrustesError (const IMATH_INTERNAL_NAMESPACE::Vec3* from, - const IMATH_INTERNAL_NAMESPACE::Vec3* to, - const T* weights, - const size_t n, - const IMATH_INTERNAL_NAMESPACE::M44d& xform) +procrustesError ( + const IMATH_INTERNAL_NAMESPACE::Vec3* from, + const IMATH_INTERNAL_NAMESPACE::Vec3* to, + const T* weights, + const size_t n, + const IMATH_INTERNAL_NAMESPACE::M44d& xform) { double result = 0.0; double residual = 0.0; for (size_t i = 0; i < n; ++i) { - IMATH_INTERNAL_NAMESPACE::V3d xformed = IMATH_INTERNAL_NAMESPACE::V3d (from[i]) * xform; - IMATH_INTERNAL_NAMESPACE::V3d diff = xformed - IMATH_INTERNAL_NAMESPACE::V3d (to[i]); - const double w = weights[i]; - const double mag = w * diff.length2(); + IMATH_INTERNAL_NAMESPACE::V3d xformed = + IMATH_INTERNAL_NAMESPACE::V3d (from[i]) * xform; + IMATH_INTERNAL_NAMESPACE::V3d diff = + xformed - IMATH_INTERNAL_NAMESPACE::V3d (to[i]); + const double w = weights[i]; + const double mag = w * diff.length2 (); // Use Kahan summation for the heck of it: const double y = mag - residual; @@ -138,19 +137,21 @@ procrustesError (const IMATH_INTERNAL_NAMESPACE::Vec3* from, template void -verifyProcrustes (const std::vector>& from, - const std::vector>& to) +verifyProcrustes ( + const std::vector>& from, + const std::vector>& to) { - const T eps = std::sqrt (std::numeric_limits::epsilon()); + const T eps = std::sqrt (std::numeric_limits::epsilon ()); - const size_t n = from.size(); + const size_t n = from.size (); // Validate that passing in uniform weights gives the same answer as // passing in no weights: - std::vector weights (from.size()); - for (size_t i = 0; i < weights.size(); ++i) + std::vector weights (from.size ()); + for (size_t i = 0; i < weights.size (); ++i) weights[i] = 1; - IMATH_INTERNAL_NAMESPACE::M44d m1 = procrustesRotationAndTranslation (&from[0], &to[0], n); + IMATH_INTERNAL_NAMESPACE::M44d m1 = + procrustesRotationAndTranslation (&from[0], &to[0], n); IMATH_INTERNAL_NAMESPACE::M44d m2 = procrustesRotationAndTranslation (&from[0], &to[0], &weights[0], n); for (int i = 0; i < 4; ++i) @@ -165,8 +166,8 @@ verifyProcrustes (const std::vector>& from, procrustesRotationAndTranslation (&from[0], &to[0], &weights[0], n); // with scale: - IMATH_INTERNAL_NAMESPACE::M44d ms = - procrustesRotationAndTranslation (&from[0], &to[0], &weights[0], n, true); + IMATH_INTERNAL_NAMESPACE::M44d ms = procrustesRotationAndTranslation ( + &from[0], &to[0], &weights[0], n, true); // Verify that it's orthonormal w/ positive determinant. const T det = static_cast(m.determinant ()); @@ -177,7 +178,8 @@ verifyProcrustes (const std::vector>& from, for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) upperLeft[i][j] = m[i][j]; - IMATH_INTERNAL_NAMESPACE::M33d product = upperLeft * upperLeft.transposed(); + IMATH_INTERNAL_NAMESPACE::M33d product = + upperLeft * upperLeft.transposed (); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) @@ -188,27 +190,33 @@ verifyProcrustes (const std::vector>& from, } // Verify that nearby transforms are worse: - const size_t numTries = 10; + const size_t numTries = 10; IMATH_INTERNAL_NAMESPACE::Rand48 rand (1056); - const double delta = 1e-3; + const double delta = 1e-3; for (size_t i = 0; i < numTries; ++i) { // Construct an orthogonal rotation matrix using Euler angles: - IMATH_INTERNAL_NAMESPACE::Eulerd diffRot (delta * rand.nextf(), - delta * rand.nextf(), - delta * rand.nextf()); + IMATH_INTERNAL_NAMESPACE::Eulerd diffRot ( + delta * rand.nextf (), + delta * rand.nextf (), + delta * rand.nextf ()); - assert (procrustesError (&from[0], &to[0], &weights[0], n, m * diffRot.toMatrix44()) > - procrustesError (&from[0], &to[0], &weights[0], n, m)); + assert ( + procrustesError ( + &from[0], &to[0], &weights[0], n, m * diffRot.toMatrix44 ()) > + procrustesError (&from[0], &to[0], &weights[0], n, m)); // Try a small translation: - IMATH_INTERNAL_NAMESPACE::V3d diffTrans (delta * rand.nextf(), - delta * rand.nextf(), - delta * rand.nextf()); + IMATH_INTERNAL_NAMESPACE::V3d diffTrans ( + delta * rand.nextf (), + delta * rand.nextf (), + delta * rand.nextf ()); IMATH_INTERNAL_NAMESPACE::M44d translateMatrix; translateMatrix.translate (diffTrans); - assert (procrustesError (&from[0], &to[0], &weights[0], n, m * translateMatrix) > - procrustesError (&from[0], &to[0], &weights[0], n, m)); + assert ( + procrustesError ( + &from[0], &to[0], &weights[0], n, m * translateMatrix) > + procrustesError (&from[0], &to[0], &weights[0], n, m)); } // Try a small scale: @@ -217,14 +225,16 @@ verifyProcrustes (const std::vector>& from, for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) newMat[i][j] = ms[i][j] * (1.0 + scaleDiff); - assert (procrustesError (&from[0], &to[0], &weights[0], n, newMat) > - procrustesError (&from[0], &to[0], &weights[0], n, ms)); + assert ( + procrustesError (&from[0], &to[0], &weights[0], n, newMat) > + procrustesError (&from[0], &to[0], &weights[0], n, ms)); for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) newMat[i][j] = ms[i][j] * (1.0 - scaleDiff); - assert (procrustesError (&from[0], &to[0], &weights[0], n, newMat) > - procrustesError (&from[0], &to[0], &weights[0], n, ms)); + assert ( + procrustesError (&from[0], &to[0], &weights[0], n, newMat) > + procrustesError (&from[0], &to[0], &weights[0], n, ms)); // // Verify the magical property that makes shape springs work: @@ -243,8 +253,8 @@ verifyProcrustes (const std::vector>& from, netTorque += to[iPoint].cross (force); } - assert (netForce.length2() < eps); - assert (netTorque.length2() < eps); + assert (netForce.length2 () < eps); + assert (netTorque.length2 () < eps); } } @@ -261,13 +271,12 @@ testProcrustesWithMatrix (const IMATH_INTERNAL_NAMESPACE::M44d& m) for (size_t numPoints = 1; numPoints < 10; ++numPoints) { std::cout << numPoints << " " << std::flush; - fromPoints.clear(); - toPoints.clear(); + fromPoints.clear (); + toPoints.clear (); for (size_t i = 0; i < numPoints; ++i) { - const IMATH_INTERNAL_NAMESPACE::V3d fromPt (random.nextf(), - random.nextf(), - random.nextf()); + const IMATH_INTERNAL_NAMESPACE::V3d fromPt ( + random.nextf (), random.nextf (), random.nextf ()); const IMATH_INTERNAL_NAMESPACE::V3d toPt = fromPt * m; fromPoints.push_back (IMATH_INTERNAL_NAMESPACE::Vec3 (fromPt)); toPoints.push_back (IMATH_INTERNAL_NAMESPACE::Vec3 (toPt)); @@ -279,25 +288,26 @@ testProcrustesWithMatrix (const IMATH_INTERNAL_NAMESPACE::M44d& m) template void -testProcrustesImp() +testProcrustesImp () { // Test the empty case: - IMATH_INTERNAL_NAMESPACE::M44d id = - procrustesRotationAndTranslation ((IMATH_INTERNAL_NAMESPACE::Vec3*) 0, - (IMATH_INTERNAL_NAMESPACE::Vec3*) 0, - (T*) 0, - 0); - assert (id == IMATH_INTERNAL_NAMESPACE::M44d()); - - id = procrustesRotationAndTranslation ((IMATH_INTERNAL_NAMESPACE::Vec3*) 0, - (IMATH_INTERNAL_NAMESPACE::Vec3*) 0, - 0); - assert (id == IMATH_INTERNAL_NAMESPACE::M44d()); + IMATH_INTERNAL_NAMESPACE::M44d id = procrustesRotationAndTranslation ( + (IMATH_INTERNAL_NAMESPACE::Vec3*) 0, + (IMATH_INTERNAL_NAMESPACE::Vec3*) 0, + (T*) 0, + 0); + assert (id == IMATH_INTERNAL_NAMESPACE::M44d ()); + + id = procrustesRotationAndTranslation ( + (IMATH_INTERNAL_NAMESPACE::Vec3*) 0, + (IMATH_INTERNAL_NAMESPACE::Vec3*) 0, + 0); + assert (id == IMATH_INTERNAL_NAMESPACE::M44d ()); // First we'll test with a bunch of known translation/rotation matrices // to make sure we get back exactly the same points: IMATH_INTERNAL_NAMESPACE::M44d m; - m.makeIdentity(); + m.makeIdentity (); testTranslationRotationMatrix (m); m.translate (IMATH_INTERNAL_NAMESPACE::V3d (3.0, 5.0, -0.2)); @@ -312,7 +322,7 @@ testProcrustesImp() m.rotate (IMATH_INTERNAL_NAMESPACE::V3d (0, 0, -3.0 / 4.0 * M_PI)); testTranslationRotationMatrix (m); - m.makeIdentity(); + m.makeIdentity (); testWithTranslateRotateAndScale (m); m.translate (IMATH_INTERNAL_NAMESPACE::V3d (0.4, 6.0, 10.0)); @@ -337,8 +347,8 @@ testProcrustesImp() // the various Procrustes properties: std::vector> fromPoints; std::vector> toPoints; - fromPoints.clear(); - toPoints.clear(); + fromPoints.clear (); + toPoints.clear (); for (size_t i = 0; i < 4; ++i) { @@ -354,8 +364,8 @@ testProcrustesImp() IMATH_INTERNAL_NAMESPACE::Rand48 random (1209); for (size_t numPoints = 1; numPoints < 10; ++numPoints) { - fromPoints.clear(); - toPoints.clear(); + fromPoints.clear (); + toPoints.clear (); for (size_t i = 0; i < numPoints; ++i) { fromPoints.push_back (IMATH_INTERNAL_NAMESPACE::Vec3 ( @@ -380,14 +390,14 @@ testProcrustesImp() testProcrustesWithMatrix (m); IMATH_INTERNAL_NAMESPACE::Eulerd rot (M_PI / 3.0, 3.0 * M_PI / 4.0, 0); - m = m * rot.toMatrix44(); + m = m * rot.toMatrix44 (); testProcrustesWithMatrix (m); m.scale (IMATH_INTERNAL_NAMESPACE::Vec3 (T(1.5), T(6.4), T(2.0))); testProcrustesWithMatrix (m); IMATH_INTERNAL_NAMESPACE::Eulerd rot2 (1.0, M_PI, M_PI / 3.0); - m = m * rot.toMatrix44(); + m = m * rot.toMatrix44 (); m.scale (IMATH_INTERNAL_NAMESPACE::Vec3 (-1, 1, 1)); testProcrustesWithMatrix (m); @@ -400,11 +410,13 @@ testProcrustesImp() } void -testProcrustes() +testProcrustes () { - std::cout << "Testing Procrustes algorithms in single precision..." << std::endl; - testProcrustesImp(); + std::cout << "Testing Procrustes algorithms in single precision..." + << std::endl; + testProcrustesImp (); - std::cout << "Testing Procrustes algorithms in double precision..." << std::endl; - testProcrustesImp(); + std::cout << "Testing Procrustes algorithms in double precision..." + << std::endl; + testProcrustesImp (); } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testProcrustes.h b/third_party/Imath/src/ImathTest/testProcrustes.h similarity index 80% rename from third_party/Imath-3.1.9/src/ImathTest/testProcrustes.h rename to third_party/Imath/src/ImathTest/testProcrustes.h index 5a1e3ba8..2db5c576 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testProcrustes.h +++ b/third_party/Imath/src/ImathTest/testProcrustes.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testProcrustes(); +void testProcrustes (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testQuat.cpp b/third_party/Imath/src/ImathTest/testQuat.cpp similarity index 50% rename from third_party/Imath-3.1.9/src/ImathTest/testQuat.cpp rename to third_party/Imath/src/ImathTest/testQuat.cpp index db011879..4211e5f3 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testQuat.cpp +++ b/third_party/Imath/src/ImathTest/testQuat.cpp @@ -7,6 +7,7 @@ # undef NDEBUG #endif +#include "testQuat.h" #include #include #include @@ -14,7 +15,6 @@ #include #include #include -#include "testQuat.h" // Include ImathForward *after* other headers to validate forward declarations #include @@ -29,37 +29,63 @@ template void testQuatT () { - const T s = std::numeric_limits::min(); - const T e = 4 * std::numeric_limits::epsilon(); + const T s = std::numeric_limits::min (); + const T e = 4 * std::numeric_limits::epsilon (); // // constructors, r(), v() // { - Quat q = Quat(); - assert (q.r == 1 && q.v == Vec3 (0, 0, 0)); + Quat q = Quat (); + assert (q.r == 1 && q.v == Vec3 (0, 0, 0)); + + q = Quat (2, 3, 4, 5); + assert (q.r == 2 && q.v == Vec3 (3, 4, 5)); - q = Quat (2, 3, 4, 5); - assert (q.r == 2 && q.v == Vec3 (3, 4, 5)); + q = Quat (6, Vec3 (7, 8, 9)); + assert (q.r == 6 && q.v == Vec3 (7, 8, 9)); - q = Quat (6, Vec3 (7, 8, 9)); - assert (q.r == 6 && q.v == Vec3 (7, 8, 9)); + Quat q1 = Quat (q); + assert (q1.r == 6 && q1.v == Vec3 (7, 8, 9)); + } - Quat q1 = Quat (q); - assert (q1.r == 6 && q1.v == Vec3 (7, 8, 9)); + // m * q + { + Matrix33 m; + m.setRotation(T(M_PI_2)); + Quat q; + q.setAxisAngle (Vec3 (0, 0, 1), T(M_PI_2)); + Matrix33 mp = m * q; + Matrix33 r (-9.999999e-01f, 1.589326e-08f, 0.000000e+00f, + -1.589326e-08f, -9.999999e-01f, 0.000000e+00f, + 0.000000e+00f, 0.000000e+00f, 1.000000e+00); + assert(mp.equalWithAbsError(r, 1e-5)); } + // q * m + { + Matrix33 m; + m.setRotation(T(M_PI_2)); + Quat q; + q.setAxisAngle (Vec3 (0, 0, 1), T(M_PI_2)); + Matrix33 mp = m * q; + Matrix33 r (-9.999999e-01f, 1.589326e-08f, 0.000000e+00f, + -1.589326e-08f, -9.999999e-01f, 0.000000e+00f, + 0.000000e+00f, 0.000000e+00f, 1.000000e+00); + assert(mp.equalWithAbsError(r, 1e-5)); + } + // // invert(), inverse() // { - Quat q = Quat (1, 0, 0, 1); - assert (q.inverse() == Quat (0.5, 0, 0, -0.5)); + Quat q = Quat (1, 0, 0, 1); + assert (q.inverse () == Quat (0.5, 0, 0, -0.5)); - q.invert(); - assert (q == Quat (0.5, 0, 0, -0.5)); + q.invert (); + assert (q == Quat (0.5, 0, 0, -0.5)); } // @@ -67,17 +93,22 @@ testQuatT () // { - Quat q = Quat (2, Vec3 (0, 0, 0)); - assert (q.normalized() == Quat (1, 0, 0, 0)); + Quat q = Quat (2, Vec3 (0, 0, 0)); + assert (q.normalized () == Quat (1, 0, 0, 0)); - q.normalize(); - assert (q == Quat (1, 0, 0, 0)); + q.normalize (); + assert (q == Quat (1, 0, 0, 0)); - q = Quat (0, Vec3 (0, 2, 0)); - assert (q.normalized() == Quat (0, 0, 1, 0)); + q = Quat (0, Vec3 (0, 2, 0)); + assert (q.normalized () == Quat (0, 0, 1, 0)); - q.normalize(); - assert (q == Quat (0, 0, 1, 0)); + q.normalize (); + assert (q == Quat (0, 0, 1, 0)); + + q = Quat (0, Vec3 (0, 0, 0)); + q.normalize(); + assert (q.r == 1 && q.v == Vec3(0,0,0)); + } // @@ -85,8 +116,8 @@ testQuatT () // { - Quat q = Quat (3, 0, 4, 0); - assert (q.length() == 5); + Quat q = Quat (3, 0, 4, 0); + assert (q.length () == 5); } // @@ -148,10 +179,10 @@ testQuatT () // { - Quat q; - q.setRotation (Vec3 (1, 0, 0), Vec3 (0, 1, 0)); + Quat q; + q.setRotation (Vec3 (1, 0, 0), Vec3 (0, 1, 0)); - Matrix33 m1 = q.toMatrix33(); + Matrix33 m1 = q.toMatrix33 (); // clang-format off @@ -174,23 +205,30 @@ testQuatT () // +, - (unary and binary), ~ *, /, ^ // - assert (Quat (1, 2, 3, 4) + Quat (5, 6, 7, 8) == Quat (6, 8, 10, 12)); + assert ( + Quat (1, 2, 3, 4) + Quat (5, 6, 7, 8) == Quat (6, 8, 10, 12)); - assert (Quat (-1, -2, -3, -4) - Quat (5, 6, 7, 8) == Quat (-6, -8, -10, -12)); + assert ( + Quat (-1, -2, -3, -4) - Quat (5, 6, 7, 8) == + Quat (-6, -8, -10, -12)); assert (-Quat (1, 2, 3, 4) == Quat (-1, -2, -3, -4)); - + assert (~Quat (1, 2, 3, 4) == Quat (1, -2, -3, -4)); assert (T (2) * Quat (1, 2, 3, 4) == Quat (2, 4, 6, 8)); - assert (Quat (1, 2, 3, 4) * T (2 )== Quat (2, 4, 6, 8)); + assert (Quat (1, 2, 3, 4) * T (2) == Quat (2, 4, 6, 8)); - assert (Quat (1, 0, 0, 1) * Quat (1, 1, 0, 0) == Quat (1, 1, 1, 1)); + assert ( + Quat (1, 0, 0, 1) * Quat (1, 1, 0, 0) == Quat (1, 1, 1, 1)); - assert (Quat (1, 1, 0, 0) * Quat (1, 0, 0, 1) == Quat (1, 1, -1, 1)); - - assert (Quat (1, 0, 0, 1) / Quat (0.5, -0.5, 0, 0) == Quat (1, 1, 1, 1)); + assert ( + Quat (1, 1, 0, 0) * Quat (1, 0, 0, 1) == Quat (1, 1, -1, 1)); + + assert ( + Quat (1, 0, 0, 1) / Quat (0.5, -0.5, 0, 0) == + Quat (1, 1, 1, 1)); assert (Quat (2, 4, 6, 8) / T (2) == Quat (1, 2, 3, 4)); @@ -201,47 +239,45 @@ testQuatT () // { - Vec3 vFrom (1, 0, 0); - Vec3 vTo (0, 1, 1); - Matrix44 m1 = rotationMatrix (vFrom, vTo); - + Vec3 vFrom (1, 0, 0); + Vec3 vTo (0, 1, 1); + Matrix44 m1 = rotationMatrix (vFrom, vTo); + Quat q = extractQuat (m1); ; - Matrix44 m2 = q.toMatrix44(); + Matrix44 m2 = q.toMatrix44 (); - assert (m2.equalWithAbsError (m1, 2 * e)); + assert (m2.equalWithAbsError (m1, 2 * e)); } } - void testQuatConversions () { { - Quatf q (1, V3f (2, 3, 4)); - Quatd q1 = Quatd (q); - assert (q1.r == 1 && q1.v == V3d (2, 3, 4)); + Quatf q (1, V3f (2, 3, 4)); + Quatd q1 = Quatd (q); + assert (q1.r == 1 && q1.v == V3d (2, 3, 4)); } { - Quatd q (1, V3d (2, 3, 4)); - Quatf q1 = Quatf (q); - assert (q1.r == 1 && q1.v == V3f (2, 3, 4)); + Quatd q (1, V3d (2, 3, 4)); + Quatf q1 = Quatf (q); + assert (q1.r == 1 && q1.v == V3f (2, 3, 4)); } } } // namespace - void testQuat () { cout << "Testing basic quaternion operations" << endl; - testQuatT(); - testQuatT(); - testQuatConversions(); + testQuatT (); + testQuatT (); + testQuatConversions (); cout << "ok\n" << endl; } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testQuat.h b/third_party/Imath/src/ImathTest/testQuat.h similarity index 84% rename from third_party/Imath-3.1.9/src/ImathTest/testQuat.h rename to third_party/Imath/src/ImathTest/testQuat.h index 2bc00fc3..7433000d 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testQuat.h +++ b/third_party/Imath/src/ImathTest/testQuat.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testQuat(); +void testQuat (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testQuatSetRotation.cpp b/third_party/Imath/src/ImathTest/testQuatSetRotation.cpp similarity index 85% rename from third_party/Imath-3.1.9/src/ImathTest/testQuatSetRotation.cpp rename to third_party/Imath/src/ImathTest/testQuatSetRotation.cpp index 7b226a4c..ae6da358 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testQuatSetRotation.cpp +++ b/third_party/Imath/src/ImathTest/testQuatSetRotation.cpp @@ -7,11 +7,11 @@ # undef NDEBUG #endif +#include "testQuatSetRotation.h" #include #include #include #include -#include "testQuatSetRotation.h" using namespace std; using namespace IMATH_INTERNAL_NAMESPACE; @@ -28,19 +28,19 @@ testRotation (const V3f& from, const V3f& to) Quatf Q; Q.setRotation (from, to); - M44f M = Q.toMatrix44(); + M44f M = Q.toMatrix44 (); // // Verify that the quaternion rotates vector from into vector to. // - float e = 20 * std::numeric_limits::epsilon(); + float e = 20 * std::numeric_limits::epsilon (); V3f fromM = from * M; V3f fromQ = from * Q; - V3f t0 = to.normalized(); - V3f fM0 = fromM.normalized(); - V3f fQ0 = fromQ.normalized(); + V3f t0 = to.normalized (); + V3f fM0 = fromM.normalized (); + V3f fQ0 = fromQ.normalized (); assert (t0.equalWithAbsError (fM0, e)); assert (t0.equalWithAbsError (fQ0, e)); @@ -49,11 +49,11 @@ testRotation (const V3f& from, const V3f& to) // Verify that the rotation axis is the cross product of from and to. // - V3f f0 = from.normalized(); + V3f f0 = from.normalized (); if (abs (f0 ^ t0) < 0.9) { - V3f n0 = (from % to).normalized(); + V3f n0 = (from % to).normalized (); V3f n0M = n0 * M; assert (n0.equalWithAbsError (n0M, e)); @@ -61,7 +61,7 @@ testRotation (const V3f& from, const V3f& to) } void -specificVectors() +specificVectors () { cout << " exact 90-degree rotations" << endl; @@ -108,7 +108,7 @@ specificVectors() } void -randomVectors() +randomVectors () { cout << " random from and to vectors" << endl; @@ -123,12 +123,12 @@ randomVectors() } void -nearlyEqualVectors() +nearlyEqualVectors () { cout << " nearly equal from and to vectors" << endl; Rand48 rand (19); - float e = 100 * std::numeric_limits::epsilon(); + float e = 100 * std::numeric_limits::epsilon (); for (int i = 0; i < 500000; ++i) { @@ -139,12 +139,12 @@ nearlyEqualVectors() } void -nearlyOppositeVectors() +nearlyOppositeVectors () { cout << " nearly opposite from and to vectors" << endl; Rand48 rand (19); - float e = 100 * std::numeric_limits::epsilon(); + float e = 100 * std::numeric_limits::epsilon (); for (int i = 0; i < 500000; ++i) { @@ -157,14 +157,14 @@ nearlyOppositeVectors() } // namespace void -testQuatSetRotation() +testQuatSetRotation () { cout << "Testing quaternion rotations" << endl; - specificVectors(); - randomVectors(); - nearlyEqualVectors(); - nearlyOppositeVectors(); + specificVectors (); + randomVectors (); + nearlyEqualVectors (); + nearlyOppositeVectors (); cout << "ok\n" << endl; } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testQuatSetRotation.h b/third_party/Imath/src/ImathTest/testQuatSetRotation.h similarity index 77% rename from third_party/Imath-3.1.9/src/ImathTest/testQuatSetRotation.h rename to third_party/Imath/src/ImathTest/testQuatSetRotation.h index fc3d30a7..a7240e6f 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testQuatSetRotation.h +++ b/third_party/Imath/src/ImathTest/testQuatSetRotation.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testQuatSetRotation(); +void testQuatSetRotation (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testQuatSlerp.cpp b/third_party/Imath/src/ImathTest/testQuatSlerp.cpp similarity index 93% rename from third_party/Imath-3.1.9/src/ImathTest/testQuatSlerp.cpp rename to third_party/Imath/src/ImathTest/testQuatSlerp.cpp index b1c47f86..d79129b1 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testQuatSlerp.cpp +++ b/third_party/Imath/src/ImathTest/testQuatSlerp.cpp @@ -7,12 +7,12 @@ # undef NDEBUG #endif +#include "testQuatSlerp.h" #include #include #include #include #include -#include "testQuatSlerp.h" using namespace std; using namespace IMATH_INTERNAL_NAMESPACE; @@ -62,11 +62,11 @@ testSlerp (const Quatf q1, const Quatf q2, int m, int n) // Quatf qi; - Quatf q3 = q1.inverse() * q2; + Quatf q3 = q1.inverse () * q2; Quatf q1q2 = slerp (q1, q2, float (m) / float (n)); Quatf qiq3 = slerp (qi, q3, float (m) / float (n)); - float e1 = 60 * std::numeric_limits::epsilon(); - float e2 = 600 * std::numeric_limits::epsilon(); + float e1 = 60 * std::numeric_limits::epsilon (); + float e2 = 600 * std::numeric_limits::epsilon (); compareQuats (q1q2, q1 * qiq3, e1); compareQuats (pow (qiq3, n), pow (q3, m), e2); @@ -82,7 +82,7 @@ testSlerp (const Quatf q1, const Quatf q2) } void -specificRotations() +specificRotations () { cout << " combinations of 90-degree rotations around x, y and z" << endl; @@ -125,7 +125,7 @@ specificRotations() } void -randomRotations() +randomRotations () { cout << " random rotations" << endl; @@ -156,12 +156,12 @@ randomRotations() } // namespace void -testQuatSlerp() +testQuatSlerp () { cout << "Testing quaternion spherical linear interpolation" << endl; - specificRotations(); - randomRotations(); + specificRotations (); + randomRotations (); cout << "ok\n" << endl; } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testQuatSlerp.h b/third_party/Imath/src/ImathTest/testQuatSlerp.h similarity index 80% rename from third_party/Imath-3.1.9/src/ImathTest/testQuatSlerp.h rename to third_party/Imath/src/ImathTest/testQuatSlerp.h index 62491237..7f7df294 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testQuatSlerp.h +++ b/third_party/Imath/src/ImathTest/testQuatSlerp.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testQuatSlerp(); +void testQuatSlerp (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testRandom.cpp b/third_party/Imath/src/ImathTest/testRandom.cpp similarity index 79% rename from third_party/Imath-3.1.9/src/ImathTest/testRandom.cpp rename to third_party/Imath/src/ImathTest/testRandom.cpp index d2c2bbe9..9650c6c6 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testRandom.cpp +++ b/third_party/Imath/src/ImathTest/testRandom.cpp @@ -7,13 +7,13 @@ # undef NDEBUG #endif +#include "testRandom.h" #include #include #include #include #include #include -#include "testRandom.h" // Include ImathForward *after* other headers to validate forward declarations #include @@ -25,7 +25,7 @@ namespace { void -testErand48() +testErand48 () { // // Our implementation of erand48(), nrand48(), etc. @@ -45,11 +45,16 @@ testErand48() state[1] = 1; state[2] = 2; - assert (abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.671004) < 0.00001); - assert (abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.786905) < 0.00001); - assert (abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.316850) < 0.00001); - assert (abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.384870) < 0.00001); - assert (abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.854650) < 0.00001); + assert ( + abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.671004) < 0.00001); + assert ( + abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.786905) < 0.00001); + assert ( + abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.316850) < 0.00001); + assert ( + abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.384870) < 0.00001); + assert ( + abs (IMATH_INTERNAL_NAMESPACE::erand48 (state) - 0.854650) < 0.00001); assert (IMATH_INTERNAL_NAMESPACE::nrand48 (state) == 0x4f4e8cb0); assert (IMATH_INTERNAL_NAMESPACE::nrand48 (state) == 0x063e864b); @@ -96,7 +101,7 @@ testDrand48 () template void -testGenerator() +testGenerator () { // // Test if the values, and the differences between @@ -106,8 +111,8 @@ testGenerator() const int N = 10; const int M = 100000; - int values[N + 1]; - int diffs[2 * N + 3]; + int values[N + 1]; + int diffs[2 * N + 3]; int* v = &values[0]; int* d = &diffs[N + 2]; @@ -117,7 +122,7 @@ testGenerator() for (int i = -N; i <= N; ++i) d[i] = 0; - Rand rand (0); + Rand rand (0); float previous = 0; for (int i = 0; i < M * N; ++i) @@ -167,11 +172,9 @@ testGenerator() { double r = rand.nextf (0.0, 1.0); - if (rMin > r) - rMin = r; + if (rMin > r) rMin = r; - if (rMax < r) - rMax = r; + if (rMax < r) rMax = r; } assert (rMin < 0.0001 && rMax > 0.9999); @@ -193,11 +196,11 @@ testGenerator() template void -testSolidSphere() +testSolidSphere () { const int N = 10; const int M = 10000; - int v[N + 1]; + int v[N + 1]; for (int i = 0; i <= N; ++i) v[i] = 0; @@ -207,8 +210,9 @@ testSolidSphere() for (int i = 0; i < M * N; ++i) { IMATH_INTERNAL_NAMESPACE::V3f p = - IMATH_INTERNAL_NAMESPACE::solidSphereRand (rand); - float l = p.length(); + IMATH_INTERNAL_NAMESPACE::solidSphereRand< + IMATH_INTERNAL_NAMESPACE::V3f> (rand); + float l = p.length (); v[IMATH_INTERNAL_NAMESPACE::floor (l * N)] += 1; assert (l < 1.00001); @@ -220,16 +224,17 @@ testSolidSphere() template void -testHollowSphere() +testHollowSphere () { const int M = 100000; - Rand rand (0); + Rand rand (0); for (int i = 0; i < M; ++i) { IMATH_INTERNAL_NAMESPACE::V3f p = - IMATH_INTERNAL_NAMESPACE::hollowSphereRand (rand); - float l = p.length(); + IMATH_INTERNAL_NAMESPACE::hollowSphereRand< + IMATH_INTERNAL_NAMESPACE::V3f> (rand); + float l = p.length (); assert (abs (l - 1) < 0.00001); } @@ -238,31 +243,31 @@ testHollowSphere() } // namespace void -testRandom() +testRandom () { cout << "Testing random number generators" << endl; cout << "erand48(), nrand48()" << endl; - testErand48(); + testErand48 (); cout << "drand48(), lrand48()" << endl; testDrand48 (); cout << "Rand32" << endl; - testGenerator(); + testGenerator (); cout << "Rand48" << endl; - testGenerator(); + testGenerator (); cout << "Rand48" << endl; testGenerator (); cout << "solidSphereRand()" << endl; - testSolidSphere(); + testSolidSphere (); cout << "hollowSphereRand()" << endl; - testHollowSphere(); + testHollowSphere (); cout << "ok\n" << endl; } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testRandom.h b/third_party/Imath/src/ImathTest/testRandom.h similarity index 83% rename from third_party/Imath-3.1.9/src/ImathTest/testRandom.h rename to third_party/Imath/src/ImathTest/testRandom.h index fd254533..f12fc4ab 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testRandom.h +++ b/third_party/Imath/src/ImathTest/testRandom.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testRandom(); +void testRandom (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testRoots.cpp b/third_party/Imath/src/ImathTest/testRoots.cpp similarity index 79% rename from third_party/Imath-3.1.9/src/ImathTest/testRoots.cpp rename to third_party/Imath/src/ImathTest/testRoots.cpp index 62dce651..76db2dd6 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testRoots.cpp +++ b/third_party/Imath/src/ImathTest/testRoots.cpp @@ -7,13 +7,13 @@ # undef NDEBUG #endif +#include "testRoots.h" #include #include #include #include #include #include -#include "testRoots.h" using namespace std; @@ -22,18 +22,14 @@ sort (int nx, double& x0, double& x1, double& x2) { if (nx == 2) { - if (x0 > x1) - swap (x0, x1); + if (x0 > x1) swap (x0, x1); } if (nx == 3) { - if (x0 > x1) - swap (x0, x1); - if (x1 > x2) - swap (x1, x2); - if (x0 > x1) - swap (x0, x1); + if (x0 > x1) swap (x0, x1); + if (x1 > x2) swap (x1, x2); + if (x0 > x1) swap (x0, x1); } } @@ -42,33 +38,30 @@ sort (int nx, double x[]) { if (nx == 2) { - if (x[0] > x[1]) - swap (x[0], x[1]); + if (x[0] > x[1]) swap (x[0], x[1]); } if (nx == 3) { - if (x[0] > x[1]) - swap (x[0], x[1]); - if (x[1] > x[2]) - swap (x[1], x[2]); - if (x[0] > x[1]) - swap (x[0], x[1]); + if (x[0] > x[1]) swap (x[0], x[1]); + if (x[1] > x[2]) swap (x[1], x[2]); + if (x[0] > x[1]) swap (x[0], x[1]); } } void -solve (double a, - double b, - double c, - double d, // coefficients - int nx, // number of expected solutions - double x0, - double x1, - double x2) // expected solutions +solve ( + double a, + double b, + double c, + double d, // coefficients + int nx, // number of expected solutions + double x0, + double x1, + double x2) // expected solutions { - cout << "coefficients: " << setw (3) << a << ' ' << setw (3) << b << ' ' << setw (3) << c << ' ' - << setw (3) << d << ' '; + cout << "coefficients: " << setw (3) << a << ' ' << setw (3) << b << ' ' + << setw (3) << c << ' ' << setw (3) << d << ' '; // // Solve the equation a*x^3 + b*x^2 + c*x +d @@ -92,11 +85,9 @@ solve (double a, cout << " solutions: "; - if (n == -1) - cout << "[-inf, inf]"; + if (n == -1) cout << "[-inf, inf]"; - if (n == 0) - cout << "none"; + if (n == 0) cout << "none"; const double e = 0.0000001; // maximum expected error for // the test cases listed below @@ -120,21 +111,22 @@ solve (double a, } void -solve (double a, - double b, - double c, // coefficients - int nx, // number of expected solutions - double x0, - double x1) // expected solutions +solve ( + double a, + double b, + double c, // coefficients + int nx, // number of expected solutions + double x0, + double x1) // expected solutions { - cout << "coefficients: " << setw (3) << a << ' ' << setw (3) << b << ' ' << setw (3) << c - << ' '; + cout << "coefficients: " << setw (3) << a << ' ' << setw (3) << b << ' ' + << setw (3) << c << ' '; // // Solve the equation a*x^2 + b*x^1 + c*x // - double x[2] = { 0.0, 0.0 }; - int n = IMATH_INTERNAL_NAMESPACE::solveQuadratic (a, b, c, x); + double x[2] = {0.0, 0.0}; + int n = IMATH_INTERNAL_NAMESPACE::solveQuadratic (a, b, c, x); // // Sort the numerical solutions. @@ -152,11 +144,9 @@ solve (double a, assert (n == nx); cout << " solutions: "; - if (n == -1) - cout << "[-inf, inf]"; + if (n == -1) cout << "[-inf, inf]"; - if (n == 0) - cout << "none"; + if (n == 0) cout << "none"; const double e = 0.0000001; // maximum expected error for // the test cases listed below @@ -177,7 +167,7 @@ solve (double a, } void -testRoots() +testRoots () { cout << "Testing functions in ImathRoots.h" << endl; diff --git a/third_party/Imath-3.1.9/src/ImathTest/testRoots.h b/third_party/Imath/src/ImathTest/testRoots.h similarity index 83% rename from third_party/Imath-3.1.9/src/ImathTest/testRoots.h rename to third_party/Imath/src/ImathTest/testRoots.h index b8234ea6..1b7f9ac5 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testRoots.h +++ b/third_party/Imath/src/ImathTest/testRoots.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testRoots(); +void testRoots (); diff --git a/third_party/Imath/src/ImathTest/testShear.cpp b/third_party/Imath/src/ImathTest/testShear.cpp new file mode 100644 index 00000000..c8f16ee7 --- /dev/null +++ b/third_party/Imath/src/ImathTest/testShear.cpp @@ -0,0 +1,244 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#ifdef NDEBUG +# undef NDEBUG +#endif + +#include "testShear.h" +#include +#include +#include +#include + +// Include ImathForward *after* other headers to validate forward declarations +#include + +using namespace std; + +void +testShear () +{ + cout << "Testing functions in ImathShear.h" << endl; + + assert (IMATH_INTERNAL_NAMESPACE::Shear6f::baseTypeLowest() == + std::numeric_limits::lowest()); + assert (IMATH_INTERNAL_NAMESPACE::Shear6f::baseTypeMax() == + std::numeric_limits::max()); + assert (IMATH_INTERNAL_NAMESPACE::Shear6f::baseTypeSmallest() == + std::numeric_limits::min()); + assert (IMATH_INTERNAL_NAMESPACE::Shear6f::baseTypeEpsilon() == + std::numeric_limits::epsilon()); + + cout << "Imath::Shear6 constructors" << endl; + + const float epsilon = std::numeric_limits::epsilon (); + + IMATH_INTERNAL_NAMESPACE::Shear6f testConstructor1; + IMATH_INTERNAL_NAMESPACE::Shear6f testConstructor2 (testConstructor1); + + testConstructor1 = testConstructor2; + + IMATH_INTERNAL_NAMESPACE::Shear6f testConstructor3 ( + 52, 128, 254, 127, 12, -20); + IMATH_INTERNAL_NAMESPACE::Shear6f A (testConstructor3); + IMATH_INTERNAL_NAMESPACE::Shear6f B = A; + IMATH_INTERNAL_NAMESPACE::Shear6f X, Y, tmp; + + assert (A == B); + + cout << "Imath::Shear6 * f" << endl; + + assert ( + (IMATH_INTERNAL_NAMESPACE::Shear6f ( + 0.330f, 0.710f, 0.010f, 0.999f, -0.531f, -0.012f) * + 0.999f) == + IMATH_INTERNAL_NAMESPACE::Shear6f ( + 0.330f * 0.999f, + 0.710f * 0.999f, + 0.010f * 0.999f, + 0.999f * 0.999f, + -0.531f * 0.999f, + -0.012f * 0.999f)); + + cout << "Imath::Shear6 / f" << endl; + + assert ( + (IMATH_INTERNAL_NAMESPACE::Shear6f ( + 0.330f, 0.710f, 0.010f, 0.999f, -0.531f, -0.012f) / + 0.999f) == + IMATH_INTERNAL_NAMESPACE::Shear6f ( + 0.330f / 0.999f, + 0.710f / 0.999f, + 0.010f / 0.999f, + 0.999f / 0.999f, + -0.531f / 0.999f, + -0.012f / 0.999f)); + + cout << "Assignment and comparison" << endl; + + B = A; + assert (B == A); + assert (!(B != A)); + + X = Y = IMATH_INTERNAL_NAMESPACE::Shear6f ( + 0.123f, -0.420f, 0.501f, 0.998f, -0.231f, -0.034f); + + X *= 0.001f; + + assert ( + std::fabs ((Y.xy * 0.001f) - X.xy) <= epsilon && + std::fabs ((Y.xz * 0.001f) - X.xz) <= epsilon && + std::fabs ((Y.yz * 0.001f) - X.yz) <= epsilon && + std::fabs ((Y.yx * 0.001f) - X.yx) <= epsilon && + std::fabs ((Y.zx * 0.001f) - X.zx) <= epsilon && + std::fabs ((Y.zy * 0.001f) - X.zy) <= epsilon); + + X = Y = IMATH_INTERNAL_NAMESPACE::Shear6f ( + 0.123f, -0.420f, 0.501f, 0.998f, -0.231f, -0.034f); + + X /= -1.001f; + + assert ( + std::fabs ((Y.xy / -1.001f) - X.xy) <= epsilon && + std::fabs ((Y.xz / -1.001f) - X.xz) <= epsilon && + std::fabs ((Y.yz / -1.001f) - X.yz) <= epsilon && + std::fabs ((Y.yx / -1.001f) - X.yx) <= epsilon && + std::fabs ((Y.zx / -1.001f) - X.zx) <= epsilon && + std::fabs ((Y.zy / -1.001f) - X.zy) <= epsilon); + + Y = IMATH_INTERNAL_NAMESPACE::Shear6f ( + 0.998f, -0.001f, 0.501f, 1.001f, -0.231f, -0.034f); + X = IMATH_INTERNAL_NAMESPACE::Shear6f ( + 0.011f, -0.420f, -0.501f, 0.998f, -0.231f, -0.034f); + + tmp = X + Y; + + assert ( + std::fabs ((X.xy + Y.xy) - tmp.xy) <= epsilon && + std::fabs ((X.xz + Y.xz) - tmp.xz) <= epsilon && + std::fabs ((X.yz + Y.yz) - tmp.yz) <= epsilon && + std::fabs ((X.yx + Y.yx) - tmp.yx) <= epsilon && + std::fabs ((X.zx + Y.zx) - tmp.zx) <= epsilon && + std::fabs ((X.zy + Y.zy) - tmp.zy) <= epsilon); + + tmp = X - Y; + + assert ( + std::fabs ((X.xy - Y.xy) - tmp.xy) <= epsilon && + std::fabs ((X.xz - Y.xz) - tmp.xz) <= epsilon && + std::fabs ((X.yz - Y.yz) - tmp.yz) <= epsilon && + std::fabs ((X.yx - Y.yx) - tmp.yx) <= epsilon && + std::fabs ((X.zx - Y.zx) - tmp.zx) <= epsilon && + std::fabs ((X.zy - Y.zy) - tmp.zy) <= epsilon); + + tmp = X * Y; + + assert ( + std::fabs ((X.xy * Y.xy) - tmp.xy) <= epsilon && + std::fabs ((X.xz * Y.xz) - tmp.xz) <= epsilon && + std::fabs ((X.yz * Y.yz) - tmp.yz) <= epsilon && + std::fabs ((X.yx * Y.yx) - tmp.yx) <= epsilon && + std::fabs ((X.zx * Y.zx) - tmp.zx) <= epsilon && + std::fabs ((X.zy * Y.zy) - tmp.zy) <= epsilon); + + tmp = X / Y; + + // + // epsilon doesn't work here. + // + assert ( + std::fabs ((X.xy / Y.xy) - tmp.xy) <= 1e-5f && + std::fabs ((X.xz / Y.xz) - tmp.xz) <= 1e-5f && + std::fabs ((X.yz / Y.yz) - tmp.yz) <= 1e-5f && + std::fabs ((X.yx / Y.yx) - tmp.yx) <= 1e-5f && + std::fabs ((X.zx / Y.zx) - tmp.zx) <= 1e-5f && + std::fabs ((X.zy / Y.zy) - tmp.zy) <= 1e-5f); + + tmp = X; + tmp += Y; + + assert ( + std::fabs ((X.xy + Y.xy) - tmp.xy) <= epsilon && + std::fabs ((X.xz + Y.xz) - tmp.xz) <= epsilon && + std::fabs ((X.yz + Y.yz) - tmp.yz) <= epsilon && + std::fabs ((X.yx + Y.yx) - tmp.yx) <= epsilon && + std::fabs ((X.zx + Y.zx) - tmp.zx) <= epsilon && + std::fabs ((X.zy + Y.zy) - tmp.zy) <= epsilon); + + tmp = X; + tmp -= Y; + + assert ( + std::fabs ((X.xy - Y.xy) - tmp.xy) <= epsilon && + std::fabs ((X.xz - Y.xz) - tmp.xz) <= epsilon && + std::fabs ((X.yz - Y.yz) - tmp.yz) <= epsilon && + std::fabs ((X.yx - Y.yx) - tmp.yx) <= epsilon && + std::fabs ((X.xz - Y.xz) - tmp.xz) <= epsilon && + std::fabs ((X.yz - Y.yz) - tmp.yz) <= epsilon); + + tmp = X; + tmp *= Y; + + assert ( + std::fabs ((X.xy * Y.xy) - tmp.xy) <= epsilon && + std::fabs ((X.xz * Y.xz) - tmp.xz) <= epsilon && + std::fabs ((X.yz * Y.yz) - tmp.yz) <= epsilon && + std::fabs ((X.yx * Y.yx) - tmp.yx) <= epsilon && + std::fabs ((X.zx * Y.zx) - tmp.zx) <= epsilon && + std::fabs ((X.zy * Y.zy) - tmp.zy) <= epsilon); + + tmp = X; + tmp /= Y; + + // + // epsilon doesn't work here. + // + assert ( + std::fabs ((X.xy / Y.xy) - tmp.xy) <= 1e-5f && + std::fabs ((X.xz / Y.xz) - tmp.xz) <= 1e-5f && + std::fabs ((X.yz / Y.yz) - tmp.yz) <= 1e-5f && + std::fabs ((X.yx / Y.yx) - tmp.yx) <= 1e-5f && + std::fabs ((X.zx / Y.zx) - tmp.zx) <= 1e-5f && + std::fabs ((X.zy / Y.zy) - tmp.zy) <= 1e-5f); + + + IMATH_INTERNAL_NAMESPACE::Shear6f s (1.0, 2.0, 3.0, 4.0, 5.0, 6.0); + tmp.setValue(s.xy, s.xz, s.yz, s.yx, s.zx, s.zy); + assert (tmp.xy == s.xy && + tmp.xz == s.xz && + tmp.yz == s.yz && + tmp.yx == s.yx && + tmp.zx == s.zx && + tmp.zy == s.zy); + s = IMATH_INTERNAL_NAMESPACE::Shear6f(); + tmp.getValue(s.xy, s.xz, s.yz, s.yx, s.zx, s.zy); + assert (tmp.xy == s.xy && + tmp.xz == s.xz && + tmp.yz == s.yz && + tmp.yx == s.yx && + tmp.zx == s.zx && + tmp.zy == s.zy); + + s = IMATH_INTERNAL_NAMESPACE::Shear6f(); + s.setValue(tmp); + assert (tmp.xy == s.xy && + tmp.xz == s.xz && + tmp.yz == s.yz && + tmp.yx == s.yx && + tmp.zx == s.zx && + tmp.zy == s.zy); + + s = IMATH_INTERNAL_NAMESPACE::Shear6f(); + tmp.getValue(s); + assert (tmp.xy == s.xy && + tmp.xz == s.xz && + tmp.yz == s.yz && + tmp.yx == s.yx && + tmp.zx == s.zx && + tmp.zy == s.zy); + + cout << "ok\n" << endl; +} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testShear.h b/third_party/Imath/src/ImathTest/testShear.h similarity index 83% rename from third_party/Imath-3.1.9/src/ImathTest/testShear.h rename to third_party/Imath/src/ImathTest/testShear.h index ab3435d9..46283bab 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testShear.h +++ b/third_party/Imath/src/ImathTest/testShear.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testShear(); +void testShear (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testSize.cpp b/third_party/Imath/src/ImathTest/testSize.cpp similarity index 91% rename from third_party/Imath-3.1.9/src/ImathTest/testSize.cpp rename to third_party/Imath/src/ImathTest/testSize.cpp index c57ed784..b95f313f 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testSize.cpp +++ b/third_party/Imath/src/ImathTest/testSize.cpp @@ -7,22 +7,22 @@ # undef NDEBUG #endif +#include "testSize.h" #include "half.h" #include #include #include -#include "testSize.h" using namespace std; void -testSize() +testSize () { cout << "size and alignment\n"; half h[2]; - int size = sizeof (half); + int size = sizeof (half); ptrdiff_t algn = (char*) &h[1] - (char*) &h[0]; cout << "sizeof (half) = " << size << endl; diff --git a/third_party/Imath-3.1.9/src/ImathTest/testSize.h b/third_party/Imath/src/ImathTest/testSize.h similarity index 84% rename from third_party/Imath-3.1.9/src/ImathTest/testSize.h rename to third_party/Imath/src/ImathTest/testSize.h index 53cc512d..5a535c92 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testSize.h +++ b/third_party/Imath/src/ImathTest/testSize.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testSize(); +void testSize (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testTinySVD.cpp b/third_party/Imath/src/ImathTest/testTinySVD.cpp similarity index 85% rename from third_party/Imath-3.1.9/src/ImathTest/testTinySVD.cpp rename to third_party/Imath/src/ImathTest/testTinySVD.cpp index b2f1911c..3a3ea31d 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testTinySVD.cpp +++ b/third_party/Imath/src/ImathTest/testTinySVD.cpp @@ -18,9 +18,9 @@ template void verifyOrthonormal (const IMATH_INTERNAL_NAMESPACE::Matrix33& A) { - const T valueEps = T (100) * std::numeric_limits::epsilon(); + const T valueEps = T (100) * std::numeric_limits::epsilon (); - const IMATH_INTERNAL_NAMESPACE::Matrix33 prod = A * A.transposed(); + const IMATH_INTERNAL_NAMESPACE::Matrix33 prod = A * A.transposed (); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) @@ -37,9 +37,9 @@ template void verifyOrthonormal (const IMATH_INTERNAL_NAMESPACE::Matrix44& A) { - const T valueEps = T (100) * std::numeric_limits::epsilon(); + const T valueEps = T (100) * std::numeric_limits::epsilon (); - const IMATH_INTERNAL_NAMESPACE::Matrix44 prod = A * A.transposed(); + const IMATH_INTERNAL_NAMESPACE::Matrix44 prod = A * A.transposed (); for (int i = 0; i < 4; ++i) { for (int j = 0; j < 4; ++j) @@ -61,7 +61,7 @@ verifyTinySVD_3x3 (const IMATH_INTERNAL_NAMESPACE::Matrix33& A) for (int j = 0; j < 3; ++j) maxEntry = std::max (maxEntry, std::abs (A[i][j])); - const T eps = std::numeric_limits::epsilon(); + const T eps = std::numeric_limits::epsilon (); const T valueEps = maxEntry * T (10) * eps; for (int i = 0; i < 2; ++i) @@ -69,14 +69,14 @@ verifyTinySVD_3x3 (const IMATH_INTERNAL_NAMESPACE::Matrix33& A) const bool posDet = (i == 0); IMATH_INTERNAL_NAMESPACE::Matrix33 U, V; - IMATH_INTERNAL_NAMESPACE::Vec3 S; + IMATH_INTERNAL_NAMESPACE::Vec3 S; IMATH_INTERNAL_NAMESPACE::jacobiSVD (A, U, S, V, eps, posDet); IMATH_INTERNAL_NAMESPACE::Matrix33 S_times_Vt; for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) S_times_Vt[i][j] = S[j] * V[i][j]; - S_times_Vt.transpose(); + S_times_Vt.transpose (); // Verify that the product of the matrices is A: const IMATH_INTERNAL_NAMESPACE::Matrix33 product = U * S_times_Vt; @@ -87,8 +87,8 @@ verifyTinySVD_3x3 (const IMATH_INTERNAL_NAMESPACE::Matrix33& A) // Verify that U and V are orthogonal: if (posDet) { - assert (U.determinant() > 0.9); - assert (V.determinant() > 0.9); + assert (U.determinant () > 0.9); + assert (V.determinant () > 0.9); } // Verify that the singular values are sorted: @@ -99,8 +99,7 @@ verifyTinySVD_3x3 (const IMATH_INTERNAL_NAMESPACE::Matrix33& A) for (int i = 0; i < 2; ++i) assert (S[i] >= T (0)); - if (!posDet) - assert (S[2] >= T (0)); + if (!posDet) assert (S[2] >= T (0)); verifyOrthonormal (U); verifyOrthonormal (V); @@ -116,7 +115,7 @@ verifyTinySVD_4x4 (const IMATH_INTERNAL_NAMESPACE::Matrix44& A) for (int j = 0; j < 4; ++j) maxEntry = std::max (maxEntry, std::abs (A[i][j])); - const T eps = std::numeric_limits::epsilon(); + const T eps = std::numeric_limits::epsilon (); const T valueEps = maxEntry * T (100) * eps; for (int i = 0; i < 2; ++i) @@ -124,14 +123,14 @@ verifyTinySVD_4x4 (const IMATH_INTERNAL_NAMESPACE::Matrix44& A) const bool posDet = (i == 0); IMATH_INTERNAL_NAMESPACE::Matrix44 U, V; - IMATH_INTERNAL_NAMESPACE::Vec4 S; + IMATH_INTERNAL_NAMESPACE::Vec4 S; IMATH_INTERNAL_NAMESPACE::jacobiSVD (A, U, S, V, eps, posDet); IMATH_INTERNAL_NAMESPACE::Matrix44 S_times_Vt; for (int i = 0; i < 4; ++i) for (int j = 0; j < 4; ++j) S_times_Vt[i][j] = S[j] * V[i][j]; - S_times_Vt.transpose(); + S_times_Vt.transpose (); // Verify that the product of the matrices is A: const IMATH_INTERNAL_NAMESPACE::Matrix44 product = U * S_times_Vt; @@ -142,8 +141,8 @@ verifyTinySVD_4x4 (const IMATH_INTERNAL_NAMESPACE::Matrix44& A) // Verify that U and V have positive determinant if requested: if (posDet) { - assert (U.determinant() > 0.99); - assert (V.determinant() > 0.99); + assert (U.determinant () > 0.99); + assert (V.determinant () > 0.99); } // Verify that the singular values are sorted: @@ -154,8 +153,7 @@ verifyTinySVD_4x4 (const IMATH_INTERNAL_NAMESPACE::Matrix44& A) for (int i = 0; i < 3; ++i) assert (S[i] >= T (0)); - if (!posDet) - assert (S[3] >= T (0)); + if (!posDet) assert (S[3] >= T (0)); verifyOrthonormal (U); verifyOrthonormal (V); @@ -166,15 +164,16 @@ template void testTinySVD_3x3 (const IMATH_INTERNAL_NAMESPACE::Matrix33& A) { - std::cout << "Verifying SVD for [[" << A[0][0] << ", " << A[0][1] << ", " << A[0][2] << "], " + std::cout << "Verifying SVD for [[" << A[0][0] << ", " << A[0][1] << ", " + << A[0][2] << "], " << "[" << A[1][0] << ", " << A[1][1] << ", " << A[1][2] << "], " << "[" << A[2][0] << ", " << A[2][1] << ", " << A[2][2] << "]]\n"; verifyTinySVD_3x3 (A); - verifyTinySVD_3x3 (A.transposed()); + verifyTinySVD_3x3 (A.transposed ()); // Try all different orderings of the columns of A: - int cols[3] = { 0, 1, 2 }; + int cols[3] = {0, 1, 2}; do { IMATH_INTERNAL_NAMESPACE::Matrix33 B; @@ -188,15 +187,16 @@ testTinySVD_3x3 (const IMATH_INTERNAL_NAMESPACE::Matrix33& A) template void -testTinySVD_3x3 (const T a, - const T b, - const T c, - const T d, - const T e, - const T f, - const T g, - const T h, - const T i) +testTinySVD_3x3 ( + const T a, + const T b, + const T c, + const T d, + const T e, + const T f, + const T g, + const T h, + const T i) { const IMATH_INTERNAL_NAMESPACE::Matrix33 A (a, b, c, d, e, f, g, h, i); testTinySVD_3x3 (A); @@ -206,17 +206,20 @@ template void testTinySVD_4x4 (const IMATH_INTERNAL_NAMESPACE::Matrix44& A) { - std::cout << "Verifying SVD for [[" << A[0][0] << ", " << A[0][1] << ", " << A[0][2] << ", " - << A[0][3] << "], " - << "[" << A[1][0] << ", " << A[1][1] << ", " << A[1][2] << ", " << A[1][3] << "], " - << "[" << A[2][0] << ", " << A[2][1] << ", " << A[2][2] << ", " << A[2][3] << "], " - << "[" << A[3][0] << ", " << A[3][1] << ", " << A[3][2] << ", " << A[3][3] << "]]\n"; + std::cout << "Verifying SVD for [[" << A[0][0] << ", " << A[0][1] << ", " + << A[0][2] << ", " << A[0][3] << "], " + << "[" << A[1][0] << ", " << A[1][1] << ", " << A[1][2] << ", " + << A[1][3] << "], " + << "[" << A[2][0] << ", " << A[2][1] << ", " << A[2][2] << ", " + << A[2][3] << "], " + << "[" << A[3][0] << ", " << A[3][1] << ", " << A[3][2] << ", " + << A[3][3] << "]]\n"; verifyTinySVD_4x4 (A); - verifyTinySVD_4x4 (A.transposed()); + verifyTinySVD_4x4 (A.transposed ()); // Try all different orderings of the columns of A: - int cols[4] = { 0, 1, 2, 3 }; + int cols[4] = {0, 1, 2, 3}; do { IMATH_INTERNAL_NAMESPACE::Matrix44 B; @@ -230,30 +233,32 @@ testTinySVD_4x4 (const IMATH_INTERNAL_NAMESPACE::Matrix44& A) template void -testTinySVD_4x4 (const T a, - const T b, - const T c, - const T d, - const T e, - const T f, - const T g, - const T h, - const T i, - const T j, - const T k, - const T l, - const T m, - const T n, - const T o, - const T p) +testTinySVD_4x4 ( + const T a, + const T b, + const T c, + const T d, + const T e, + const T f, + const T g, + const T h, + const T i, + const T j, + const T k, + const T l, + const T m, + const T n, + const T o, + const T p) { - const IMATH_INTERNAL_NAMESPACE::Matrix44 A (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p); + const IMATH_INTERNAL_NAMESPACE::Matrix44 A ( + a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p); testTinySVD_4x4 (A); } template void -testTinySVDImp() +testTinySVDImp () { // Try a bunch of 3x3 matrices: testTinySVD_3x3 (1, 0, 0, 0, 1, 0, 0, 0, 1); @@ -383,11 +388,13 @@ testTinySVDImp() } void -testTinySVD() +testTinySVD () { - std::cout << "Testing TinySVD algorithms in single precision..." << std::endl; - testTinySVDImp(); + std::cout << "Testing TinySVD algorithms in single precision..." + << std::endl; + testTinySVDImp (); - std::cout << "Testing TinySVD algorithms in double precision..." << std::endl; - testTinySVDImp(); + std::cout << "Testing TinySVD algorithms in double precision..." + << std::endl; + testTinySVDImp (); } diff --git a/third_party/Imath-3.1.9/src/ImathTest/testTinySVD.h b/third_party/Imath/src/ImathTest/testTinySVD.h similarity index 82% rename from third_party/Imath-3.1.9/src/ImathTest/testTinySVD.h rename to third_party/Imath/src/ImathTest/testTinySVD.h index c600d32c..864a854b 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testTinySVD.h +++ b/third_party/Imath/src/ImathTest/testTinySVD.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testTinySVD(); +void testTinySVD (); diff --git a/third_party/Imath-3.1.9/src/ImathTest/testToFloat.cpp b/third_party/Imath/src/ImathTest/testToFloat.cpp similarity index 93% rename from third_party/Imath-3.1.9/src/ImathTest/testToFloat.cpp rename to third_party/Imath/src/ImathTest/testToFloat.cpp index 7bcb33aa..7c7b5536 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testToFloat.cpp +++ b/third_party/Imath/src/ImathTest/testToFloat.cpp @@ -94,10 +94,8 @@ halfToFloat (unsigned short y) return (s << 31) | (e << 23) | m; } - - void -testToFloat() +testToFloat () { std::cout << "running testToFloat" << std::endl; @@ -109,8 +107,8 @@ testToFloat() for (unsigned int s = 0; s < iMax; s++) { - half hs(half::FromBits, static_cast(s)); - assert (hs.bits() == s); + half hs (half::FromBits, static_cast (s)); + assert (hs.bits () == s); // // cast these bits to a float, using the cast-to-float @@ -141,12 +139,12 @@ testToFloat() if (isnan (f)) { - assert (h.isNan()); + assert (h.isNan ()); assert (isnan (uif.f)); } else if (isinf (f)) { - assert (h.isInfinity()); + assert (h.isInfinity ()); assert (isinf (uif.f)); } else diff --git a/third_party/Imath-3.1.9/src/ImathTest/testToFloat.h b/third_party/Imath/src/ImathTest/testToFloat.h similarity index 82% rename from third_party/Imath-3.1.9/src/ImathTest/testToFloat.h rename to third_party/Imath/src/ImathTest/testToFloat.h index 8b2ed742..46a13b42 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testToFloat.h +++ b/third_party/Imath/src/ImathTest/testToFloat.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testToFloat(); +void testToFloat (); diff --git a/third_party/Imath/src/ImathTest/testVec.cpp b/third_party/Imath/src/ImathTest/testVec.cpp new file mode 100644 index 00000000..e653eaf1 --- /dev/null +++ b/third_party/Imath/src/ImathTest/testVec.cpp @@ -0,0 +1,266 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#ifdef NDEBUG +# undef NDEBUG +#endif + +#include "testVec.h" +#include +#include +#include +#include +#include + +// Include ImathForward *after* other headers to validate forward declarations +#include + +using namespace std; +using namespace IMATH_INTERNAL_NAMESPACE; + +namespace +{ + +template +void +testLength2T () +{ + const T s = std::sqrt (std::numeric_limits::min ()); + const T e = 4 * std::numeric_limits::epsilon (); + + Vec2 v; + + v = Vec2 (0, 0); + assert (v.length () == 0); + assert (v.normalized ().length () == 0); + + v = Vec2 (3, 4); + assert (v.length () == 5); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + v = Vec2 (3000, 4000); + assert (v.length () == 5000); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + T t = s * (1 << 4); + + v = Vec2 (t, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec2 (0, t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec2 (-t, -t); + assert (IMATH_INTERNAL_NAMESPACE::equal ( + v.length (), t * std::sqrt (2), t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + t = s / (1 << 4); + + v = Vec2 (t, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec2 (0, t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec2 (-t, -t); + assert (IMATH_INTERNAL_NAMESPACE::equal ( + v.length (), t * std::sqrt (2), t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + t = s / (1 << 20); + + v = Vec2 (t, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec2 (0, t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec2 (-t, -t); + assert (IMATH_INTERNAL_NAMESPACE::equal ( + v.length (), t * std::sqrt (2), t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); +} + +template +void +testLength3T () +{ + const T s = std::sqrt (std::numeric_limits::min ()); + const T e = 4 * std::numeric_limits::epsilon (); + + Vec3 v; + + v = Vec3 (0, 0, 0); + assert (v.length () == 0); + assert (v.normalized ().length () == 0); + + v = Vec3 (3, 4, 0); + assert (v.length () == 5); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + v = Vec3 (3000, 4000, 0); + assert (v.length () == 5000); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + v = Vec3 (1, -1, 1); + assert ( + IMATH_INTERNAL_NAMESPACE::equal (v.length (), 1 * std::sqrt (3), e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + v = Vec3 (1000, -1000, 1000); + assert (IMATH_INTERNAL_NAMESPACE::equal ( + v.length (), 1000 * std::sqrt (3), 1000 * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + T t = s * (1 << 4); + + v = Vec3 (t, 0, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec3 (0, t, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec3 (0, 0, t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec3 (-t, -t, -t); + assert (IMATH_INTERNAL_NAMESPACE::equal ( + v.length (), t * std::sqrt (3), t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + t = s / (1 << 4); + + v = Vec3 (t, 0, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec3 (0, t, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec3 (0, 0, t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec3 (-t, -t, -t); + assert (IMATH_INTERNAL_NAMESPACE::equal ( + v.length (), t * std::sqrt (3), t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + t = s / (1 << 20); + + v = Vec3 (t, 0, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec3 (0, t, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec3 (0, 0, t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec3 (-t, -t, -t); + assert (IMATH_INTERNAL_NAMESPACE::equal ( + v.length (), t * std::sqrt (3), t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); +} + +template +void +testLength4T () +{ + const T s = std::sqrt (std::numeric_limits::min ()); + const T e = 4 * std::numeric_limits::epsilon (); + + Vec4 v; + + v = Vec4 (0, 0, 0, 0); + assert (v.length () == 0); + assert (v.normalized ().length () == 0); + + v = Vec4 (3, 4, 0, 0); + assert (v.length () == 5); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + v = Vec4 (3000, 4000, 0, 0); + assert (v.length () == 5000); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + v = Vec4 (1, -1, 1, 1); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), 2, e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + v = Vec4 (1000, -1000, 1000, 1000); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), 2000, 1000 * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + T t = s * (1 << 4); + + v = Vec4 (t, 0, 0, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (0, t, 0, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (0, 0, t, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (0, 0, 0, t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (-t, -t, -t, -t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t * 2, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + t = s / (1 << 4); + + v = Vec4 (t, 0, 0, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (0, t, 0, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (0, 0, t, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (0, 0, 0, t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (-t, -t, -t, -t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t * 2, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + + t = s / (1 << 20); + + v = Vec4 (t, 0, 0, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (0, t, 0, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (0, 0, t, 0); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (0, 0, 0, t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); + v = Vec4 (-t, -t, -t, -t); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.length (), t * 2, t * e)); + assert (IMATH_INTERNAL_NAMESPACE::equal (v.normalized ().length (), 1, e)); +} + +} // namespace + +void +testVec () +{ + cout << "Testing some basic vector operations" << endl; + + testLength2T (); + testLength2T (); + testLength3T (); + testLength3T (); + testLength4T (); + testLength4T (); + + cout << "ok\n" << endl; +} diff --git a/third_party/Imath-3.1.9/src/ImathTest/testVec.h b/third_party/Imath/src/ImathTest/testVec.h similarity index 85% rename from third_party/Imath-3.1.9/src/ImathTest/testVec.h rename to third_party/Imath/src/ImathTest/testVec.h index 652c142b..964e106c 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testVec.h +++ b/third_party/Imath/src/ImathTest/testVec.h @@ -3,4 +3,4 @@ // Copyright Contributors to the OpenEXR Project. // -void testVec(); +void testVec (); diff --git a/third_party/Imath-3.1.9/src/python/CMakeLists.txt b/third_party/Imath/src/python/CMakeLists.txt similarity index 86% rename from third_party/Imath-3.1.9/src/python/CMakeLists.txt rename to third_party/Imath/src/python/CMakeLists.txt index 1bc1e544..57903f7d 100644 --- a/third_party/Imath-3.1.9/src/python/CMakeLists.txt +++ b/third_party/Imath/src/python/CMakeLists.txt @@ -138,23 +138,29 @@ if(Boost_NO_BOOST_CMAKE) message(STATUS "Disabling boost-provided cmake config. If this causes problems, consider setting Boost_NO_BOOST_CMAKE variable to OFF") endif() -find_package(Boost OPTIONAL_COMPONENTS - python - python${Python_VERSION_MAJOR} - ${PYIMATH_BOOST_PY_COMPONENT}) -set(_pyimath_have_perver_boost) -if(PYIMATH_BOOST_PY_COMPONENT) - string(TOUPPER ${PYIMATH_BOOST_PY_COMPONENT} PYIMATH_PY_UPPER) -else() - set(PYIMATH_BOOST_PY_COMPONENT python${Python_VERSION_MAJOR}x_NOTFOUND) - set(PYIMATH_PY_UPPER PYTHON${Python_VERSION_MAJOR}X_NOTFOUND) -endif() -if(Boost_PYTHON${Python_VERSION_MAJOR}_FOUND OR Boost_${PYIMATH_PY_UPPER}_FOUND) - set(_pyimath_have_perver_boost TRUE) - if(NOT Boost_${PYIMATH_PY_UPPER}_FOUND) - message(WARNING "Legacy Boost python${Python_VERSION_MAJOR} found, but does not include minor version, this is an old configuration and may not be portable") - set(PYIMATH_BOOST_PY_COMPONENT python${Python_VERSION_MAJOR}) +if (PYTHON) + find_package(Boost OPTIONAL_COMPONENTS + python + python${Python_VERSION_MAJOR} + ${PYIMATH_BOOST_PY_COMPONENT}) + set(_pyimath_have_perver_boost) + if(PYIMATH_BOOST_PY_COMPONENT) + string(TOUPPER ${PYIMATH_BOOST_PY_COMPONENT} PYIMATH_PY_UPPER) + else() + set(PYIMATH_BOOST_PY_COMPONENT python${Python_VERSION_MAJOR}x_NOTFOUND) + set(PYIMATH_PY_UPPER PYTHON${Python_VERSION_MAJOR}X_NOTFOUND) endif() + if(Boost_PYTHON${Python_VERSION_MAJOR}_FOUND OR Boost_${PYIMATH_PY_UPPER}_FOUND) + set(_pyimath_have_perver_boost TRUE) + if(NOT Boost_${PYIMATH_PY_UPPER}_FOUND) + message(WARNING "Legacy Boost python${Python_VERSION_MAJOR} found, but does not include minor version, this is an old configuration and may not be portable") + set(PYIMATH_BOOST_PY_COMPONENT python${Python_VERSION_MAJOR}) + endif() + endif() +endif() + +if (PYBIND11) + find_package(pybind11 REQUIRED) endif() if(Boost_PYTHON_FOUND AND NOT _pyimath_have_perver_boost) @@ -163,10 +169,10 @@ if(Boost_PYTHON_FOUND AND NOT _pyimath_have_perver_boost) set(PYIMATH_BOOST_PY_COMPONENT python) # set it to a bogus string but not empty so later we don't test against a namespace only target # set(PYIMATH_BOOST_PY3_COMPONENT pythonIgnore) -elseif(NOT _pyimath_have_perver_boost) +elseif(NOT _pyimath_have_perver_boost AND NOT pybind11_FOUND) message(WARNING "Unable to find boost::python library, disabling PyImath. If you believe this is wrong, check the cmake documentation and see if you need to set Boost_ROOT or Boost_NO_BOOST_CMAKE") return() -else() +elseif(NOT pybind11_FOUND) if(TARGET Boost::${PYIMATH_BOOST_PY_COMPONENT}) message(STATUS "Found Python ${Python_VERSION_MAJOR} boost: Boost::${PYIMATH_BOOST_PY_COMPONENT}") elseif(Boost_PYTHON_FOUND OR Boost_${PYIMATH_PY_UPPER}_FOUND) @@ -195,7 +201,14 @@ if(NOT BUILD_SHARED_LIBS) message(WARNING "Forcing python bindings to be built with dynamic libraries") endif() -add_subdirectory( PyImath ) +if ( pybind11_FOUND ) + message(STATUS "PyBind11 PyImath") + add_subdirectory( PyBindImath ) +else() + message(STATUS "Boost PyImath") + add_subdirectory( PyImath ) +endif() + if(TARGET Python2::ImathNumPy OR TARGET Python3::ImathNumPy) add_subdirectory( PyImathNumpy ) endif() @@ -206,9 +219,12 @@ endif() include(CTest) if(BUILD_TESTING) enable_testing() - add_subdirectory( PyImathTest ) - add_subdirectory( PyImathSpeedTest ) - if(TARGET Python2::ImathNumPy OR TARGET Python3::ImathNumPy) - add_subdirectory( PyImathNumpyTest ) + add_subdirectory( PyImathPythonTest ) + if (PYTHON) + add_subdirectory( PyImathTest ) + add_subdirectory( PyImathSpeedTest ) + if(TARGET Python2::ImathNumPy OR TARGET Python3::ImathNumPy) + add_subdirectory( PyImathNumpyTest ) + endif() endif() endif() diff --git a/third_party/Imath/src/python/PyBindImath/CMakeLists.txt b/third_party/Imath/src/python/PyBindImath/CMakeLists.txt new file mode 100644 index 00000000..ccd45473 --- /dev/null +++ b/third_party/Imath/src/python/PyBindImath/CMakeLists.txt @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright Contributors to the OpenEXR Project. + +pyimath_define_module(imath + LIBNAME PyBindImath + PRIV_EXPORT PYIMATH_BUILD + CURDIR ${CMAKE_CURRENT_SOURCE_DIR} + LIBSOURCE + PyImathVec.cpp + MODSOURCE + imathmodule.cpp + PyImathVec.cpp + PyImathBox.cpp + HEADERS + PyImathExport.h + DEPENDENCIES + Imath + ) diff --git a/third_party/Imath/src/python/PyBindImath/PyImath.h b/third_party/Imath/src/python/PyBindImath/PyImath.h new file mode 100644 index 00000000..3769bbef --- /dev/null +++ b/third_party/Imath/src/python/PyBindImath/PyImath.h @@ -0,0 +1,25 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +// clang-format off + +#include +#include +#include +#include +#include +#include "PyImathExport.h" + +#ifndef _PyBindImath_h_ +#define _PyBindImath_h_ + +namespace PyImath { + +PYIMATH_EXPORT void register_imath_vec(pybind11::module& m); +PYIMATH_EXPORT void register_imath_box(pybind11::module& m); + +} + +#endif diff --git a/third_party/Imath/src/python/PyBindImath/PyImathBox.cpp b/third_party/Imath/src/python/PyBindImath/PyImathBox.cpp new file mode 100644 index 00000000..07ac7224 --- /dev/null +++ b/third_party/Imath/src/python/PyBindImath/PyImathBox.cpp @@ -0,0 +1,60 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#include "PyImath.h" +#include + +namespace PyImath { + +template +void register_box(pybind11::class_& c) +{ + c.def(pybind11::init<>()) + .def(pybind11::init()) + .def(pybind11::init()) + .def(pybind11::self == pybind11::self) + .def(pybind11::self != pybind11::self) + .def("makeEmpty", &T::makeEmpty, "makeEmpty() make the box empty") + .def("makeInfinite", &T::makeInfinite, "makeInfinite() make the box cover all space") + .def_readwrite("min", &T::min) + .def_readwrite("max", &T::max) + .def("extendBy", pybind11::overload_cast(&T::extendBy), "extendBy(point) extend the box by a box") + .def("extendBy", pybind11::overload_cast(&T::extendBy), "extendBy(point) extend the box by a point") + .def("size", &T::size, "size() size of the box") + .def("center", &T::center, "center() center of the box") + .def("intersects",pybind11::overload_cast(&T::extendBy), "intersects(point) returns true if the box intersects the given point") + .def("intersects",pybind11::overload_cast(&T::extendBy), "intersects(box) returns true if the box intersects the given box") + .def("majorAxis",&T::majorAxis, "majorAxis() major axis of the box") + .def("isEmpty",&T::isEmpty, "isEmpty() returns true if the box is empty") + .def("isInfinite",&T::isInfinite, "isInfinite() returns true if the box covers all space") + .def("hasVolume",&T::hasVolume, "hasVolume() returns true if the box has volume"); + +} + +template +void register_box2(pybind11::module& m, const char * name) +{ + pybind11::class_ c(m, name); + register_box(c); +} + +template +void register_box3(pybind11::module& m, const char * name) +{ + pybind11::class_ c(m, name); + register_box(c); +} + +void register_imath_box(pybind11::module& m) +{ + register_box2(m, "Box2d"); + register_box2(m, "Box2f"); + + register_box3(m, "Box3d"); + register_box3(m, "Box3f"); + +} + +} \ No newline at end of file diff --git a/third_party/Imath/src/python/PyBindImath/PyImathExport.h b/third_party/Imath/src/python/PyBindImath/PyImathExport.h new file mode 100644 index 00000000..d48c5f7e --- /dev/null +++ b/third_party/Imath/src/python/PyBindImath/PyImathExport.h @@ -0,0 +1,28 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +// clang-format off + +#ifndef PYBINDIMATHEXPORT_H +#define PYBINDIMATHEXPORT_H + +#if defined(IMATH_DLL) + #if defined(PLATFORM_VISIBILITY_AVAILABLE) + #define PYIMATH_EXPORT __attribute__((visibility("default"))) + #define PYIMATH_EXPORT __attribute__((visibility("default"))) + #elif defined(_MSC_VER) + #if defined(PYIMATH_BUILD) + #define PYIMATH_EXPORT __declspec(dllexport) + #else + #define PYIMATH_EXPORT __declspec(dllimport) + #endif + #else + #define PYIMATH_EXPORT + #endif +#else + #define PYIMATH_EXPORT +#endif + +#endif // #ifndef PYBINDIMATHEXPORT_H diff --git a/third_party/Imath/src/python/PyBindImath/PyImathVec.cpp b/third_party/Imath/src/python/PyBindImath/PyImathVec.cpp new file mode 100644 index 00000000..ddb10934 --- /dev/null +++ b/third_party/Imath/src/python/PyBindImath/PyImathVec.cpp @@ -0,0 +1,127 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#include "PyImath.h" +#include +#include + +namespace PyImath { + +template +void register_vec(pybind11::class_& c) +{ + c.def(pybind11::self == pybind11::self) + .def(pybind11::self != pybind11::self) + .def(pybind11::self + pybind11::self) + .def(pybind11::self += pybind11::self) + .def(pybind11::self * pybind11::self) + .def(pybind11::self * int()) + .def(pybind11::self * float()) + .def(pybind11::self * double()) + .def(pybind11::self *= pybind11::self) + .def(pybind11::self *= int()) + .def(pybind11::self *= float()) + .def(pybind11::self *= double()) + .def(pybind11::self / pybind11::self) + .def(pybind11::self / int()) + .def(pybind11::self / float()) + .def(pybind11::self / double()) + .def(pybind11::self /= pybind11::self) + .def(pybind11::self /= int()) + .def(pybind11::self /= float()) + .def(pybind11::self /= double()) + .def(pybind11::self - pybind11::self) + .def(pybind11::self -= pybind11::self) + .def(pybind11::self ^ pybind11::self) + .def(-pybind11::self) + .def_static("baseTypeEpsilon", &T::baseTypeEpsilon,"baseTypeEpsilon() epsilon value of the base type of the vector") + .def_static("baseTypeMax", &T::baseTypeMax,"baseTypeMax() max value of the base type of the vector") + .def_static("baseTypeLowest", &T::baseTypeLowest,"baseTypeLowest() largest negative value of the base type of the vector") + .def_static("baseTypeSmallest", &T::baseTypeSmallest,"baseTypeSmallest() smallest value of the base type of the vector") + .def("dot", &T::dot, "v1.dot(v2) inner product of the two vectors") + .def("dimensions", &T::dimensions, "dimensions() number of dimensions in the vector") + .def("equalWithAbsError", &T::equalWithAbsError, "v1.equalWithAbsError(v2) true if the elements of v1 and v2 are the same with an absolute error of no more than e, i.e., abs(v1[i] - v2[i]) <= e") + .def("equalWithRelError", &T::equalWithRelError, "v1.equalWithRelError(v2) true if the elements of v1 and v2 are the same with a relative error of no more than e, i.e., abs(v1[i] - v2[i]) <= e * abs(v1[i])") + .def("length", &T::length, "length() magnitude of the vector") + .def("length2", &T::length2,"length2() square magnitude of the vector") + .def("negate", &T::negate) + .def("normalize", &T::normalize, "v.normalize() destructively normalizes v and returns a reference to it") + .def("normalizeExc", &T::normalizeExc, "v.normalizeExc() destructively normalizes V and returns a reference to it, throwing an exception if length() == 0") + .def("normalizeNonNull", &T::normalizeNonNull, "v.normalizeNonNull() destructively normalizes V and returns a reference to it, faster if length() != 0") + .def("normalized", &T::normalized, "v.normalized() returns a normalized copy of v") + .def("normalizedExc", &T::normalizedExc, "v.normalizedExc() returns a normalized copy of v, throwing an exception if length() == 0") + .def("normalizedNonNull", &T::normalizedNonNull, "v.normalizedNonNull() returns a normalized copy of v, faster if lngth() != 0") + + // things from ImathVecAlgo + .def("closestVertex", &IMATH_NAMESPACE::closestVertex) + .def("orthogonal", &IMATH_NAMESPACE::orthogonal) + .def("project", &IMATH_NAMESPACE::project) + .def("reflect", &IMATH_NAMESPACE::reflect) + ; +} + +template +void register_vec2(pybind11::module& m, const char * name) +{ + // no %= + + pybind11::class_ c(m, name); + c.def(pybind11::init<>()) + .def(pybind11::init()) + .def(pybind11::init()) + .def(pybind11::self % pybind11::self) + .def("cross", &T::cross, "v1.cross(v2) right handed cross product") + .def_readwrite("x", &T::x) + .def_readwrite("y", &T::y); + + register_vec(c); +} + +template +void register_vec3(pybind11::module& m, const char * name) +{ + pybind11::class_ c(m, name); + c.def(pybind11::init<>()) + .def(pybind11::init()) + .def(pybind11::init()) + .def(pybind11::self % pybind11::self) + .def(pybind11::self %= pybind11::self) + .def("cross", &T::cross, "v1.cross(v2) right handed cross product") + .def_readwrite("x", &T::x) + .def_readwrite("y", &T::y) + .def_readwrite("z", &T::z); + + register_vec(c); +} + +template +void register_vec4(pybind11::module& m, const char * name) +{ + // Does a cross product not exist for Vec4? if not then thats why there is no % %= cross + pybind11::class_ c(m, name); + c.def(pybind11::init<>()) + .def(pybind11::init()) + .def(pybind11::init()) + .def_readwrite("x", &T::x) + .def_readwrite("y", &T::y) + .def_readwrite("z", &T::z) + .def_readwrite("w", &T::z); + + register_vec(c); +} + +void register_imath_vec(pybind11::module& m) +{ + register_vec2(m, "V2d"); + register_vec2(m, "V2f"); + + register_vec3(m, "V3d"); + register_vec3(m, "V3f"); + + register_vec4(m, "V4d"); + register_vec4(m, "V4f"); +} + +} \ No newline at end of file diff --git a/third_party/Imath/src/python/PyBindImath/imathmodule.cpp b/third_party/Imath/src/python/PyBindImath/imathmodule.cpp new file mode 100644 index 00000000..a210b625 --- /dev/null +++ b/third_party/Imath/src/python/PyBindImath/imathmodule.cpp @@ -0,0 +1,74 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. +// + +#include "PyImath.h" +#include + +PYBIND11_MODULE(imath, m) +{ + m.doc() = "Imath module"; + m.attr("__version__") = IMATH_VERSION_STRING; + + PyImath::register_imath_vec(m); + PyImath::register_imath_box(m); + + // + // Initialize constants + // + pybind11::enum_(m, "Order") + .value("EULER_XYZ", IMATH_NAMESPACE::Eulerf::XYZ) + .value("EULER_XZY", IMATH_NAMESPACE::Eulerf::XZY) + .value("EULER_YZX", IMATH_NAMESPACE::Eulerf::YZX) + .value("EULER_YXZ", IMATH_NAMESPACE::Eulerf::YXZ) + .value("EULER_ZXY", IMATH_NAMESPACE::Eulerf::ZXY) + .value("EULER_ZYX", IMATH_NAMESPACE::Eulerf::ZYX) + .value("EULER_XZX", IMATH_NAMESPACE::Eulerf::XZX) + .value("EULER_XYX", IMATH_NAMESPACE::Eulerf::XYX) + .value("EULER_YXY", IMATH_NAMESPACE::Eulerf::YXY) + .value("EULER_YZY", IMATH_NAMESPACE::Eulerf::YZY) + .value("EULER_ZYZ", IMATH_NAMESPACE::Eulerf::ZYZ) + .value("EULER_ZXZ", IMATH_NAMESPACE::Eulerf::ZXZ) + .value("EULER_XYZr", IMATH_NAMESPACE::Eulerf::XYZr) + .value("EULER_XZYr", IMATH_NAMESPACE::Eulerf::XZYr) + .value("EULER_YZXr", IMATH_NAMESPACE::Eulerf::YZXr) + .value("EULER_YXZr", IMATH_NAMESPACE::Eulerf::YXZr) + .value("EULER_ZXYr", IMATH_NAMESPACE::Eulerf::ZXYr) + .value("EULER_ZYXr", IMATH_NAMESPACE::Eulerf::ZYXr) + .value("EULER_XZXr", IMATH_NAMESPACE::Eulerf::XZXr) + .value("EULER_XYXr", IMATH_NAMESPACE::Eulerf::XYXr) + .value("EULER_YXYr", IMATH_NAMESPACE::Eulerf::YXYr) + .value("EULER_YZYr", IMATH_NAMESPACE::Eulerf::YZYr) + .value("EULER_ZYZr", IMATH_NAMESPACE::Eulerf::ZYZr) + .value("EULER_ZXZr", IMATH_NAMESPACE::Eulerf::ZXZr) + .export_values(); + + pybind11::enum_(m, "Axis") + .value("EULER_X_AXIS", IMATH_NAMESPACE::Eulerf::X) + .value("EULER_Y_AXIS", IMATH_NAMESPACE::Eulerf::Y) + .value("EULER_Z_AXIS", IMATH_NAMESPACE::Eulerf::Z) + .export_values(); + + pybind11::enum_(m, "InputLayout") + .value("EULER_IJKLayout", IMATH_NAMESPACE::Eulerf::IJKLayout) + .value("EULER_XYZLayout", IMATH_NAMESPACE::Eulerf::XYZLayout) + .export_values(); + + + m.attr("INT_MIN") = std::numeric_limits::min(); + m.attr("INT_MAX") = std::numeric_limits::max(); + m.attr("INT_LOWEST") = std::numeric_limits::lowest(); + m.attr("INT_EPS") = std::numeric_limits::epsilon(); + + m.attr("FLT_MIN") = std::numeric_limits::min(); + m.attr("FLT_MAX") = std::numeric_limits::max(); + m.attr("FLT_LOWEST") = std::numeric_limits::lowest(); + m.attr("FLT_EPS") = std::numeric_limits::epsilon(); + + m.attr("DBL_MIN") = std::numeric_limits::min(); + m.attr("DBL_MAX") = std::numeric_limits::max(); + m.attr("DBL_LOWEST") = std::numeric_limits::lowest(); + m.attr("DBL_EPS") = std::numeric_limits::epsilon(); + +} \ No newline at end of file diff --git a/third_party/Imath-3.1.9/src/python/PyImath.pc.in b/third_party/Imath/src/python/PyImath.pc.in similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath.pc.in rename to third_party/Imath/src/python/PyImath.pc.in diff --git a/third_party/Imath-3.1.9/src/python/PyImath/CMakeLists.txt b/third_party/Imath/src/python/PyImath/CMakeLists.txt similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/CMakeLists.txt rename to third_party/Imath/src/python/PyImath/CMakeLists.txt diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImath.cpp b/third_party/Imath/src/python/PyImath/PyImath.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImath.cpp rename to third_party/Imath/src/python/PyImath/PyImath.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImath.h b/third_party/Imath/src/python/PyImath/PyImath.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImath.h rename to third_party/Imath/src/python/PyImath/PyImath.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathAPI.h b/third_party/Imath/src/python/PyImath/PyImathAPI.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathAPI.h rename to third_party/Imath/src/python/PyImath/PyImathAPI.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathAutovectorize.cpp b/third_party/Imath/src/python/PyImath/PyImathAutovectorize.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathAutovectorize.cpp rename to third_party/Imath/src/python/PyImath/PyImathAutovectorize.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathAutovectorize.h b/third_party/Imath/src/python/PyImath/PyImathAutovectorize.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathAutovectorize.h rename to third_party/Imath/src/python/PyImath/PyImathAutovectorize.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathBasicTypes.cpp b/third_party/Imath/src/python/PyImath/PyImathBasicTypes.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathBasicTypes.cpp rename to third_party/Imath/src/python/PyImath/PyImathBasicTypes.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathBasicTypes.h b/third_party/Imath/src/python/PyImath/PyImathBasicTypes.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathBasicTypes.h rename to third_party/Imath/src/python/PyImath/PyImathBasicTypes.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathBox.cpp b/third_party/Imath/src/python/PyImath/PyImathBox.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathBox.cpp rename to third_party/Imath/src/python/PyImath/PyImathBox.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathBox.h b/third_party/Imath/src/python/PyImath/PyImathBox.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathBox.h rename to third_party/Imath/src/python/PyImath/PyImathBox.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathBox2Array.cpp b/third_party/Imath/src/python/PyImath/PyImathBox2Array.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathBox2Array.cpp rename to third_party/Imath/src/python/PyImath/PyImathBox2Array.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathBox3Array.cpp b/third_party/Imath/src/python/PyImath/PyImathBox3Array.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathBox3Array.cpp rename to third_party/Imath/src/python/PyImath/PyImathBox3Array.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathBoxArrayImpl.h b/third_party/Imath/src/python/PyImath/PyImathBoxArrayImpl.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathBoxArrayImpl.h rename to third_party/Imath/src/python/PyImath/PyImathBoxArrayImpl.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathBufferProtocol.cpp b/third_party/Imath/src/python/PyImath/PyImathBufferProtocol.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathBufferProtocol.cpp rename to third_party/Imath/src/python/PyImath/PyImathBufferProtocol.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathBufferProtocol.h b/third_party/Imath/src/python/PyImath/PyImathBufferProtocol.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathBufferProtocol.h rename to third_party/Imath/src/python/PyImath/PyImathBufferProtocol.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathColor.h b/third_party/Imath/src/python/PyImath/PyImathColor.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathColor.h rename to third_party/Imath/src/python/PyImath/PyImathColor.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathColor3.cpp b/third_party/Imath/src/python/PyImath/PyImathColor3.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathColor3.cpp rename to third_party/Imath/src/python/PyImath/PyImathColor3.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathColor3ArrayImpl.h b/third_party/Imath/src/python/PyImath/PyImathColor3ArrayImpl.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathColor3ArrayImpl.h rename to third_party/Imath/src/python/PyImath/PyImathColor3ArrayImpl.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathColor4.cpp b/third_party/Imath/src/python/PyImath/PyImathColor4.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathColor4.cpp rename to third_party/Imath/src/python/PyImath/PyImathColor4.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathColor4Array2DImpl.h b/third_party/Imath/src/python/PyImath/PyImathColor4Array2DImpl.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathColor4Array2DImpl.h rename to third_party/Imath/src/python/PyImath/PyImathColor4Array2DImpl.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathColor4ArrayImpl.h b/third_party/Imath/src/python/PyImath/PyImathColor4ArrayImpl.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathColor4ArrayImpl.h rename to third_party/Imath/src/python/PyImath/PyImathColor4ArrayImpl.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathDecorators.h b/third_party/Imath/src/python/PyImath/PyImathDecorators.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathDecorators.h rename to third_party/Imath/src/python/PyImath/PyImathDecorators.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathEuler.cpp b/third_party/Imath/src/python/PyImath/PyImathEuler.cpp similarity index 93% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathEuler.cpp rename to third_party/Imath/src/python/PyImath/PyImathEuler.cpp index 2de636f2..ff1fceae 100644 --- a/third_party/Imath-3.1.9/src/python/PyImath/PyImathEuler.cpp +++ b/third_party/Imath/src/python/PyImath/PyImathEuler.cpp @@ -175,7 +175,7 @@ setXYZTuple(Euler &euler, const tuple &t) euler.setXYZVector(v); } else - throw std::invalid_argument ("Color3 expects tuple of length 3"); + throw std::invalid_argument ("Euler expects tuple of length 3"); } // needed to convert Eulerf::Order to Euler::Order @@ -288,6 +288,15 @@ static typename Euler::Order interpretOrder(typename IMATH_NAMESPACE::Eulerf: return o; } +// needed to convert Eulerf::InputLayout to Euler::InputLayout +template +static typename Euler::InputLayout interpretInputLayout(typename IMATH_NAMESPACE::Eulerf::InputLayout layout) +{ + if (layout == IMATH_NAMESPACE::Eulerf::XYZLayout) + return Euler::XYZLayout; + return Euler::IJKLayout; +} + // needed to convert Eulerf::Axis to Euler::Axis template static typename Euler::Axis interpretAxis(typename IMATH_NAMESPACE::Eulerf::Axis axis) @@ -302,10 +311,13 @@ static typename Euler::Axis interpretAxis(typename IMATH_NAMESPACE::Eulerf::A template static Euler * -eulerConstructor1(const Vec3 &v, typename IMATH_NAMESPACE::Eulerf::Order order) +eulerConstructor1(const Vec3 &v, + typename IMATH_NAMESPACE::Eulerf::Order order, + typename IMATH_NAMESPACE::Eulerf::InputLayout layout = IMATH_NAMESPACE::Eulerf::IJKLayout) { typename Euler::Order o = interpretOrder(order); - return new Euler(v, o); + typename Euler::InputLayout l = interpretInputLayout(layout); + return new Euler(v, o, l); } template @@ -323,12 +335,35 @@ eulerConstructor1b(const Vec3 &v, int iorder) return new Euler(v, o); } +// + template static Euler * -eulerConstructor2(T i, T j, T k, typename IMATH_NAMESPACE::Eulerf::Order order) +eulerConstructor1d(const Euler& e, int iorder) +{ + typename Euler::Order o = typename Euler::Order (iorder); + return new Euler(e, o); +} + +template +static Euler * +eulerConstructor1e(const Euler& e, int iorder, int layout) +{ + typename Euler::Order o = typename Euler::Order (iorder); + typename Euler::InputLayout l = typename Euler::InputLayout (layout); + return new Euler(e, o, l); +} + + +template +static Euler * +eulerConstructor2(T i, T j, T k, + typename IMATH_NAMESPACE::Eulerf::Order order, + typename IMATH_NAMESPACE::Eulerf::InputLayout layout = IMATH_NAMESPACE::Eulerf::IJKLayout) { typename Euler::Order o = interpretOrder(order); - return new Euler(i, j, k, o); + typename Euler::InputLayout l = interpretInputLayout(layout); + return new Euler(i, j, k, o, l); } template @@ -549,6 +584,8 @@ register_Euler() .def("__init__", make_constructor(eulerConstructor1)) .def("__init__", make_constructor(eulerConstructor1a)) .def("__init__", make_constructor(eulerConstructor1b)) + .def("__init__", make_constructor(eulerConstructor1d)) + .def("__init__", make_constructor(eulerConstructor1e)) .def("__init__", make_constructor(eulerConstructor2)) .def("__init__", make_constructor(eulerConstructor2a)) .def("__init__", make_constructor(eulerConstructor2b)) diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathEuler.h b/third_party/Imath/src/python/PyImath/PyImathEuler.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathEuler.h rename to third_party/Imath/src/python/PyImath/PyImathEuler.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathExport.h b/third_party/Imath/src/python/PyImath/PyImathExport.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathExport.h rename to third_party/Imath/src/python/PyImath/PyImathExport.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedArray.cpp b/third_party/Imath/src/python/PyImath/PyImathFixedArray.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedArray.cpp rename to third_party/Imath/src/python/PyImath/PyImathFixedArray.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedArray.h b/third_party/Imath/src/python/PyImath/PyImathFixedArray.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedArray.h rename to third_party/Imath/src/python/PyImath/PyImathFixedArray.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedArray2D.h b/third_party/Imath/src/python/PyImath/PyImathFixedArray2D.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedArray2D.h rename to third_party/Imath/src/python/PyImath/PyImathFixedArray2D.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedArrayTraits.h b/third_party/Imath/src/python/PyImath/PyImathFixedArrayTraits.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedArrayTraits.h rename to third_party/Imath/src/python/PyImath/PyImathFixedArrayTraits.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedMatrix.h b/third_party/Imath/src/python/PyImath/PyImathFixedMatrix.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedMatrix.h rename to third_party/Imath/src/python/PyImath/PyImathFixedMatrix.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedVArray.cpp b/third_party/Imath/src/python/PyImath/PyImathFixedVArray.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedVArray.cpp rename to third_party/Imath/src/python/PyImath/PyImathFixedVArray.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedVArray.h b/third_party/Imath/src/python/PyImath/PyImathFixedVArray.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFixedVArray.h rename to third_party/Imath/src/python/PyImath/PyImathFixedVArray.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFrustum.cpp b/third_party/Imath/src/python/PyImath/PyImathFrustum.cpp similarity index 99% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFrustum.cpp rename to third_party/Imath/src/python/PyImath/PyImathFrustum.cpp index adec1179..7b46a80a 100644 --- a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFrustum.cpp +++ b/third_party/Imath/src/python/PyImath/PyImathFrustum.cpp @@ -112,6 +112,7 @@ projectScreenToRayTuple(Frustum &f, const tuple &t) } +// dead code? template static Vec2 projectPointToScreen (Frustum &f, const Vec3 &p) @@ -120,6 +121,7 @@ projectPointToScreen (Frustum &f, const Vec3 &p) return f.projectPointToScreen(p); } +// dead code? template static Vec2 projectPointToScreenTuple(Frustum &f, const tuple &t) @@ -224,6 +226,7 @@ screenRadiusTuple(Frustum &f, const tuple &t, T radius) throw std::invalid_argument ("screenRadius expects tuple of length 3"); } +// dead code? template static void planes1(Frustum &f, Plane3 *p) @@ -232,6 +235,7 @@ planes1(Frustum &f, Plane3 *p) f.planes(p); } +// dead code? template static void planes2(Frustum &f, Plane3 *p, const Matrix44 &m) @@ -466,6 +470,7 @@ register_FrustumTest() { const char *name = FrustumTestName::value; + // dead code? no wrapping for Sphere3 bool (FrustumTest::*isVisibleS)(const Sphere3 &) const = &FrustumTest::isVisible; bool (FrustumTest::*isVisibleB)(const Box > &) const = &FrustumTest::isVisible; bool (FrustumTest::*isVisibleV)(const Vec3 &) const = &FrustumTest::isVisible; diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFrustum.h b/third_party/Imath/src/python/PyImath/PyImathFrustum.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFrustum.h rename to third_party/Imath/src/python/PyImath/PyImathFrustum.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFun.cpp b/third_party/Imath/src/python/PyImath/PyImathFun.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFun.cpp rename to third_party/Imath/src/python/PyImath/PyImathFun.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFun.h b/third_party/Imath/src/python/PyImath/PyImathFun.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFun.h rename to third_party/Imath/src/python/PyImath/PyImathFun.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathFunOperators.h b/third_party/Imath/src/python/PyImath/PyImathFunOperators.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathFunOperators.h rename to third_party/Imath/src/python/PyImath/PyImathFunOperators.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathLine.cpp b/third_party/Imath/src/python/PyImath/PyImathLine.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathLine.cpp rename to third_party/Imath/src/python/PyImath/PyImathLine.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathLine.h b/third_party/Imath/src/python/PyImath/PyImathLine.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathLine.h rename to third_party/Imath/src/python/PyImath/PyImathLine.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathMathExc.h b/third_party/Imath/src/python/PyImath/PyImathMathExc.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathMathExc.h rename to third_party/Imath/src/python/PyImath/PyImathMathExc.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathMatrix.h b/third_party/Imath/src/python/PyImath/PyImathMatrix.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathMatrix.h rename to third_party/Imath/src/python/PyImath/PyImathMatrix.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathMatrix22.cpp b/third_party/Imath/src/python/PyImath/PyImathMatrix22.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathMatrix22.cpp rename to third_party/Imath/src/python/PyImath/PyImathMatrix22.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathMatrix33.cpp b/third_party/Imath/src/python/PyImath/PyImathMatrix33.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathMatrix33.cpp rename to third_party/Imath/src/python/PyImath/PyImathMatrix33.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathMatrix44.cpp b/third_party/Imath/src/python/PyImath/PyImathMatrix44.cpp similarity index 99% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathMatrix44.cpp rename to third_party/Imath/src/python/PyImath/PyImathMatrix44.cpp index ed9c25cc..21284b4c 100644 --- a/third_party/Imath-3.1.9/src/python/PyImath/PyImathMatrix44.cpp +++ b/third_party/Imath/src/python/PyImath/PyImathMatrix44.cpp @@ -648,6 +648,22 @@ setValue44(Matrix44 &mat, const Matrix44 &value) mat.setValue(value); } +template +static void +setEulerAngles44(Matrix44 &mat, const Vec3 &value) +{ + MATH_EXC_ON; + mat.setEulerAngles(value); +} + +template +static void +setAxisAngle44(Matrix44 &mat, const Vec3 &axis, T angle) +{ + MATH_EXC_ON; + mat.setAxisAngle(axis, angle); +} + template static const Matrix44 & shearV44(Matrix44 &mat, const Vec3 &s) @@ -1109,6 +1125,8 @@ register_Matrix44() .def("setTranslation", &setTranslation44Tuple, return_internal_reference<>(),"setTranslation()") .def("setTranslation", &setTranslation44Obj, return_internal_reference<>(),"setTranslation()") .def("setValue", &setValue44, "setValue()") + .def("setEulerAngles", &setEulerAngles44, "setEulerAngles()") + .def("setAxisAngle", &setAxisAngle44, "setAxisAngle()") .def("shear", &shearV44, return_internal_reference<>(),"shear()") .def("shear", &shearS44, return_internal_reference<>(),"shear()") .def("shear", &shear44Tuple, return_internal_reference<>(),"shear()") diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathOperators.h b/third_party/Imath/src/python/PyImath/PyImathOperators.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathOperators.h rename to third_party/Imath/src/python/PyImath/PyImathOperators.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathPlane.cpp b/third_party/Imath/src/python/PyImath/PyImathPlane.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathPlane.cpp rename to third_party/Imath/src/python/PyImath/PyImathPlane.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathPlane.h b/third_party/Imath/src/python/PyImath/PyImathPlane.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathPlane.h rename to third_party/Imath/src/python/PyImath/PyImathPlane.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathQuat.cpp b/third_party/Imath/src/python/PyImath/PyImathQuat.cpp similarity index 99% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathQuat.cpp rename to third_party/Imath/src/python/PyImath/PyImathQuat.cpp index 413acc53..b0b2937e 100644 --- a/third_party/Imath-3.1.9/src/python/PyImath/PyImathQuat.cpp +++ b/third_party/Imath/src/python/PyImath/PyImathQuat.cpp @@ -79,6 +79,14 @@ invert(Quat &quat) return quat.invert(); } +template +static Quat +identity(Quat &quat) +{ + MATH_EXC_ON; + return Quat(); +} + template static Quat inverse(Quat &quat) @@ -430,7 +438,7 @@ register_Quat() .def("__init__", make_constructor(quatConstructor1)) .def("__init__", make_constructor(quatConstructor2)) .def("__init__", make_constructor(quatConstructor3)) - .def("identity",&Quat::identity) + .def("identity",&identity, "q.identity() -- return an identity quaternion\n") .def("invert",&invert,return_internal_reference<>(), "q.invert() -- inverts quaternion q\n" "(modifying q); returns q") diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathQuat.h b/third_party/Imath/src/python/PyImath/PyImathQuat.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathQuat.h rename to third_party/Imath/src/python/PyImath/PyImathQuat.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathQuatOperators.h b/third_party/Imath/src/python/PyImath/PyImathQuatOperators.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathQuatOperators.h rename to third_party/Imath/src/python/PyImath/PyImathQuatOperators.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathRandom.cpp b/third_party/Imath/src/python/PyImath/PyImathRandom.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathRandom.cpp rename to third_party/Imath/src/python/PyImath/PyImathRandom.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathRandom.h b/third_party/Imath/src/python/PyImath/PyImathRandom.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathRandom.h rename to third_party/Imath/src/python/PyImath/PyImathRandom.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathShear.cpp b/third_party/Imath/src/python/PyImath/PyImathShear.cpp similarity index 99% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathShear.cpp rename to third_party/Imath/src/python/PyImath/PyImathShear.cpp index ca6b7900..0092cd1e 100644 --- a/third_party/Imath-3.1.9/src/python/PyImath/PyImathShear.cpp +++ b/third_party/Imath/src/python/PyImath/PyImathShear.cpp @@ -217,6 +217,7 @@ subtract1(Shear6 &v, tuple t) return w; } +// obsolete? duplicate with subtract1 template static Shear6 subtract2(Shear6 &v, tuple t) diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathShear.h b/third_party/Imath/src/python/PyImath/PyImathShear.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathShear.h rename to third_party/Imath/src/python/PyImath/PyImathShear.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathStringArray.cpp b/third_party/Imath/src/python/PyImath/PyImathStringArray.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathStringArray.cpp rename to third_party/Imath/src/python/PyImath/PyImathStringArray.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathStringArray.h b/third_party/Imath/src/python/PyImath/PyImathStringArray.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathStringArray.h rename to third_party/Imath/src/python/PyImath/PyImathStringArray.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathStringArrayRegister.h b/third_party/Imath/src/python/PyImath/PyImathStringArrayRegister.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathStringArrayRegister.h rename to third_party/Imath/src/python/PyImath/PyImathStringArrayRegister.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathStringTable.cpp b/third_party/Imath/src/python/PyImath/PyImathStringTable.cpp similarity index 95% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathStringTable.cpp rename to third_party/Imath/src/python/PyImath/PyImathStringTable.cpp index af385bcc..344fa958 100644 --- a/third_party/Imath-3.1.9/src/python/PyImath/PyImathStringTable.cpp +++ b/third_party/Imath/src/python/PyImath/PyImathStringTable.cpp @@ -89,8 +89,8 @@ StringTableT::hasStringIndex(const StringTableIndex &s) const } namespace { -template class PYIMATH_EXPORT StringTableDetailT; -template class PYIMATH_EXPORT StringTableDetailT; +template class StringTableDetailT; +template class StringTableDetailT; } template class PYIMATH_EXPORT StringTableT; diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathStringTable.h b/third_party/Imath/src/python/PyImath/PyImathStringTable.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathStringTable.h rename to third_party/Imath/src/python/PyImath/PyImathStringTable.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathTask.cpp b/third_party/Imath/src/python/PyImath/PyImathTask.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathTask.cpp rename to third_party/Imath/src/python/PyImath/PyImathTask.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathTask.h b/third_party/Imath/src/python/PyImath/PyImathTask.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathTask.h rename to third_party/Imath/src/python/PyImath/PyImathTask.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathUtil.cpp b/third_party/Imath/src/python/PyImath/PyImathUtil.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathUtil.cpp rename to third_party/Imath/src/python/PyImath/PyImathUtil.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathUtil.h b/third_party/Imath/src/python/PyImath/PyImathUtil.h similarity index 89% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathUtil.h rename to third_party/Imath/src/python/PyImath/PyImathUtil.h index 52a1fbdf..4b3351f8 100644 --- a/third_party/Imath-3.1.9/src/python/PyImath/PyImathUtil.h +++ b/third_party/Imath/src/python/PyImath/PyImathUtil.h @@ -40,10 +40,10 @@ class PyAcquireLock PYIMATH_EXPORT PyAcquireLock(); PYIMATH_EXPORT ~PyAcquireLock(); - PYIMATH_EXPORT PyAcquireLock(const PyAcquireLock& other) = delete; - PYIMATH_EXPORT PyAcquireLock & operator = (PyAcquireLock& other) = delete; - PYIMATH_EXPORT PyAcquireLock(PyAcquireLock&& other) = delete; - PYIMATH_EXPORT PyAcquireLock & operator = (PyAcquireLock&& other) = delete; + PyAcquireLock(const PyAcquireLock& other) = delete; + PyAcquireLock & operator = (PyAcquireLock& other) = delete; + PyAcquireLock(PyAcquireLock&& other) = delete; + PyAcquireLock & operator = (PyAcquireLock&& other) = delete; private: PyGILState_STATE _gstate; @@ -64,10 +64,10 @@ class PyReleaseLock public: PYIMATH_EXPORT PyReleaseLock(); PYIMATH_EXPORT ~PyReleaseLock(); - PYIMATH_EXPORT PyReleaseLock(const PyReleaseLock& other) = delete; - PYIMATH_EXPORT PyReleaseLock & operator = (PyReleaseLock& other) = delete; - PYIMATH_EXPORT PyReleaseLock(PyReleaseLock&& other) = delete; - PYIMATH_EXPORT PyReleaseLock & operator = (PyReleaseLock&& other) = delete; + PyReleaseLock(const PyReleaseLock& other) = delete; + PyReleaseLock & operator = (PyReleaseLock& other) = delete; + PyReleaseLock(PyReleaseLock&& other) = delete; + PyReleaseLock & operator = (PyReleaseLock&& other) = delete; private: PyThreadState *_save; diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec.h b/third_party/Imath/src/python/PyImath/PyImathVec.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec.h rename to third_party/Imath/src/python/PyImath/PyImathVec.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec2Impl.h b/third_party/Imath/src/python/PyImath/PyImathVec2Impl.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec2Impl.h rename to third_party/Imath/src/python/PyImath/PyImathVec2Impl.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec2fd.cpp b/third_party/Imath/src/python/PyImath/PyImathVec2fd.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec2fd.cpp rename to third_party/Imath/src/python/PyImath/PyImathVec2fd.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec2si.cpp b/third_party/Imath/src/python/PyImath/PyImathVec2si.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec2si.cpp rename to third_party/Imath/src/python/PyImath/PyImathVec2si.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3ArrayImpl.h b/third_party/Imath/src/python/PyImath/PyImathVec3ArrayImpl.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3ArrayImpl.h rename to third_party/Imath/src/python/PyImath/PyImathVec3ArrayImpl.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3Impl.h b/third_party/Imath/src/python/PyImath/PyImathVec3Impl.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3Impl.h rename to third_party/Imath/src/python/PyImath/PyImathVec3Impl.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3fd.cpp b/third_party/Imath/src/python/PyImath/PyImathVec3fd.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3fd.cpp rename to third_party/Imath/src/python/PyImath/PyImathVec3fd.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3si.cpp b/third_party/Imath/src/python/PyImath/PyImathVec3si.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3si.cpp rename to third_party/Imath/src/python/PyImath/PyImathVec3si.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3siArray.cpp b/third_party/Imath/src/python/PyImath/PyImathVec3siArray.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec3siArray.cpp rename to third_party/Imath/src/python/PyImath/PyImathVec3siArray.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4ArrayImpl.h b/third_party/Imath/src/python/PyImath/PyImathVec4ArrayImpl.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4ArrayImpl.h rename to third_party/Imath/src/python/PyImath/PyImathVec4ArrayImpl.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4Impl.h b/third_party/Imath/src/python/PyImath/PyImathVec4Impl.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4Impl.h rename to third_party/Imath/src/python/PyImath/PyImathVec4Impl.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4fd.cpp b/third_party/Imath/src/python/PyImath/PyImathVec4fd.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4fd.cpp rename to third_party/Imath/src/python/PyImath/PyImathVec4fd.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4si.cpp b/third_party/Imath/src/python/PyImath/PyImathVec4si.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4si.cpp rename to third_party/Imath/src/python/PyImath/PyImathVec4si.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4siArray.cpp b/third_party/Imath/src/python/PyImath/PyImathVec4siArray.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVec4siArray.cpp rename to third_party/Imath/src/python/PyImath/PyImathVec4siArray.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImath/PyImathVecOperators.h b/third_party/Imath/src/python/PyImath/PyImathVecOperators.h similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/PyImathVecOperators.h rename to third_party/Imath/src/python/PyImath/PyImathVecOperators.h diff --git a/third_party/Imath-3.1.9/src/python/PyImath/imathmodule.cpp b/third_party/Imath/src/python/PyImath/imathmodule.cpp similarity index 99% rename from third_party/Imath-3.1.9/src/python/PyImath/imathmodule.cpp rename to third_party/Imath/src/python/PyImath/imathmodule.cpp index bc68fbe8..21a60106 100644 --- a/third_party/Imath-3.1.9/src/python/PyImath/imathmodule.cpp +++ b/third_party/Imath/src/python/PyImath/imathmodule.cpp @@ -625,6 +625,8 @@ BOOST_PYTHON_MODULE(imath) scope().attr("EULER_X_AXIS") = IMATH_NAMESPACE::Eulerf::X; scope().attr("EULER_Y_AXIS") = IMATH_NAMESPACE::Eulerf::Y; scope().attr("EULER_Z_AXIS") = IMATH_NAMESPACE::Eulerf::Z; + scope().attr("EULER_IJKLayout") = IMATH_NAMESPACE::Eulerf::IJKLayout; + scope().attr("EULER_XYZLayout") = IMATH_NAMESPACE::Eulerf::XYZLayout; scope().attr("INT_MIN") = std::numeric_limits::min(); scope().attr("INT_MAX") = std::numeric_limits::max(); diff --git a/third_party/Imath-3.1.9/src/python/PyImath/varraySemantics.txt b/third_party/Imath/src/python/PyImath/varraySemantics.txt similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImath/varraySemantics.txt rename to third_party/Imath/src/python/PyImath/varraySemantics.txt diff --git a/third_party/Imath-3.1.9/src/python/PyImathNumpy/CMakeLists.txt b/third_party/Imath/src/python/PyImathNumpy/CMakeLists.txt similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImathNumpy/CMakeLists.txt rename to third_party/Imath/src/python/PyImathNumpy/CMakeLists.txt diff --git a/third_party/Imath-3.1.9/src/python/PyImathNumpy/imathnumpymodule.cpp b/third_party/Imath/src/python/PyImathNumpy/imathnumpymodule.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImathNumpy/imathnumpymodule.cpp rename to third_party/Imath/src/python/PyImathNumpy/imathnumpymodule.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImathNumpyTest/CMakeLists.txt b/third_party/Imath/src/python/PyImathNumpyTest/CMakeLists.txt similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImathNumpyTest/CMakeLists.txt rename to third_party/Imath/src/python/PyImathNumpyTest/CMakeLists.txt diff --git a/third_party/Imath-3.1.9/src/python/PyImathNumpyTest/pyImathNumpyTest.in b/third_party/Imath/src/python/PyImathNumpyTest/pyImathNumpyTest.in similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImathNumpyTest/pyImathNumpyTest.in rename to third_party/Imath/src/python/PyImathNumpyTest/pyImathNumpyTest.in diff --git a/third_party/Imath/src/python/PyImathPythonTest/CMakeLists.txt b/third_party/Imath/src/python/PyImathPythonTest/CMakeLists.txt new file mode 100644 index 00000000..77875423 --- /dev/null +++ b/third_party/Imath/src/python/PyImathPythonTest/CMakeLists.txt @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright Contributors to the OpenEXR Project. + +# this is set by python/config/ModuleDefine.cmake +get_target_property(TEST_PYIMATH_OUTDIR imath_python${Python_VERSION_MAJOR} LIBRARY_OUTPUT_DIRECTORY) +add_test(NAME PyImath_Python_TEST COMMAND Python${Python_VERSION_MAJOR}::Interpreter ${PROJECT_SOURCE_DIR}/src/python/PyImathPythonTest/RunTests.py ${TEST_PYIMATH_OUTDIR}) diff --git a/third_party/Imath/src/python/PyImathPythonTest/RunTests.py b/third_party/Imath/src/python/PyImathPythonTest/RunTests.py new file mode 100644 index 00000000..7e84e3e5 --- /dev/null +++ b/third_party/Imath/src/python/PyImathPythonTest/RunTests.py @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright Contributors to the OpenEXR Project. + +import sys, os, glob, unittest + + +cwd = os.getcwd() + +print(sys.argv) + +# Make sure we're in the correct directory to get the tests +main_dir = os.path.dirname(os.path.abspath(sys.argv[0])) +os.chdir( main_dir ) + +# For now, add the path we import from +# for imath paths and make sure they come +# before any other paths +sys.path.insert(1, os.path.abspath(sys.argv[1])) + +testFiles = sys.argv[2:] + +if not testFiles: + testFiles = glob.glob('test*.py') + +# Load all the tests +suite = unittest.TestSuite() + +for file in testFiles: + name = os.path.splitext(file)[0] + __import__(name) + test = unittest.defaultTestLoader.loadTestsFromName(name) + suite.addTest(test) + + +# lets set it back before running so our Alembic files get dumped into +# our original working directory, instead of the source of our tests +os.chdir( cwd ) + +# Run the tests +runner = unittest.TextTestRunner(verbosity=2) +result = runner.run(suite) + +if not result.wasSuccessful(): + exit(1) diff --git a/third_party/Imath/src/python/PyImathPythonTest/test_v3.py b/third_party/Imath/src/python/PyImathPythonTest/test_v3.py new file mode 100644 index 00000000..817150f8 --- /dev/null +++ b/third_party/Imath/src/python/PyImathPythonTest/test_v3.py @@ -0,0 +1,150 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright Contributors to the OpenEXR Project. + +import unittest +from imath import V3f + +class V3fTestCase(unittest.TestCase): + def test_baseTypeEpsilon(self): + result = V3f.baseTypeEpsilon() + self.assertEqual(result, 1.1920928955078125e-07) + + def test_baseTypeLowest(self): + result = V3f.baseTypeLowest() + self.assertEqual(result, -3.4028234663852886e+38) + + def test_baseTypeMax(self): + result = V3f.baseTypeMax() + self.assertEqual(result, 3.4028234663852886e+38) + + def test_baseTypeSmallest(self): + result = V3f.baseTypeSmallest() + self.assertEqual(result, 1.1754943508222875e-38) + + def test_closestVertex(self): + vector = V3f(1, 2, 3) + p1, p2, p3 = V3f(1, 0, 0), V3f(0, 1, 0), V3f(0, 0, 1) + result = V3f.closestVertex(vector, p1, p2, p3) + expected_result = V3f(0, 0, 1) + self.assertEqual(result, expected_result) + + def test_cross(self): + vector1 = V3f(1, 2, 3) + vector2 = V3f(4, 5, 6) + result = V3f.cross(vector1, vector2) + expected_result = V3f(-3, 6, -3) + self.assertEqual(result, expected_result) + + def test_dimensions(self): + result = V3f.dimensions() + self.assertEqual(result, 3) + + def test_dot(self): + vector1 = V3f(1, 2, 3) + vector2 = V3f(4, 5, 6) + result = V3f.dot(vector1, vector2) + expected_result = 32 + self.assertEqual(result, expected_result) + + def test_equalWithAbsError(self): + vector1 = V3f(1, 2, 3) + vector2 = V3f(1.01, 2.02, 3.01) + result = V3f.equalWithAbsError(vector1, vector2, 0.05) + self.assertTrue(result) + + def test_equalWithRelError(self): + vector1 = V3f(1, 2, 3) + vector2 = V3f(1.01, 2.02, 3.01) + result = V3f.equalWithRelError(vector1, vector2, 0.02) + self.assertTrue(result) + + def test_length(self): + vector = V3f(2, 4, 4) + result = vector.length() + expected_result = 6 + self.assertAlmostEqual(result, expected_result) + + def test_length2(self): + vector = V3f(1, 2, 3) + result = vector.length2() + expected_result = 14 + self.assertEqual(result, expected_result) + + def test_negate(self): + vector = V3f(1, 2, 3) + vector.negate() + expected_result = V3f(-1, -2, -3) + self.assertEqual(vector, expected_result) + + def test_normalize(self): + vector = V3f(1, 2, 3) + normal_result = vector.normalize() + expected_result = V3f(0.267261, 0.534522, 0.801783) + result = V3f.equalWithAbsError(normal_result, expected_result, 0.01) + self.assertTrue(result) + + def test_normalizeExc(self): + vector = V3f(1, 2, 3) + normal_result = vector.normalizeExc() + expected_result = V3f(0.267261, 0.534522, 0.801783) + result = V3f.equalWithAbsError(normal_result, expected_result, 0.01) + self.assertTrue(result) + + def test_normalizeNonNull(self): + vector = V3f(1, 2, 3) + normal_result = vector.normalizeNonNull() + expected_result = V3f(0.267261, 0.534522, 0.801783) + result = V3f.equalWithAbsError(normal_result, expected_result, 0.01) + self.assertTrue(result) + + def test_normalized(self): + vector = V3f(1, 2, 3) + normal_result = vector.normalized() + expected_result = V3f(0.267261, 0.534522, 0.801783) + result = V3f.equalWithAbsError(normal_result, expected_result, 0.01) + self.assertTrue(result) + + def test_normalizedExc(self): + vector = V3f(1, 2, 3) + normal_result = vector.normalizedExc() + expected_result = V3f(0.267261, 0.534522, 0.801783) + result = V3f.equalWithAbsError(normal_result, expected_result, 0.01) + self.assertTrue(result) + + def test_normalizedNonNull(self): + vector = V3f(1, 2, 3) + normal_result = vector.normalizedNonNull() + expected_result = V3f(0.267261, 0.534522, 0.801783) + result = V3f.equalWithAbsError(normal_result, expected_result, 0.01) + self.assertTrue(result) + + def test_orthogonal(self): + vector1 = V3f(2, 2, 0) + vector2 = V3f(0, 1, 0) + orthogonal_vec = V3f.orthogonal(vector1, vector2) + expected_result = V3f(-0.5, 0.5, 0) + result = V3f.equalWithAbsError(orthogonal_vec, expected_result, 0.01) + self.assertTrue(result) + + def test_project(self): + vector = V3f(1, 2, 3) + direction = V3f(1, 0, 0) + result = V3f.project(vector, direction) + expected_result = V3f(1, 0, 0) + self.assertEqual(result, expected_result) + + def test_reflect(self): + vector = V3f(4, 5, 6) + normal = V3f(1, 0, 0) + result = V3f.reflect(vector, normal) + expected_result = V3f(4, -5, -6) + self.assertEqual(result, expected_result) + + def test_xyz(self): + vector = V3f(1, 2, 3) + self.assertEqual(vector.x, 1) + self.assertEqual(vector.y, 2) + self.assertEqual(vector.z, 3) + +if __name__ == '__main__': + unittest.main() diff --git a/third_party/Imath/src/python/PyImathPythonTest/todo_m44.py b/third_party/Imath/src/python/PyImathPythonTest/todo_m44.py new file mode 100644 index 00000000..d2adb323 --- /dev/null +++ b/third_party/Imath/src/python/PyImathPythonTest/todo_m44.py @@ -0,0 +1,320 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright Contributors to the OpenEXR Project. + +# Move this back to test_m44.py once this has been evaluated +# for pybind11 AND boost python bindings + +import unittest +from imath import V3f, M44f, Eulerf + +class M44fTestCase(unittest.TestCase): + def test_baseTypeEpsilon(self): + result = M44f.baseTypeEpsilon() + self.assertEqual(result, 1.1920928955078125e-07) + + def test_baseTypeLowest(self): + result = M44f.baseTypeLowest() + self.assertEqual(result, -3.4028234663852886e+38) + + def test_baseTypeMax(self): + result = M44f.baseTypeMax() + self.assertEqual(result, 3.4028234663852886e+38) + + def test_baseTypeSmallest(self): + result = M44f.baseTypeSmallest() + self.assertEqual(result, 1.1754943508222875e-38) + + def test_determinant(self): + matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + result = matrix.determinant() + expected_result = 0.0 + self.assertEqual(result, expected_result) + + def test_equalWithAbsError(self): + matrix1 = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + matrix2 = M44f(1.01, 2.02, 3.01, 4.02, 5.01, 6.02, 7.01, 8.02, 9.01, 10.02, 11.01, 12.02, 13.01, 14.02, 15.01, 16.02) + result = M44f.equalWithAbsError(matrix1, matrix2, 0.05) + self.assertTrue(result) + + def test_equalWithRelError(self): + matrix1 = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + matrix2 = M44f(1.01, 2.02, 3.01, 4.02, 5.01, 6.02, 7.01, 8.02, 9.01, 10.02, 11.01, 12.02, 13.01, 14.02, 15.01, 16.02) + result = M44f.equalWithRelError(matrix1, matrix2, 0.02) + self.assertTrue(result) + + def test_extractAndRemoveScalingAndShear(self): + """ + check scale, shear and if the they were removed from the matrix + """ + matrix = M44f() + scaling, shear = V3f(), V3f() + matrix.scale(V3f(1, 2, 3)) + M44f.extractAndRemoveScalingAndShear(matrix, scaling, shear) + expected_scaling = V3f(1, 2, 3) + self.assertEqual(scaling, expected_scaling) + matrix = M44f() + scaling, shear = V3f(), V3f() + matrix.shear(V3f(1, 2, 3)) + M44f.extractAndRemoveScalingAndShear(matrix, scaling, shear) + expected_shear = V3f(1, 2, 3) + self.assertEqual(shear, expected_shear) + self.assertEqual(matrix, M44f()) + + def test_extractEulerXYZ(self): + """ + TODO: doesn't work + """ + matrix = M44f().rotate(Eulerf(45, 30, 15)) + # result = M44f.extractEulerXYZ(matrix) # ? + result = Eulerf() + M44f.extractEulerXYZ(matrix, result) + expected_result = Eulerf(45, 30, 15) + # self.assertEqual(result, expected_result) + + # def test_extractEulerZYX(self): + # matrix = M44f().rotate(Eulerf(45, 30, 15)) + # result = M44f.extractEulerZYX(matrix) + # expected_result = Eulerf(15, 30, 45) + # self.assertEqual(result, expected_result) + + def test_extractSHRT(self): + """ + TODO: do 4 tests? + """ + matrix = M44f().setTranslation(V3f(1, 2, 3)).rotate(Eulerf(45, 30, 15)).setScale(V3f(2, 3, 4)).setShear(V3f(0.1, 0.2, 0.3)) + s, h, r, t = V3f(), V3f(), V3f(), V3f() + M44f.extractSHRT(matrix, s, h, r, t) + expected_scale = V3f(2, 3, 4) + expected_shear = V3f(0.1, 0.2, 0.3) + expected_rotation = Eulerf(45, 30, 15) + expected_translation = V3f(1, 2, 3) + # self.assertEqual(s, expected_scale) + # self.assertEqual(h, expected_shear) + # self.assertEqual(r, expected_rotation) + # self.assertEqual(t, expected_translation) + + def test_extractScaling(self): + matrix = M44f().setScale(V3f(2, 3, 4)) + result = V3f() + M44f.extractScaling(matrix, result) + expected_result = V3f(2, 3, 4) + self.assertEqual(result, expected_result) + + def test_extractScalingAndShear(self): + """ + same as test_extractAndRemoveScalingAndShear + except the matrix doesn't change + """ + matrix = M44f() + scaling, shear = V3f(), V3f() + matrix.scale(V3f(1, 2, 3)) + M44f.extractScalingAndShear(matrix, scaling, shear) + expected_scaling = V3f(1, 2, 3) + self.assertEqual(scaling, expected_scaling) + matrix = M44f() + scaling, shear = V3f(), V3f() + matrix.shear(V3f(1, 2, 3)) + M44f.extractScalingAndShear(matrix, scaling, shear) + expected_shear = V3f(1, 2, 3) + self.assertEqual(shear, expected_shear) + + # def test_fastMinor(self): + # matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + # result = M44f.fastMinor(matrix, 1, 2, 3, 1) + # expected_result = 0.0 + # self.assertEqual(result, expected_result) + + # def test_gjInverse(self): + # matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + # result = M44f.gjInverse(matrix) + # expected_result = M44f(-2.0, 1.0, 0.0, 0.0, 1.5, -1.0, 0.5, 0.0, -1.0, 1.0, 0.0, 0.0, 0.5, -0.5, 0.0, 0.0) + # self.assertEqual(result, expected_result) + + # def test_gjInvert(self): + # matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + # result = matrix.gjInvert() + # expected_result = M44f(-2.0, 1.0, 0.0, 0.0, 1.5, -1.0, 0.5, 0.0, -1.0, 1.0, 0.0, 0.0, 0.5, -0.5, 0.0, 0.0) + # self.assertEqual(result, expected_result) + + # def test_inverse(self): + # matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + # result = matrix.inverse() + # expected_result = M44f(-2.0, 1.0, 0.0, 0.0, 1.5, -1.0, 0.5, 0.0, -1.0, 1.0, 0.0, 0.0, 0.5, -0.5, 0.0, 0.0) + # self.assertEqual(result, expected_result) + + # def test_invert(self): + # matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + # result = matrix.invert() + # expected_result = M44f(-2.0, 1.0, 0.0, 0.0, 1.5, -1.0, 0.5, 0.0, -1.0, 1.0, 0.0, 0.0, 0.5, -0.5, 0.0, 0.0) + # self.assertEqual(result, expected_result) + + # def test_makeIdentity(self): + # result = M44f.makeIdentity() + # expected_result = M44f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) + # self.assertEqual(result, expected_result) + + # def test_minorOf(self): + # matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + # result = M44f.minorOf(matrix, 1, 2, 3, 1) + + # expected_result = 0.0 + # self.assertEqual(result, expected_result) + + def test_multDirMatrix(self): + direction = V3f(1, 0, 0) + matrix = M44f().rotate(Eulerf(45, 0, 0)) + result = matrix.multDirMatrix(direction) + expected_result = V3f(1, 0, 0) + self.assertEqual(result, expected_result) + + def test_multVecMatrix(self): + vector = V3f(1, 2, 3) + matrix = M44f().setScale(V3f(2, 3, 4)) + result = matrix.multVecMatrix(vector) + expected_result = V3f(2, 6, 12) + self.assertEqual(result, expected_result) + + def test_negate(self): + matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + result = M44f.negate(matrix) + expected_result = M44f(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16) + self.assertEqual(result, expected_result) + + def test_removeScaling(self): + matrix = M44f().setScale(V3f(2, 3, 4)) + matrix.removeScaling() + self.assertEqual(matrix, M44f()) + + # def test_removeScalingAndShear(self): + # matrix = M44f().setScale(V3f(2, 3, 4)).setShear(V3f(0.1, 0.2, 0.3)).setTranslation(V3f(1, 2, 3)) + # result = M44f.removeScalingAndShear(matrix) + + # expected_result = M44f().setTranslation(V3f(1, 2, 3)) + # self.assertEqual(result, expected_result) + + # def test_rotate(self): + # matrix = M44f().rotate(Eulerf(45, 0, 0)) + # vector = V3f(1, 0, 0) + # result = matrix.rotate(vector) + # expected_result = V3f(1, 0, 0) + # self.assertEqual(result, expected_result) + + # def test_rotationMatrix(self): + # angles = Eulerf(45, 30, 15) + # result = M44f.rotationMatrix(angles) + # expected_result = M44f().rotate(angles) + # self.assertEqual(result, expected_result) + + # def test_rotationMatrixWithUpDir(self): + # angles = Eulerf(45, 30, 15) + # up_direction = V3f(0, 1, 0) + # result = M44f.rotationMatrixWithUpDir(angles, up_direction) + # expected_result = M44f().rotate(angles) + # self.assertEqual(result, expected_result) + + def test_sansScaling(self): + matrix = M44f().setScale(V3f(2, 3, 4)).setTranslation(V3f(1, 2, 3)) + result = M44f.sansScaling(matrix) + expected_result = M44f().setTranslation(V3f(1, 2, 3)) + self.assertEqual(result, expected_result) + + # def test_sansScalingAndShear(self): + # matrix = M44f().setScale(V3f(2, 3, 4)).setShear(V3f(0.1, 0.2, 0.3)).setTranslation(V3f(1, 2, 3)) + # result = M44f.sansScalingAndShear(matrix) + # expected_result = M44f().setTranslation(V3f(1, 2, 3)) + # self.assertEqual(result, expected_result) + + # def test_scale(self): + # matrix = M44f().setScale(V3f(2, 3, 4)) + # vector = V3f(1, 1, 1) + # result = matrix.scale(vector) + # expected_result = V3f(2, 3, 4) + # self.assertEqual(result, expected_result) + + # def test_setScale(self): + # scale_vector = V3f(2, 3, 4) + # result = M44f().setScale(scale_vector) + # expected_result = M44f(2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 1) + # self.assertEqual(result, expected_result) + + # def test_setShear(self): + # shear_vector = V3f(1, 2, 3) + # result = M44f().setShear(shear_vector) + # expected_result = M44f(1, 0, 0, 0, 2, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 1) + # self.assertEqual(result, expected_result) + + # def test_setTranslation(self): + # translation_vector = V3f(1, 2, 3) + # result = M44f().setTranslation(translation_vector) + # expected_result = M44f(1, 0, 0, 1, 0, 1, 0, 2, 0, 0, 1, 3, 0, 0, 0, 1) + # self.assertEqual(result, expected_result) + + def test_setValue(self): + values = M44f( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16 + ) + result = M44f() + result.setValue(values) + expected_result = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + self.assertEqual(result, expected_result) + + # def test_shear(self): + # shear_vector = V3f(1, 2, 3) + # result = M44f() + # result.setShear(shear_vector) + # expected_result = M44f(1, 0, 0, 0, 2, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 1) + # self.assertEqual(result, expected_result) + + def test_singularValueDecomposition(self): + """ + TODO this + """ + matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + u, sigma, v_t = M44f.singularValueDecomposition(matrix, True) + # SVD implementation uses two-sided Jacobi rotations to iteratively diagonalize the matrix + # M44f, V4f, M44f + # expected_u = M44f() + # expected_sigma = M44f() + # expected_v_t = M44f() + # self.assertEqual(u, expected_u) + # self.assertEqual(sigma, expected_sigma) + # self.assertEqual(v_t, expected_v_t) + + # def test_symmetricEigensolve(self): + # matrix = M44f(1, 2, 3, 4, 2, 5, 6, 7, 3, 6, 8, 9, 4, 7, 9, 10) + # eigenvectors, eigenvalues = M44f.symmetricEigensolve(matrix) + # expected_eigenvectors = [V3f(), V3f(), V3f(), V3f()] + # expected_eigenvalues = V3f() + # self.assertEqual(eigenvectors, expected_eigenvectors) + # self.assertEqual(eigenvalues, expected_eigenvalues) + + def test_translate(self): + matrix = M44f().setTranslation(V3f(1, 2, 3)) + vector = V3f(2, 3, 4) + result = matrix.translate(vector) + expected_result = V3f(3, 5, 7) + self.assertEqual(result.translation(), expected_result) + + def test_translation(self): + matrix = M44f().setTranslation(V3f(1, 2, 3)) + result = matrix.translation() + expected_result = V3f(1, 2, 3) + self.assertEqual(result, expected_result) + + def test_transpose(self): + matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + result = M44f.transpose(matrix) + expected_result = M44f(1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15, 4, 8, 12, 16) + self.assertEqual(result, expected_result) + + def test_transposed(self): + matrix = M44f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + result = matrix.transposed() + expected_result = M44f(1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15, 4, 8, 12, 16) + self.assertEqual(result, expected_result) + +if __name__ == '__main__': + unittest.main() diff --git a/third_party/Imath-3.1.9/src/python/PyImathSpeedTest/CMakeLists.txt b/third_party/Imath/src/python/PyImathSpeedTest/CMakeLists.txt similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImathSpeedTest/CMakeLists.txt rename to third_party/Imath/src/python/PyImathSpeedTest/CMakeLists.txt diff --git a/third_party/Imath-3.1.9/src/python/PyImathSpeedTest/pyImathSpeedTest.in b/third_party/Imath/src/python/PyImathSpeedTest/pyImathSpeedTest.in similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImathSpeedTest/pyImathSpeedTest.in rename to third_party/Imath/src/python/PyImathSpeedTest/pyImathSpeedTest.in diff --git a/third_party/Imath-3.1.9/src/python/PyImathTest/CMakeLists.txt b/third_party/Imath/src/python/PyImathTest/CMakeLists.txt similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImathTest/CMakeLists.txt rename to third_party/Imath/src/python/PyImathTest/CMakeLists.txt diff --git a/third_party/Imath-3.1.9/src/python/PyImathTest/main.cpp b/third_party/Imath/src/python/PyImathTest/main.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImathTest/main.cpp rename to third_party/Imath/src/python/PyImathTest/main.cpp diff --git a/third_party/Imath-3.1.9/src/python/PyImathTest/pyImathTest.in b/third_party/Imath/src/python/PyImathTest/pyImathTest.in similarity index 94% rename from third_party/Imath-3.1.9/src/python/PyImathTest/pyImathTest.in rename to third_party/Imath/src/python/PyImathTest/pyImathTest.in index dc9be34d..d97628f6 100644 --- a/third_party/Imath-3.1.9/src/python/PyImathTest/pyImathTest.in +++ b/third_party/Imath/src/python/PyImathTest/pyImathTest.in @@ -4379,6 +4379,13 @@ def testShear6x (Shear): assert h[0] == 0 and h[1] == 1 and h[2] == 2 and \ h[3] == 3 and h[4] == 4 and h[5] == 5 + try: + h = Shear((0, 1, 2, 3, 4, 5, 6)) + except: + pass + else: + assert False + h = Shear() h.setValue(0, 1, 2, 3, 4, 5) assert h[0] == 0 and h[1] == 1 and h[2] == 2 and \ @@ -4389,6 +4396,10 @@ def testShear6x (Shear): h = Shear(1/9., 2/9., 3/9., 4/9., 5/9., 6/9.) assert h == eval(repr(h)) + s = eval(str(h)) + for i in range(6): + assert equalWithAbsError(h[i], s[i], 1e-5) + # Sequence length. h = Shear() @@ -4483,10 +4494,24 @@ def testShear6x (Shear): assert h1 + 1 == Shear(11, 21, 31, -9, -19, -29) assert 1 + h1 == h1 + 1 + h3 = Shear(h1) + h3 += h2 + assert h3 == Shear(40, 60, 80, -40, -60, -80) + + h3 -= h2 + assert h3 == h1 + # (with the switch to python2, we now allow ops between vectors and tuples) assert h1 + (1, 2, 3, 4, 5, 6) == Shear(11, 22, 33, -6, -15, -24) assert (1, 2, 3, 4, 5, 6) + h1 == h1 + (1, 2, 3, 4, 5, 6) + try: + h1 + (1, 2, 3, 4, 5, 6, 7) + except: + pass + else: + assert False + # Subtraction and negation. h1 = Shear(10, 20, 30, -10, -20, -30) @@ -4500,6 +4525,13 @@ def testShear6x (Shear): assert h1 - (1, 2, 3, 4, 5, 6) == Shear(9, 18, 27, -14, -25, -36) assert (1, 2, 3, 4, 5, 6) - h1 == - (h1 - (1, 2, 3, 4, 5, 6)) + try: + h1 - (1, 2, 3, 4, 5, 6, 7) + except: + pass + else: + assert False + assert h1.negate() == Shear(-10, -20, -30, 10, 20, 30) # Multiplication. @@ -4512,9 +4544,30 @@ def testShear6x (Shear): assert 2 * h1 == Shear(2, 4, 6, -2, -4, -6) assert h1 * 2 == 2 * h1 + h3 = Shear(h1) + h3 *= h2 + assert h3 == Shear(3, 8, 15, 3, 8, 15) + + h3 /= h2 + assert h3 == h1 + + h3 = Shear(h1) + h3 *= 2 + assert h3 == h1 * 2 + + h3 /= 2 + assert h3 == h1 + # (with the switch to python2, we now allow ops between vectors and tuples) assert h1 * (1, 2, 3, 4, 5, 6) == Shear(1, 4, 9, -4, -10, -18) - assert (1, 2, 3, 4, 5, 6) * h1 == h1 * (1, 2, 3, 4, 5, 6) + assert (1, 2, 3, 4, 5, 6) * h1 == Shear(1, 4, 9, -4, -10, -18) + + try: + h1 * (1, 2, 3, 4, 5, 6, 7) + except: + pass + else: + assert False # Division. @@ -4527,7 +4580,45 @@ def testShear6x (Shear): # (with the switch to python2, we now allow ops between vectors and tuples) assert h1 / (1, 2, 4, -1, -2, -4) == Shear(10, 10, 10, 10, 10, 10) - assert Shear(50, 40, 80, -50, -40, -80) / h1 == Shear(5, 2, 2, 5, 2, 2) + assert (50, 40, 80, -50, -40, -80) / h1 == Shear(5, 2, 2, 5, 2, 2) + + assert 1.0 / Shear(1,2,3,4,5,6) == Shear(1.0/1, 1.0/2, 1.0/3, 1.0/4, 1.0/5, 1.0/6) + + try: + h = 2.0 / Shear(0, 1, 2, 3, 4, 5, 6) + except: + pass + else: + assert False + + + try: + h = h1 / (1, 2, 3, 4, 5, 6, 7) + except: + pass + else: + assert False + + try: + h = (1, 2, 3, 4, 5, 6, 7) / h1 + except: + pass + else: + assert False + + try: + h = h1 / (0, 0, 0, 0, 0, 0) + except: + pass + else: + assert False + + try: + h = (1,2,3,4,5,6) / Shear(0,1,2,3,4,5) + except: + pass + else: + assert False print ("ok") @@ -6107,6 +6198,19 @@ def testM44x (Mat, Vec): m.extractEulerXYZ(v) assert v.equalWithAbsError((0, 0, -a), v.baseTypeEpsilon()) + e = Vec(0,0,-a) + m.setEulerAngles(e) + assert (equal(m[0][0], cos(a), 0.0001)) + assert (equal(m[0][1], -sin(a), 0.0001)) + assert (equal(m[1][0], sin(a), 0.0001)) + assert (equal(m[1][1], cos(a), 0.0001)) + + axis = Vec(0,0,1) + m.setAxisAngle(axis,-a) + assert (equal(m[0][0], cos(a), 0.0001)) + assert (equal(m[0][1], -sin(a), 0.0001)) + assert (equal(m[1][0], sin(a), 0.0001)) + assert (equal(m[1][1], cos(a), 0.0001)) # Extract scale, shear, rotation, translation. @@ -6137,7 +6241,7 @@ def testM44x (Mat, Vec): b = m.extractSHRT(sInq, hInq, rInq, tInq) - assert sInq.equalWithAbsError(s, sInq.baseTypeEpsilon()) + assert sInq.equalWithAbsError(s, 2 * sInq.baseTypeEpsilon()) assert hInq.equalWithAbsError(h, hInq.baseTypeEpsilon()) assert rInq.equalWithAbsError((0, 0, -a), 2 * rInq.baseTypeEpsilon()) assert tInq.equalWithAbsError(t, tInq.baseTypeEpsilon()) @@ -6865,7 +6969,7 @@ testList.append (('testBoxConversions',testBoxConversions)) # ------------------------------------------------------------------------- # Tests for Quatx -def testQuatx (Quat, Vec, M33, M44): +def testQuatx (Quat, Vec, M33, M44, Euler, VecArray): # constructors, r(), v() e = 4 * Vec.baseTypeEpsilon() @@ -6882,12 +6986,55 @@ def testQuatx (Quat, Vec, M33, M44): q1 = Quat (q) assert q1.r() == 6 and q1.v() == Vec (7, 8, 9) + q1 = q.identity() + assert q1.r() == 1 and q1.v() == Vec (0, 0, 0) + + u = Euler (Vec (1, 2, 3), EULER_XYZ) + q = Quat(u) + assert equalWithAbsError(q.r(), 0.4359528422355652, 1e-5) and q.v().equalWithAbsError(Vec(-0.718287, 0.310622, 0.444435), 1e-5) + + m = M33() + q = Quat(m) + assert equalWithAbsError(q.r(), 1.0, 1e-5) and q.v().equalWithAbsError(Vec(0, 0, 0), 1e-5) + + m = M44() + q = Quat(m) + assert equalWithAbsError(q.r(), 1.0, 1e-5) and q.v().equalWithAbsError(Vec(0, 0, 0), 1e-5) + + # setR(), setV() q.setR (1) q.setV (Vec (2, 3, 4)) assert q.r() == 1 and q.v() == Vec (2, 3, 4) + # operator *= + q1 = Quat(q) + q1 *= 2.0 + assert q1.r() == q.r() * 2.0 and q1.v() == q.v() * 2.0 + + q1 *= q + assert equalWithAbsError(q1.r(),-56,1e-5) and q1.v().equalWithAbsError (Vec (8,12,16), 1e-5) + + # operator /= + q1 = Quat(q) + q1 /= 2 + assert q1.r() == q.r() / 2 and q1.v() == q.v() / 2 + + # operator /= + q1 = Quat(q) + q1 /= q + assert q1.r() == 1 and q1.v().equalWithAbsError (Vec (0, 0, 0), 1e-5) + + # operator += + q1 = Quat(q) + q1 += q + assert q1.r() == q.r() * 2 and q1.v() == q.v() * 2 + + # operator -= + q1 -= q + assert q1.r() == q.r() and q1.v() == q.v() + # invert(), inverse() q = Quat (1, 0, 0, 1) @@ -6907,6 +7054,10 @@ def testQuatx (Quat, Vec, M33, M44): q.normalize() assert q == Quat (0, 0, 1, 0) + q = Quat(0, 0, 0, 0) + q.normalize() + assert q.r() == 1 and q.v() == Vec (0, 0, 0) + # length() q = Quat (3, 0, 4, 0) @@ -6928,6 +7079,31 @@ def testQuatx (Quat, Vec, M33, M44): assert v.equalWithAbsError (Vec (0, 0, 1), e) assert equal(a, pi/2, e) + q.setRotation (Vec (0, 1, 0), Vec (1, 0, 0)) + v = q.axis() + a = q.angle() + assert v.equalWithAbsError (Vec (0, 0, -1), e) + assert equal(a, pi/2, e) + + q.setRotation (Vec (0, 1, 0), Vec (0, -1, 1)) + v = q.axis() + a = q.angle() + assert v.equalWithAbsError (Vec (1, 0, 0), e) + assert equal(a, 3*pi/4.0, e) + + q.setRotation (Vec (0, 1, 0), Vec (0, -1, 0)) + v = q.axis() + a = q.angle() + assert v.equalWithAbsError (Vec (0, 0, -1), e) + assert equal(a, pi, e) + + # rotateVector + + v = Vec(0, 0, 1) + q.setAxisAngle (Vec (0, 1, 0), pi/2) + vp = q.rotateVector(v) + assert vp.equalWithAbsError (Vec (1, 0, 0), e) + # slerp() q = Quat() @@ -6946,6 +7122,15 @@ def testQuatx (Quat, Vec, M33, M44): assert r.v().equalWithAbsError (Vec (sqrt(2) / 2, 0, 0), e) + # slerpShortestArg() + + q = Quat(0, 0, 1, 0) + p = Quat(0, 0, -1, 1) + + r = p.slerpShortestArc (q, 0.5) + assert equal (r.r(), 0, e) + assert r.v().equalWithAbsError (Vec (0, -0.894427, 0.447214), 1e-5) + # toMatrix33(), toMatrix44() q.setRotation (Vec (1, 0, 0), Vec (0, 1, 0)) @@ -6983,22 +7168,62 @@ def testQuatx (Quat, Vec, M33, M44): assert Quat (1, 2, 3, 4) ^ Quat (2, 2, 2, 2) == 20 + m = M33() + m1 = q * m + assert m1.equalWithAbsError(M33((0, 1, 0), (-1, 0, 0), (0, 0, 1)), 1e-5) + m1 = m * q + assert m1.equalWithAbsError(M33((0, 1, 0), (-1, 0, 0), (0, 0, 1)), 1e-5) + + v = Vec(1,0,0) * q1 + assert v.equalWithAbsError(V3f(-49, 20, 10), 1e-5) + + a = VecArray(3) + a[0] = Vec(11,17,3).normalized() + a[1] = Vec(7,19,31).normalized() + a[2] = Vec(23,5,13).normalized() + a1 = a * q + assert a[0].equalWithAbsError(Vec(0.537385, 0.830504, 0.14656), 1e-5) + assert a[1].equalWithAbsError(Vec(0.189051, 0.513139, 0.837227), 1e-5) + assert a[2].equalWithAbsError(Vec(0.855379, 0.185952, 0.483475), 1e-5) + # repr q = Quat (1/9., 2/9., 3/9., 4/9.) assert q == eval (repr (q)) + q1 = eval (str (q)) + assert equalWithAbsError(q1.r(), q.r(), 1e-5) and q1.v().equalWithAbsError (q.v(), 1e-5) # extract() m1 = M44 () vFrom = Vec (1, 0, 0) vTo = Vec (0, 1, 1) + m1.rotationMatrix(vFrom, vTo) q = Quat () q.extract(m1) m2 = q.toMatrix44() assert m2.equalWithAbsError(m1, 2*m1.baseTypeEpsilon()) + # log/exp + q = Quat(1, 0, 0, 0) + l = q.log() + assert l == Quat(0,0,0,0) + x = q.exp() + assert x == Quat(1,0,0,0) + + q.setAxisAngle (Vec (0, 0, 1), pi/2) + l = q.log() + assert l.r() == 0 and l.v().equalWithAbsError (Vec (0, 0, 0.785398), 1e-5) + x = q.exp() + assert equalWithAbsError (x.r(), 0.760245, 1e-5) and x.v().equalWithAbsError (Vec (0, 0, 0.649637), 1e-5) + + q = Quat(0, 0, 0, 0) + l = q.log() + assert l == Quat(0,0,0,0) + x = q.exp() + assert x == Quat(1,0,0,0) + print ("ok") return @@ -7020,9 +7245,9 @@ def testQuatConversions (): def testQuat(): print ("Quatf") - testQuatx (Quatf, V3f, M33f, M44f) + testQuatx (Quatf, V3f, M33f, M44f, Eulerf, V3fArray) print ("Quatd") - testQuatx (Quatd, V3d, M33d, M44d) + testQuatx (Quatd, V3d, M33d, M44d, Eulerd, V3dArray) print ("conversions") testQuatConversions() @@ -7033,7 +7258,7 @@ testList.append (('testQuat',testQuat)) # ------------------------------------------------------------------------- # Tests for Eulerx -def testEulerx (Euler, Vec, M33, M44): +def testEulerx (Euler, Vec, M33, M44, Quat): # constructors, toXYZVector(), order() @@ -7049,12 +7274,18 @@ def testEulerx (Euler, Vec, M33, M44): e1 = Euler (e) assert e1.toXYZVector() == Vec (3, 2, 1) and e1.order() == EULER_ZYX + e1 = Euler (e, EULER_XYZ) + assert e1.toXYZVector().equalWithAbsError(Vec(-1.02689, -0.649926, -1.85712), 1e-5) and e1.order() == EULER_XYZ + e = Euler (4, 5, 6) assert e.toXYZVector() == Vec (4, 5, 6) and e.order() == EULER_XYZ e = Euler (4, 5, 6, EULER_ZXY) assert e.toXYZVector() == Vec (5, 6, 4) and e.order() == EULER_ZXY + e = Euler (4, 5, 6, EULER_ZXY, EULER_XYZLayout) + assert e.toXYZVector() == Vec (4, 5, 6) and e.order() == EULER_ZXY + e = Euler (M33()) assert e.toXYZVector() == Vec (0, 0, 0) and e.order() == EULER_XYZ @@ -7067,15 +7298,70 @@ def testEulerx (Euler, Vec, M33, M44): e = Euler (M44(), EULER_ZYX) assert e.toXYZVector() == Vec (0, 0, 0) and e.order() == EULER_ZYX + e = Eulerf (V3f (1, 2, 3), EULER_XYZ) + e1 = Eulerf (e, EULER_YZX) + + assert e1.toXYZVector().equalWithAbsError(Vec (-2.45463, -0.72857, 0.985843), 1e-5) and e1.order() == EULER_YZX + + e = Euler (Vec (1, 2, 3), EULER_ZYX, EULER_XYZLayout) + assert e.toXYZVector() == Vec (1, 2, 3) and e.order() == EULER_ZYX + + e1 = Euler (e, EULER_XYZ, EULER_XYZLayout) + assert e1.toXYZVector() == Vec (3, 2, 1) and e1.order() == EULER_XYZ + + e = Eulerf (Quatf(), EULER_XYZ) + assert e.toXYZVector().equalWithAbsError(Vec(0,0,0),1e-5) and e.order() == EULER_XYZ + + orders = [ + EULER_XYZ, + EULER_XZY, + EULER_YZX, + EULER_YXZ, + EULER_ZXY, + EULER_ZYX, + EULER_XZX, + EULER_XYX, + EULER_YXY, + EULER_YZY, + EULER_ZYZ, + EULER_ZXZ, + EULER_XYZr, + EULER_XZYr, + EULER_YZXr, + EULER_YXZr, + EULER_ZXYr, + EULER_ZYXr, + EULER_XZXr, + EULER_XYXr, + EULER_YXYr, + EULER_YZYr, + EULER_ZYZr, + EULER_ZXZr + ] + + # repr/str for all orders + for o in orders: + e = Euler (1, 2, 3, o) + assert e.order() == o + + assert e == eval(repr(e)) + e1 = eval (str (e)) + assert (e1.order() == e.order() and + equalWithAbsError(e1.x, e.x, 1e-5) and + equalWithAbsError(e1.y, e.y, 1e-5) and + equalWithAbsError(e1.z, e.z, 1e-5)) + # comparison e = Euler (1, 2, 3, EULER_XYZ) e1 = e assert e1 == e + assert not (e1 != e) e1 = Euler (1, 2, 3, EULER_XZY) assert e1 != e + assert not (e1 == e) e1 = Euler (1, 1, 3, EULER_XYZ) assert e1 != e @@ -7087,6 +7373,21 @@ def testEulerx (Euler, Vec, M33, M44): e.setOrder (EULER_ZYX) assert e.order() == EULER_ZYX and e.toXYZVector() == Vec (9, 8, 7) + e = Euler() + e.setXYZVector ((7, 8, 9)) + e.setOrder (EULER_ZYX) + assert e.order() == EULER_ZYX and e.toXYZVector() == Vec (9, 8, 7) + + e = Euler() + try: + e.setXYZVector ((7, 8, 9, 10)) + except: + pass + else: + assert 0 + + e = Euler() + e.setXYZVector (Vec (7, 8, 9)) e.setOrder (EULER_XYZ) assert e.order() == EULER_XYZ and e.toXYZVector() == Vec (7, 8, 9) @@ -7136,6 +7437,16 @@ def testEulerx (Euler, Vec, M33, M44): assert v.equalWithAbsError (Vec (0, 0, pi/2), v.baseTypeEpsilon()) + q = Quat (1, 0, 0, 1) + eq = Euler() + eq.extract(q) + assert eq.toXYZVector().equalWithAbsError(Vec(0, -0, 2.03444), 1e-5) and eq.order() == EULER_XYZ + + eq = Euler(EULER_XZX) + m33 = M33() + eq.extract(m33) + assert eq.toXYZVector().equalWithAbsError(Vec(0, 0, 0), 1e-5) and eq.order() == EULER_XZX + # toMatrix33(), toMatrix44() m = e.toMatrix33(); @@ -7208,16 +7519,55 @@ def testEulerConversions (): print ("ok") return +def testEulerArrays(Euler, EulerArray, QuatArray, Vec, VecArray): + + # construct from Quat array + + Q = QuatArray(3) + Q[0].setAxisAngle (Vec ( 1., 0., 0.), math.pi) + Q[1].setAxisAngle (Vec ( 1., 1., 0.), math.pi) + Q[2].setAxisAngle (Vec ( 0., 1., 0.), math.pi) + + E = EulerArray(Q) + for i in range(3): + e = Euler() + e.extract(Q[i]) + assert E[i] == e + + # construct from Vec array + + V = VecArray(3) + V[0] = Vec(1,0,0) + V[1] = Vec(0,1,0) + V[2] = Vec(0,0,1) + + E = EulerArray(V) + for i in range(3): + assert E[i] == Euler(V[i]) + + E = EulerArray(V, EULER_ZYX) + for i in range(3): + assert E[i] == Euler(V[i], EULER_ZYX) + + # toXYZVector + + X = E.toXYZVector() + assert X[0] == V[2] + assert X[1] == V[1] + assert X[2] == V[0] def testEuler(): print ("Eulerf") - testEulerx (Eulerf, V3f, M33f, M44f) + testEulerx (Eulerf, V3f, M33f, M44f, Quatf) print ("Eulerd") - testEulerx (Eulerd, V3d, M33d, M44d) + testEulerx (Eulerd, V3d, M33d, M44d, Quatd) print ("conversions") testEulerConversions() - + print("EulerfArray") + testEulerArrays(Eulerf, EulerfArray, QuatfArray, V3f, V3fArray) + print("EulerdArray") + testEulerArrays(Eulerd, EulerdArray, QuatdArray, V3d, V3dArray) testList.append (('testEuler',testEuler)) @@ -7913,7 +8263,7 @@ testList.append (('testColorConversions',testColorConversions)) # ------------------------------------------------------------------------- # Tests for Frustumx -def testFrustumx (Frustum, Vec3, Mat): +def testFrustumx (Frustum, Plane, Vec2, Vec3, Mat): # Constructors (and accessors). @@ -7942,6 +8292,13 @@ def testFrustumx (Frustum, Vec3, Mat): f.orthographic() == ortho assert f.near() == nearPlane and f.far() == farPlane + f = eval(repr(f)) + assert f.nearPlane() == nearPlane and f.farPlane() == farPlane and \ + f.left() == left and f.right() == right and \ + f.bottom() == bottom and f.top() == top and \ + f.orthographic() == ortho + assert f.near() == nearPlane and f.far() == farPlane + # Assignment. f1 = Frustum(nearPlane, farPlane, left, right, top, bottom, ortho) @@ -8008,6 +8365,13 @@ def testFrustumx (Frustum, Vec3, Mat): assert equal(f.nearPlane(), m_near, 2 * farPlaneN.baseTypeEpsilon()) assert equal(f.farPlane(), m_far, 2 * farPlaneN.baseTypeEpsilon()) + ortho = 1 + f = Frustum(nearPlane, farPlane, left, right, top, bottom, ortho) + m_near = f.nearPlane() - 0.1 + m_far = f.farPlane() + 100 + f.modifyNearAndFar(m_near, m_far) + assert equal(f.nearPlane(), m_near, 2 * farPlaneN.baseTypeEpsilon()) + # Fovy, aspect, projection matrix. nearPlane = 1 @@ -8073,9 +8437,32 @@ def testFrustumx (Frustum, Vec3, Mat): bottom + (top - bottom) * (1 + t) / 2.0, -nearPlane) assert iszero(l.distanceTo(p3d), 2 * p3d.baseTypeEpsilon()) + l = f.projectScreenToRay(Vec2(s, t)) + + p3d = Vec3(left + (right - left) * (1 + s) / 2.0, + bottom + (top - bottom) * (1 + t) / 2.0, -nearPlane) + assert iszero(l.distanceTo(p3d), 2 * p3d.baseTypeEpsilon()) + + try: + f.projectScreenToRay((0, 0, 0)) + except: + pass + else: + assert False + + p2d = f.projectPointToScreen((p3d.x, p3d.y, p3d.z)) + assert p2d.equalWithAbsError((s, t), p2d.baseTypeEpsilon()) + p2d = f.projectPointToScreen(p3d) assert p2d.equalWithAbsError((s, t), p2d.baseTypeEpsilon()) + try: + f.projectPointToScreen((0, 0, 0, 0)) + except: + pass + else: + assert False + p3df = V3f (p3d) p2d = f.projectPointToScreen(p3df) assert p2d.equalWithAbsError((s, t), p2d.baseTypeEpsilon()) @@ -8131,9 +8518,29 @@ def testFrustumx (Frustum, Vec3, Mat): r1 = f.screenRadius((0, 0, -d), d * s) assert equal(r1, s, Vec3().baseTypeEpsilon()) + try: + f.screenRadius((0, 0, 0, 0), r1) + except: + pass + else: + assert False + + r1 = f.screenRadius(Vec3(0, 0, -d), d * s) + assert equal(r1, s, Vec3().baseTypeEpsilon()) + r2 = f.worldRadius((0, 0, -d), r1) assert equal(r2, d * s, Vec3().baseTypeEpsilon()) + try: + f.worldRadius((0, 0, 0, 0), r1) + except: + pass + else: + assert False + + r2 = f.worldRadius(Vec3(0, 0, -d), r1) + assert equal(r2, d * s, Vec3().baseTypeEpsilon()) + print ("ok") return @@ -8141,11 +8548,36 @@ def testFrustumx (Frustum, Vec3, Mat): def testFrustum (): print ("Frustumf") - testFrustumx (Frustumf, V3f, M44f) + testFrustumx (Frustumf, Plane3f, V2f, V3f, M44f) testList.append (('testFrustum',testFrustum)) +def testFrustumTest (): + f = Frustumf() + + nearPlane = 1 + farPlane = 1000 + left = -2 + right = 2 + top = 2 + bottom = -2 + ortho = 1 + + f = Frustumf(nearPlane, farPlane, left, right, top, bottom, ortho) + m = M44f() + t = FrustumTestf(f, m) + + t.isVisible(Box3f()) + t.isVisible(V3f(0,0,0)) + + V = V3fArray(2) + t.isVisible(V) + + t.completelyContains(Box3f()) + +testList.append (('testFrustumTest',testFrustumTest)) + # ------------------------------------------------------------------------- # Tests for random number generators @@ -10104,6 +10536,29 @@ def testQuatArrays(): assert (abs (q1.x[3] + x) <= 1.e-6) assert (abs (q1.y[3] - x) <= 1.e-6) + u = EulerfArray(5) + for i in range(5): + u[i] = Eulerf (V3f (1, 2, 3), EULER_XYZ) + q = QuatfArray(u) + for i in range(5): + assert equalWithAbsError(q[i].r(), 0.4359528422355652, 1e-5) and q[i].v().equalWithAbsError(V3f(-0.718287, 0.310622, 0.444435), 1e-5) + + axis = q1.axis() + assert axis[0].equalWithAbsError(V3f(1, 0, 0), 1e-5) + assert axis[1].equalWithAbsError(V3f(0.707107, 0.707107, 0), 1e-5) + assert axis[2].equalWithAbsError(V3f(0, 1, 0), 1e-5) + assert axis[3].equalWithAbsError(V3f(-0.707107, 0.707107, 0), 1e-5) + + angle = q1.angle() + for i in range(5): + assert equalWithAbsError(angle[i], pi, 1e-5) + + m = M44dArray(5) + qm = QuatfArray(5) + qm.extract(m) + for i in range(5): + assert equalWithAbsError(qm[i].r(), 1, 1e-5) and qm[i].v().equalWithAbsError(V3f(0,0,0),1e-5) + q2 = -q1 for i in range(5): assert (q2[i] == -q1[i]) @@ -10117,6 +10572,27 @@ def testQuatArrays(): assert (q3[i] == q1[i] * qA) q3 *= 10. + a = V3f(1,0,0) * q1 + assert a[0].equalWithAbsError(V3f(1, 0, 0), 1e-5) + assert a[1].equalWithAbsError(V3f(5.96046e-08, 1, 6.18172e-08), 1e-5) + assert a[2].equalWithAbsError(V3f(-1, 0, 8.74228e-08), 1e-5) + assert a[3].equalWithAbsError(V3f(5.96046e-08, -1, 6.18172e-08), 1e-5) + + v = V3fArray(5) + for i in range(5): + v[i] = V3f(1,0,0) + a = v * q1 + assert a[0].equalWithAbsError(V3f(1, 0, 0), 1e-5) + assert a[1].equalWithAbsError(V3f(5.96046e-08, 1, 6.18172e-08), 1e-5) + assert a[2].equalWithAbsError(V3f(-1, 0, 8.74228e-08), 1e-5) + assert a[3].equalWithAbsError(V3f(5.96046e-08, -1, 6.18172e-08), 1e-5) + + a = q1.rotateVector(v) + assert a[0].equalWithAbsError(V3f(1, 0, 0), 1e-5) + assert a[1].equalWithAbsError(V3f(0, 1, 6.18172e-08), 1e-5) + assert a[2].equalWithAbsError(V3f(-1, 0, 8.74228e-08), 1e-5) + assert a[3].equalWithAbsError(V3f(0, -1, 6.18172e-08), 1e-5) + tmp = QuatfArray (5) tmp[:] = q3 q3.normalize() @@ -10127,7 +10603,8 @@ def testQuatArrays(): q4 = q1.slerp (q3, 0.5) for i in range(5): assert (q4[i] == q1[i].slerpShortestArc (q3[i], 0.5)) - + assert (q4[i] == q3[i].slerpShortestArc (q1[i], 0.5)) + tmp[:] = q4 q4 *= q3.inverse() for i in range(5): diff --git a/third_party/Imath-3.1.9/src/python/PyImathTest/testStringTable.cpp b/third_party/Imath/src/python/PyImathTest/testStringTable.cpp similarity index 100% rename from third_party/Imath-3.1.9/src/python/PyImathTest/testStringTable.cpp rename to third_party/Imath/src/python/PyImathTest/testStringTable.cpp diff --git a/third_party/Imath-3.1.9/src/ImathTest/testLimits.h b/third_party/Imath/src/python/PyImathTest/testStringTable.h similarity index 70% rename from third_party/Imath-3.1.9/src/ImathTest/testLimits.h rename to third_party/Imath/src/python/PyImathTest/testStringTable.h index 309aa605..311a12d4 100644 --- a/third_party/Imath-3.1.9/src/ImathTest/testLimits.h +++ b/third_party/Imath/src/python/PyImathTest/testStringTable.h @@ -3,5 +3,5 @@ // Copyright Contributors to the OpenEXR Project. // -void testLimits(); -void testHalfLimits(); +void testStringTable(); + diff --git a/third_party/Imath-3.1.9/src/python/config/CMakeLists.txt b/third_party/Imath/src/python/config/CMakeLists.txt similarity index 100% rename from third_party/Imath-3.1.9/src/python/config/CMakeLists.txt rename to third_party/Imath/src/python/config/CMakeLists.txt diff --git a/third_party/Imath-3.1.9/src/python/config/ModuleDefine.cmake b/third_party/Imath/src/python/config/ModuleDefine.cmake similarity index 92% rename from third_party/Imath-3.1.9/src/python/config/ModuleDefine.cmake rename to third_party/Imath/src/python/config/ModuleDefine.cmake index 7e30614d..adee61c8 100644 --- a/third_party/Imath-3.1.9/src/python/config/ModuleDefine.cmake +++ b/third_party/Imath/src/python/config/ModuleDefine.cmake @@ -39,6 +39,9 @@ function(PYIMATH_ADD_LIBRARY_PRIV libname) if(Boost_INCLUDE_DIR) target_include_directories(${libname} PUBLIC ${Boost_INCLUDE_DIR}) endif() + if (pybind11_INCLUDE_DIRS) + target_include_directories(${libname} PUBLIC ${pybind11_INCLUDE_DIRS}) + endif() target_link_libraries(${libname} PUBLIC ${PYIMATH_CURLIB_DEPENDENCIES}) if(PYIMATH_CURLIB_PRIVATE_DEPS) target_link_libraries(${libname} PRIVATE ${PYIMATH_CURLIB_PRIVATE_DEPS}) @@ -52,7 +55,6 @@ function(PYIMATH_ADD_LIBRARY_PRIV libname) add_library(${PROJECT_NAME}::${libname} ALIAS ${libname}) install(TARGETS ${libname} - EXPORT ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -100,8 +102,9 @@ function(PYIMATH_DEFINE_MODULE modname) # NB: make this one last so we can cheat and add the python and boost # libs as private deps at the end regardless of whether it was provided list(APPEND libarglist PRIVATE_DEPS ${PYIMATH_CURMOD_PRIVATE_DEPS}) + if(USE_PYTHON2) - if(TARGET Python2::Python AND TARGET Boost::${PYIMATH_BOOST_PY_COMPONENT}) + if(TARGET Python2::Python) set(libname "${PYIMATH_CURMOD_LIBNAME}${PYIMATH_LIB_PYTHONVER_ROOT}${Python2_VERSION_MAJOR}_${Python2_VERSION_MINOR}") set(extraDeps ${PYIMATH_CURMOD_MODULE_DEPS}) list(TRANSFORM extraDeps APPEND ${PYIMATH_LIB_PYTHONVER_ROOT}${Python2_VERSION_MAJOR}_${Python2_VERSION_MINOR}) @@ -110,7 +113,7 @@ function(PYIMATH_DEFINE_MODULE modname) ${libarglist} ${extraDeps} Python2::Python - Boost::${PYIMATH_BOOST_PY_COMPONENT} + $ ) Python2_add_library(${modname}_python2 MODULE ${PYIMATH_CURMOD_MODSOURCE}) @@ -120,7 +123,7 @@ function(PYIMATH_DEFINE_MODULE modname) ${extraDeps} ${PYIMATH_CURMOD_DEPENDENCIES} ${PYIMATH_CURMOD_PRIVATE_DEPS} - Boost::${PYIMATH_BOOST_PY_COMPONENT} + $ ) set_target_properties(${modname}_python2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python${Python2_VERSION_MAJOR}_${Python2_VERSION_MINOR}/" @@ -130,7 +133,7 @@ function(PYIMATH_DEFINE_MODULE modname) install(TARGETS ${modname}_python2 DESTINATION ${PyImath_Python2_SITEARCH_REL}) endif() else() - if(TARGET Python3::Python AND TARGET Boost::${PYIMATH_BOOST_PY_COMPONENT}) + if(TARGET Python3::Python) set(libname "${PYIMATH_CURMOD_LIBNAME}${PYIMATH_LIB_PYTHONVER_ROOT}${Python3_VERSION_MAJOR}_${Python3_VERSION_MINOR}") set(extraDeps ${PYIMATH_CURMOD_MODULE_DEPS}) list(TRANSFORM extraDeps APPEND ${PYIMATH_LIB_PYTHONVER_ROOT}${Python3_VERSION_MAJOR}_${Python3_VERSION_MINOR}) @@ -139,7 +142,7 @@ function(PYIMATH_DEFINE_MODULE modname) ${libarglist} ${extraDeps} Python3::Python - Boost::${PYIMATH_BOOST_PY_COMPONENT} + $ ) Python3_add_library(${modname}_python3 MODULE ${PYIMATH_CURMOD_MODSOURCE}) target_link_libraries(${modname}_python3 @@ -147,7 +150,7 @@ function(PYIMATH_DEFINE_MODULE modname) ${libname} ${extraDeps} ${PYIMATH_CURMOD_DEPENDENCIES} ${PYIMATH_CURMOD_PRIVATE_DEPS} - Boost::${PYIMATH_BOOST_PY_COMPONENT} + $ ) set_target_properties(${modname}_python3 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python${Python3_VERSION_MAJOR}_${Python3_VERSION_MINOR}/" diff --git a/third_party/Imath-3.1.9/src/python/config/NumPyLocate.cmake b/third_party/Imath/src/python/config/NumPyLocate.cmake similarity index 100% rename from third_party/Imath-3.1.9/src/python/config/NumPyLocate.cmake rename to third_party/Imath/src/python/config/NumPyLocate.cmake diff --git a/third_party/Imath-3.1.9/src/python/config/PyImathConfig.h.in b/third_party/Imath/src/python/config/PyImathConfig.h.in similarity index 99% rename from third_party/Imath-3.1.9/src/python/config/PyImathConfig.h.in rename to third_party/Imath/src/python/config/PyImathConfig.h.in index 6e7cd798..87b00bd3 100644 --- a/third_party/Imath-3.1.9/src/python/config/PyImathConfig.h.in +++ b/third_party/Imath/src/python/config/PyImathConfig.h.in @@ -33,4 +33,3 @@ // #undef HAVE_LARGE_STACK - diff --git a/third_party/Imath-3.1.9/src/python/config/PyImathSetup.cmake b/third_party/Imath/src/python/config/PyImathSetup.cmake similarity index 100% rename from third_party/Imath-3.1.9/src/python/config/PyImathSetup.cmake rename to third_party/Imath/src/python/config/PyImathSetup.cmake diff --git a/third_party/Imath-3.1.9/docs/CMakeLists.txt b/third_party/Imath/website/CMakeLists.txt similarity index 86% rename from third_party/Imath-3.1.9/docs/CMakeLists.txt rename to third_party/Imath/website/CMakeLists.txt index 799c445c..8e2c320d 100644 --- a/third_party/Imath-3.1.9/docs/CMakeLists.txt +++ b/third_party/Imath/website/CMakeLists.txt @@ -38,11 +38,5 @@ add_custom_command(OUTPUT ${SPHINX_INDEX_FILE} MAIN_DEPENDENCY conf.py COMMENT "Generating documentation with Sphinx") -add_custom_target(docs ALL DEPENDS ${SPHINX_INDEX_FILE} ${DOXYGEN_INDEX_FILE}) - -# Add an install target to install the docs -if(INSTALL_DOCS) - include(GNUInstallDirs) - install(DIRECTORY ${SPHINX_BUILD} - DESTINATION ${CMAKE_INSTALL_DOCDIR}) -endif() +add_custom_target(website ALL DEPENDS ${SPHINX_INDEX_FILE} ${DOXYGEN_INDEX_FILE}) + diff --git a/third_party/Imath-3.1.9/docs/Doxyfile.in b/third_party/Imath/website/Doxyfile.in similarity index 100% rename from third_party/Imath-3.1.9/docs/Doxyfile.in rename to third_party/Imath/website/Doxyfile.in diff --git a/third_party/Imath-3.1.9/docs/PortingGuide.rst b/third_party/Imath/website/PortingGuide.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/PortingGuide.rst rename to third_party/Imath/website/PortingGuide.rst diff --git a/third_party/Imath-3.1.9/docs/SymbolVisibility.rst b/third_party/Imath/website/SymbolVisibility.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/SymbolVisibility.rst rename to third_party/Imath/website/SymbolVisibility.rst diff --git a/third_party/Imath/website/_templates/layout.html b/third_party/Imath/website/_templates/layout.html new file mode 100644 index 00000000..1fca7c9a --- /dev/null +++ b/third_party/Imath/website/_templates/layout.html @@ -0,0 +1,14 @@ + + + +{% extends '!layout.html' %} + +{% block footer %} + +

+ +

Copyright © OpenEXR a Series of LF Projects, LLC.

+

For web site terms of use, trademark policy and other project policies +please see https://lfprojects.org.

+ +{% endblock %} diff --git a/third_party/Imath-3.1.9/docs/about.rst b/third_party/Imath/website/about.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/about.rst rename to third_party/Imath/website/about.rst diff --git a/third_party/Imath-3.1.9/docs/classes.rst b/third_party/Imath/website/classes.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes.rst rename to third_party/Imath/website/classes.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Box.rst b/third_party/Imath/website/classes/Box.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Box.rst rename to third_party/Imath/website/classes/Box.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Color3.rst b/third_party/Imath/website/classes/Color3.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Color3.rst rename to third_party/Imath/website/classes/Color3.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Color4.rst b/third_party/Imath/website/classes/Color4.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Color4.rst rename to third_party/Imath/website/classes/Color4.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Euler.rst b/third_party/Imath/website/classes/Euler.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Euler.rst rename to third_party/Imath/website/classes/Euler.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Frustum.rst b/third_party/Imath/website/classes/Frustum.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Frustum.rst rename to third_party/Imath/website/classes/Frustum.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Interval.rst b/third_party/Imath/website/classes/Interval.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Interval.rst rename to third_party/Imath/website/classes/Interval.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Line3.rst b/third_party/Imath/website/classes/Line3.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Line3.rst rename to third_party/Imath/website/classes/Line3.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Matrix22.rst b/third_party/Imath/website/classes/Matrix22.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Matrix22.rst rename to third_party/Imath/website/classes/Matrix22.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Matrix33.rst b/third_party/Imath/website/classes/Matrix33.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Matrix33.rst rename to third_party/Imath/website/classes/Matrix33.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Matrix44.rst b/third_party/Imath/website/classes/Matrix44.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Matrix44.rst rename to third_party/Imath/website/classes/Matrix44.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Plane3.rst b/third_party/Imath/website/classes/Plane3.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Plane3.rst rename to third_party/Imath/website/classes/Plane3.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Quat.rst b/third_party/Imath/website/classes/Quat.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Quat.rst rename to third_party/Imath/website/classes/Quat.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Rand32.rst b/third_party/Imath/website/classes/Rand32.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Rand32.rst rename to third_party/Imath/website/classes/Rand32.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Rand48.rst b/third_party/Imath/website/classes/Rand48.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Rand48.rst rename to third_party/Imath/website/classes/Rand48.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Shear6.rst b/third_party/Imath/website/classes/Shear6.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Shear6.rst rename to third_party/Imath/website/classes/Shear6.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Sphere3.rst b/third_party/Imath/website/classes/Sphere3.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Sphere3.rst rename to third_party/Imath/website/classes/Sphere3.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Vec2.rst b/third_party/Imath/website/classes/Vec2.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Vec2.rst rename to third_party/Imath/website/classes/Vec2.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Vec3.rst b/third_party/Imath/website/classes/Vec3.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Vec3.rst rename to third_party/Imath/website/classes/Vec3.rst diff --git a/third_party/Imath-3.1.9/docs/classes/Vec4.rst b/third_party/Imath/website/classes/Vec4.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/Vec4.rst rename to third_party/Imath/website/classes/Vec4.rst diff --git a/third_party/Imath-3.1.9/docs/classes/float.rst b/third_party/Imath/website/classes/float.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/float.rst rename to third_party/Imath/website/classes/float.rst diff --git a/third_party/Imath-3.1.9/docs/classes/half.rst b/third_party/Imath/website/classes/half.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/half.rst rename to third_party/Imath/website/classes/half.rst diff --git a/third_party/Imath-3.1.9/docs/classes/half_c.rst b/third_party/Imath/website/classes/half_c.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/half_c.rst rename to third_party/Imath/website/classes/half_c.rst diff --git a/third_party/Imath-3.1.9/docs/classes/half_class.rst b/third_party/Imath/website/classes/half_class.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/half_class.rst rename to third_party/Imath/website/classes/half_class.rst diff --git a/third_party/Imath-3.1.9/docs/classes/half_conversion.rst b/third_party/Imath/website/classes/half_conversion.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/half_conversion.rst rename to third_party/Imath/website/classes/half_conversion.rst diff --git a/third_party/Imath-3.1.9/docs/classes/half_limits.rst b/third_party/Imath/website/classes/half_limits.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/classes/half_limits.rst rename to third_party/Imath/website/classes/half_limits.rst diff --git a/third_party/Imath-3.1.9/docs/concepts.rst b/third_party/Imath/website/concepts.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/concepts.rst rename to third_party/Imath/website/concepts.rst diff --git a/third_party/Imath-3.1.9/docs/conf.py b/third_party/Imath/website/conf.py similarity index 99% rename from third_party/Imath-3.1.9/docs/conf.py rename to third_party/Imath/website/conf.py index b8c21668..5e408046 100644 --- a/third_party/Imath-3.1.9/docs/conf.py +++ b/third_party/Imath/website/conf.py @@ -74,7 +74,6 @@ # General information about the project. project = 'Imath' -copyright = '2021, Contributors to the OpenEXR Project' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/third_party/Imath/website/examples/Box.cpp b/third_party/Imath/website/examples/Box.cpp new file mode 100644 index 00000000..5f58f48c --- /dev/null +++ b/third_party/Imath/website/examples/Box.cpp @@ -0,0 +1,25 @@ +#include + +void +box_example () +{ + Imath::V3f a (0, 0, 0); + Imath::V3f b (1, 1, 1); + Imath::V3f c (2, 9, 2); + + Imath::Box3f box (a); + + assert (box.isEmpty ()); + assert (!box.isInfinite ()); + assert (!box.hasVolume ()); + + box.extendBy (c); + + assert (box.size () == (c - a)); + assert (box.intersects (b)); + assert (box.max[0] > box.min[0]); + assert (box.max[1] > box.min[1]); + assert (box.max[2] > box.min[2]); + assert (box.hasVolume ()); + assert (box.majorAxis () == 1); +} diff --git a/third_party/Imath-3.1.9/docs/examples/CMakeLists.txt b/third_party/Imath/website/examples/CMakeLists.txt similarity index 100% rename from third_party/Imath-3.1.9/docs/examples/CMakeLists.txt rename to third_party/Imath/website/examples/CMakeLists.txt diff --git a/third_party/Imath/website/examples/Color3.cpp b/third_party/Imath/website/examples/Color3.cpp new file mode 100644 index 00000000..9d4e625c --- /dev/null +++ b/third_party/Imath/website/examples/Color3.cpp @@ -0,0 +1,16 @@ +#include +#include + +void +color3_example () +{ + Imath::C3c r (255, 0, 0); + Imath::C3c g (0, 255, 0); + Imath::C3c b (0, 0, 255); + + Imath::C3c c = r + g + b; + + assert (c.x == 255); + assert (c.x == 255); + assert (c.x == 255); +} diff --git a/third_party/Imath/website/examples/Color4.cpp b/third_party/Imath/website/examples/Color4.cpp new file mode 100644 index 00000000..c40792e1 --- /dev/null +++ b/third_party/Imath/website/examples/Color4.cpp @@ -0,0 +1,17 @@ +#include +#include + +void +color4_example () +{ + Imath::C4f r (1.0f, 0.0f, 0.0f, 1.0f); + Imath::C4f g (0.0f, 1.0f, 0.0f, 1.0f); + Imath::C4f b (0.0f, 0.0f, 1.0f, 1.0f); + + Imath::C4f w = r + g + b; + + assert (w.r == 1.0f); + assert (w.g == 1.0f); + assert (w.b == 1.0f); + assert (w.a == 3.0f); +} diff --git a/third_party/Imath-3.1.9/docs/examples/Euler.cpp b/third_party/Imath/website/examples/Euler.cpp similarity index 89% rename from third_party/Imath-3.1.9/docs/examples/Euler.cpp rename to third_party/Imath/website/examples/Euler.cpp index 705a4586..664a20d6 100644 --- a/third_party/Imath-3.1.9/docs/examples/Euler.cpp +++ b/third_party/Imath/website/examples/Euler.cpp @@ -3,10 +3,10 @@ #include void -euler_example() +euler_example () { int i, j, k; - + Imath::Eulerf xyz (Imath::Eulerf::XYZ); xyz.angleOrder (i, j, k); assert (i == 0 && j == 1 && k == 2); @@ -19,7 +19,6 @@ euler_example() Imath::Eulerf e2 (0.0f, 0.0f, 0.1f); e1.makeNear (e2); - Imath::V3f v = e2.toXYZVector(); + Imath::V3f v = e2.toXYZVector (); assert (v.equalWithAbsError (Imath::V3f (0.0f, 0.0f, 0.1f), 0.00001f)); } - diff --git a/third_party/Imath-3.1.9/docs/examples/Frustum.cpp b/third_party/Imath/website/examples/Frustum.cpp similarity index 63% rename from third_party/Imath-3.1.9/docs/examples/Frustum.cpp rename to third_party/Imath/website/examples/Frustum.cpp index eb3f750c..5742dfd9 100644 --- a/third_party/Imath-3.1.9/docs/examples/Frustum.cpp +++ b/third_party/Imath/website/examples/Frustum.cpp @@ -2,18 +2,18 @@ #include void -frustum_example() +frustum_example () { - float near = 1.7f; - float far = 567.0f; - float left = -3.5f; - float right = 2.0f; - float top = 0.9f; + float near = 1.7f; + float far = 567.0f; + float left = -3.5f; + float right = 2.0f; + float top = 0.9f; float bottom = -1.3f; Imath::Frustumf frustum (near, far, left, right, top, bottom, false); - Imath::M44f m = frustum.projectionMatrix(); + Imath::M44f m = frustum.projectionMatrix (); Imath::V3f p (1.0f, 1.0f, 1.0f); Imath::V2f s = frustum.projectPointToScreen (p); diff --git a/third_party/Imath-3.1.9/docs/examples/Interval.cpp b/third_party/Imath/website/examples/Interval.cpp similarity index 50% rename from third_party/Imath-3.1.9/docs/examples/Interval.cpp rename to third_party/Imath/website/examples/Interval.cpp index afaab79d..00db073c 100644 --- a/third_party/Imath-3.1.9/docs/examples/Interval.cpp +++ b/third_party/Imath/website/examples/Interval.cpp @@ -2,18 +2,18 @@ #include void -interval_example() +interval_example () { Imath::Intervalf v; - assert (v.isEmpty()); - assert (!v.hasVolume()); - assert (!v.isInfinite()); + assert (v.isEmpty ()); + assert (!v.hasVolume ()); + assert (!v.isInfinite ()); v.extendBy (1.0f); - assert (!v.isEmpty()); - + assert (!v.isEmpty ()); + v.extendBy (2.0f); - assert (v.hasVolume()); + assert (v.hasVolume ()); assert (v.intersects (1.5f)); } diff --git a/third_party/Imath-3.1.9/docs/examples/Line3.cpp b/third_party/Imath/website/examples/Line3.cpp similarity index 51% rename from third_party/Imath-3.1.9/docs/examples/Line3.cpp rename to third_party/Imath/website/examples/Line3.cpp index f622c26e..5dfa1e19 100644 --- a/third_party/Imath-3.1.9/docs/examples/Line3.cpp +++ b/third_party/Imath/website/examples/Line3.cpp @@ -2,22 +2,23 @@ #include void -line3_example() +line3_example () { - Imath::V3f a (0.0f, 0.0f, 0.0f); - Imath::V3f b (1.0f, 1.0f, 1.0f); + Imath::V3f a (0.0f, 0.0f, 0.0f); + Imath::V3f b (1.0f, 1.0f, 1.0f); Imath::Line3f line (a, b); - + assert (line.pos == a); - assert (line.dir == (b-a).normalized()); - - Imath::V3f c (0.5f, 0.5f, 0.5f); + assert (line.dir == (b - a).normalized ()); + + Imath::V3f c (0.5f, 0.5f, 0.5f); float f = line.distanceTo (c); assert (Imath::equalWithAbsError (f, 0.0f, 0.0001f)); Imath::V3f p = line (0.5f); // midpoint, i.e. 0.5 units from a along (b-a) - assert (p.equalWithAbsError (Imath::V3f (0.288675f, 0.288675f, 0.288675f), 0.0001f)); + assert (p.equalWithAbsError ( + Imath::V3f (0.288675f, 0.288675f, 0.288675f), 0.0001f)); } diff --git a/third_party/Imath-3.1.9/docs/examples/Matrix22.cpp b/third_party/Imath/website/examples/Matrix22.cpp similarity index 80% rename from third_party/Imath-3.1.9/docs/examples/Matrix22.cpp rename to third_party/Imath/website/examples/Matrix22.cpp index cdf3c6c7..e52ae5bf 100644 --- a/third_party/Imath-3.1.9/docs/examples/Matrix22.cpp +++ b/third_party/Imath/website/examples/Matrix22.cpp @@ -3,21 +3,21 @@ #include void -matrix22_example() +matrix22_example () { Imath::M22f M (Imath::UNINITIALIZED); // uninitialized - M.makeIdentity(); + M.makeIdentity (); assert (M[0][0] == 1.0f); assert (M[0][1] == 0.0f); - Imath::M22f Minv = M.inverse(); + Imath::M22f Minv = M.inverse (); Imath::M22f R; assert (R == Imath::identity22f); - R.rotate (M_PI/4); - + R.rotate (M_PI / 4); + M = R * M; Imath::V2f v2 (1.0f, 0.0f); diff --git a/third_party/Imath-3.1.9/docs/examples/Matrix33.cpp b/third_party/Imath/website/examples/Matrix33.cpp similarity index 64% rename from third_party/Imath-3.1.9/docs/examples/Matrix33.cpp rename to third_party/Imath/website/examples/Matrix33.cpp index 6ed42da3..3439b5db 100644 --- a/third_party/Imath-3.1.9/docs/examples/Matrix33.cpp +++ b/third_party/Imath/website/examples/Matrix33.cpp @@ -3,25 +3,26 @@ #include void -matrix33_example() +matrix33_example () { Imath::M33f M (Imath::UNINITIALIZED); // uninitialized - M.makeIdentity(); + M.makeIdentity (); assert (M[0][0] == 1.0f); assert (M[0][1] == 0.0f); - Imath::M33f Minv = M.inverse(); + Imath::M33f Minv = M.inverse (); Imath::M33f R; assert (R == Imath::identity33f); - R.rotate (M_PI/4); - + R.rotate (M_PI / 4); + M = R * M; Imath::V3f v3 (1.0f, 0.0f, 0.0f); Imath::V3f r3 = v3 * M; - assert (r3.equalWithAbsError (Imath::V3f (0.707107f, 0.7071070f, 0.0f), 1e-6f)); + assert ( + r3.equalWithAbsError (Imath::V3f (0.707107f, 0.7071070f, 0.0f), 1e-6f)); } diff --git a/third_party/Imath-3.1.9/docs/examples/Matrix44.cpp b/third_party/Imath/website/examples/Matrix44.cpp similarity index 56% rename from third_party/Imath-3.1.9/docs/examples/Matrix44.cpp rename to third_party/Imath/website/examples/Matrix44.cpp index 8b6c2a36..a582569d 100644 --- a/third_party/Imath-3.1.9/docs/examples/Matrix44.cpp +++ b/third_party/Imath/website/examples/Matrix44.cpp @@ -3,29 +3,31 @@ #include void -matrix44_example() +matrix44_example () { Imath::M44f M (Imath::UNINITIALIZED); // uninitialized - M.makeIdentity(); + M.makeIdentity (); assert (M[0][0] == 1.0f); assert (M[0][1] == 0.0f); - Imath::M44f Minv = M.inverse(); + Imath::M44f Minv = M.inverse (); Imath::M44f R; assert (R == Imath::identity44f); - R.rotate (Imath::V3f (0.02f, M_PI/4, 0.0f)); - + R.rotate (Imath::V3f (0.02f, M_PI / 4, 0.0f)); + M = R * M; Imath::V3f v3 (1.0f, 0.0f, 0.0f); Imath::V4f v4 (1.0f, 0.0f, 0.0f, 1.0f); Imath::V3f r3 = v3 * M; - assert (r3.equalWithAbsError (Imath::V3f (0.707107f, 0.0f, -0.7071070f), 1e-6f)); + assert (r3.equalWithAbsError ( + Imath::V3f (0.707107f, 0.0f, -0.7071070f), 1e-6f)); Imath::V4f r4 = v4 * M; - assert (r4.equalWithAbsError (Imath::V4f (0.707107f, 0.0f, -0.7071070f, 1.0f), 1e-6f)); + assert (r4.equalWithAbsError ( + Imath::V4f (0.707107f, 0.0f, -0.7071070f, 1.0f), 1e-6f)); } diff --git a/third_party/Imath-3.1.9/docs/examples/Plane3.cpp b/third_party/Imath/website/examples/Plane3.cpp similarity index 74% rename from third_party/Imath-3.1.9/docs/examples/Plane3.cpp rename to third_party/Imath/website/examples/Plane3.cpp index e75cb0f7..d75f732e 100644 --- a/third_party/Imath-3.1.9/docs/examples/Plane3.cpp +++ b/third_party/Imath/website/examples/Plane3.cpp @@ -2,7 +2,7 @@ #include void -plane3_example() +plane3_example () { Imath::V3f a (1.0f, 0.0f, 0.0f); Imath::V3f b (0.0f, 1.0f, 0.0f); @@ -10,12 +10,12 @@ plane3_example() Imath::Plane3f p (a, b, c); - Imath::V3f n (1.0f, 1.0f, 1.0f); - n.normalize(); + Imath::V3f n (1.0f, 1.0f, 1.0f); + n.normalize (); assert (p.normal == n); Imath::V3f o (0.0f, 0.0f, 0.0f); - float d = p.distanceTo (o); + float d = p.distanceTo (o); assert (Imath::equalWithAbsError (d, -0.57735f, 1e-6f)); } diff --git a/third_party/Imath-3.1.9/docs/examples/Quat.cpp b/third_party/Imath/website/examples/Quat.cpp similarity index 71% rename from third_party/Imath-3.1.9/docs/examples/Quat.cpp rename to third_party/Imath/website/examples/Quat.cpp index c824afa0..66d1cd1e 100644 --- a/third_party/Imath-3.1.9/docs/examples/Quat.cpp +++ b/third_party/Imath/website/examples/Quat.cpp @@ -2,11 +2,11 @@ #include void -quat_example() +quat_example () { Imath::Quatf q (2.0f, 3.0f, 4.0f, 5.0f); assert (q.r == 2.0f && q.v == Imath::V3f (3.0f, 4.0f, 5.0f)); Imath::Quatf r (1.0f, 0.0f, 0.0f, 1.0f); - assert (r.inverse() == Imath::Quatf (0.5f, 0.0f, 0.0f, -0.5f)); + assert (r.inverse () == Imath::Quatf (0.5f, 0.0f, 0.0f, -0.5f)); } diff --git a/third_party/Imath-3.1.9/docs/examples/Shear6.cpp b/third_party/Imath/website/examples/Shear6.cpp similarity index 91% rename from third_party/Imath-3.1.9/docs/examples/Shear6.cpp rename to third_party/Imath/website/examples/Shear6.cpp index ba97bd2c..33edd445 100644 --- a/third_party/Imath-3.1.9/docs/examples/Shear6.cpp +++ b/third_party/Imath/website/examples/Shear6.cpp @@ -1,8 +1,8 @@ -#include #include +#include void -shear6_example() +shear6_example () { Imath::Shear6f s (0.330f, 0.710f, 0.010f, 0.999f, -0.531f, -0.012f); diff --git a/third_party/Imath/website/examples/Sphere3.cpp b/third_party/Imath/website/examples/Sphere3.cpp new file mode 100644 index 00000000..244a6c21 --- /dev/null +++ b/third_party/Imath/website/examples/Sphere3.cpp @@ -0,0 +1,22 @@ +#include +#include + +void +sphere3_example () +{ + Imath::V3f center (1.0f, 1.0f, 1.0f); + float radius = 2.0f; + Imath::Sphere3f s (center, radius); + + assert (s.center == center); + assert (s.radius == radius); + + Imath::Line3f line ( + Imath::V3f (0.0f, 0.0f, 0.0f), Imath::V3f (1.0f, 1.0f, 1.0f)); + + Imath::V3f v; + assert (s.intersect (line, v)); + + assert ( + v.equalWithAbsError (Imath::V3f (2.1547f, 2.1547f, 2.1547f), 1e-6f)); +} diff --git a/third_party/Imath/website/examples/Vec2.cpp b/third_party/Imath/website/examples/Vec2.cpp new file mode 100644 index 00000000..f4bc0f26 --- /dev/null +++ b/third_party/Imath/website/examples/Vec2.cpp @@ -0,0 +1,19 @@ +#include +#include + +void +vec2_example () +{ + Imath::V2f a (1.0f, 2.0f); + Imath::V2f b; // b is uninitialized + + b.x = a[0]; + b.y = a[1]; + + assert (a == b); + + assert (a.length () == sqrt (a ^ a)); + + a.normalize (); + assert (Imath::equalWithAbsError (a.length (), 1.0f, 1e-6f)); +} diff --git a/third_party/Imath/website/examples/Vec3.cpp b/third_party/Imath/website/examples/Vec3.cpp new file mode 100644 index 00000000..c72ea8be --- /dev/null +++ b/third_party/Imath/website/examples/Vec3.cpp @@ -0,0 +1,20 @@ +#include +#include + +void +vec3_example () +{ + Imath::V3f a (1.0f, 2.0f, 3.0f); + Imath::V3f b; // b is uninitialized + + b.x = a[0]; + b.y = a[1]; + b.z = a[2]; + + assert (a == b); + + assert (a.length () == sqrt (a ^ a)); + + a.normalize (); + assert (Imath::equalWithAbsError (a.length (), 1.0f, 1e-6f)); +} diff --git a/third_party/Imath/website/examples/Vec4.cpp b/third_party/Imath/website/examples/Vec4.cpp new file mode 100644 index 00000000..5ee1ab0d --- /dev/null +++ b/third_party/Imath/website/examples/Vec4.cpp @@ -0,0 +1,21 @@ +#include +#include + +void +vec4_example () +{ + Imath::V4f a (1.0f, 2.0f, 3.0f, 4.0f); + Imath::V4f b; // b is uninitialized + + b.x = a[0]; + b.y = a[1]; + b.z = a[2]; + b.w = a[3]; + + assert (a == b); + + assert (a.length () == sqrt (a ^ a)); + + a.normalize (); + assert (Imath::equalWithAbsError (a.length (), 1.0f, 1e-6f)); +} diff --git a/third_party/Imath-3.1.9/docs/examples/gl.cpp b/third_party/Imath/website/examples/gl.cpp similarity index 90% rename from third_party/Imath-3.1.9/docs/examples/gl.cpp rename to third_party/Imath/website/examples/gl.cpp index ce0150d8..f1e5229c 100644 --- a/third_party/Imath-3.1.9/docs/examples/gl.cpp +++ b/third_party/Imath/website/examples/gl.cpp @@ -1,7 +1,7 @@ #include void -gl_example() +gl_example () { Imath::M44f M; glPushMatrix (M); @@ -9,4 +9,3 @@ gl_example() Imath::V3f v (0.0f, 1.0f, 2.0f); glVertex (v); } - diff --git a/third_party/Imath-3.1.9/docs/examples/half.c b/third_party/Imath/website/examples/half.c similarity index 61% rename from third_party/Imath-3.1.9/docs/examples/half.c rename to third_party/Imath/website/examples/half.c index b7a65b04..420d8b9a 100644 --- a/third_party/Imath-3.1.9/docs/examples/half.c +++ b/third_party/Imath/website/examples/half.c @@ -1,12 +1,11 @@ #include void -half_example() +half_example () { float f = 3.5f; - + half h = imath_float_to_half (f) - float hh = imath_half_to_float (h) + float hh = imath_half_to_float (h) } - diff --git a/third_party/Imath-3.1.9/docs/examples/half.cpp b/third_party/Imath/website/examples/half.cpp similarity index 77% rename from third_party/Imath-3.1.9/docs/examples/half.cpp rename to third_party/Imath/website/examples/half.cpp index 266a8684..98eb1198 100644 --- a/third_party/Imath-3.1.9/docs/examples/half.cpp +++ b/third_party/Imath/website/examples/half.cpp @@ -2,12 +2,11 @@ #include void -half_example() +half_example () { - half a (3.5); + half a (3.5); float b (a + sqrt (a)); a += b; b += a; b = a + 7; } - diff --git a/third_party/Imath-3.1.9/docs/examples/intro.cpp b/third_party/Imath/website/examples/intro.cpp similarity index 100% rename from third_party/Imath-3.1.9/docs/examples/intro.cpp rename to third_party/Imath/website/examples/intro.cpp diff --git a/third_party/Imath/website/examples/main.cpp b/third_party/Imath/website/examples/main.cpp new file mode 100644 index 00000000..e64f4dce --- /dev/null +++ b/third_party/Imath/website/examples/main.cpp @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright Contributors to the OpenEXR Project. + +#include + +void color3_example (); +void color4_example (); +void euler_example (); +void frustum_example (); +void interval_example (); +void line3_example (); +void matrix22_example (); +void matrix33_example (); +void matrix44_example (); +void plane3_example (); +void quat_example (); +void shear6_example (); +void sphere3_example (); +void vec2_example (); +void vec3_example (); +void vec4_example (); +void half_example (); + +int +main (int argc, char* argv[]) +{ + std::cout << "imath examples..." << std::endl; + + color3_example (); + color4_example (); + euler_example (); + frustum_example (); + interval_example (); + line3_example (); + matrix22_example (); + matrix33_example (); + matrix44_example (); + plane3_example (); + quat_example (); + shear6_example (); + sphere3_example (); + vec2_example (); + vec3_example (); + vec4_example (); + half_example (); + + std::cout << "done." << std::endl; + + return 0; +} diff --git a/third_party/Imath-3.1.9/docs/fixmanpages.sh b/third_party/Imath/website/fixmanpages.sh similarity index 72% rename from third_party/Imath-3.1.9/docs/fixmanpages.sh rename to third_party/Imath/website/fixmanpages.sh index 0036179b..8bc2b3fb 100755 --- a/third_party/Imath-3.1.9/docs/fixmanpages.sh +++ b/third_party/Imath/website/fixmanpages.sh @@ -1,6 +1,9 @@ #!/bin/bash -# Fix the names of doxygen-generated man page files: +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + +# Fix the names of doxygen-generated man page Files: # * Strip "_ Vec" and "_ T _ _" from "Imath_Box_ Vec2_ T _ _.3" # * and rename "Imath_*" to "Imath::*" diff --git a/third_party/Imath-3.1.9/docs/functions.rst b/third_party/Imath/website/functions.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions.rst rename to third_party/Imath/website/functions.rst diff --git a/third_party/Imath-3.1.9/docs/functions/box.rst b/third_party/Imath/website/functions/box.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/box.rst rename to third_party/Imath/website/functions/box.rst diff --git a/third_party/Imath-3.1.9/docs/functions/color.rst b/third_party/Imath/website/functions/color.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/color.rst rename to third_party/Imath/website/functions/color.rst diff --git a/third_party/Imath-3.1.9/docs/functions/frame.rst b/third_party/Imath/website/functions/frame.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/frame.rst rename to third_party/Imath/website/functions/frame.rst diff --git a/third_party/Imath-3.1.9/docs/functions/gl.rst b/third_party/Imath/website/functions/gl.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/gl.rst rename to third_party/Imath/website/functions/gl.rst diff --git a/third_party/Imath-3.1.9/docs/functions/glu.rst b/third_party/Imath/website/functions/glu.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/glu.rst rename to third_party/Imath/website/functions/glu.rst diff --git a/third_party/Imath-3.1.9/docs/functions/line.rst b/third_party/Imath/website/functions/line.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/line.rst rename to third_party/Imath/website/functions/line.rst diff --git a/third_party/Imath-3.1.9/docs/functions/matrix.rst b/third_party/Imath/website/functions/matrix.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/matrix.rst rename to third_party/Imath/website/functions/matrix.rst diff --git a/third_party/Imath-3.1.9/docs/functions/random.rst b/third_party/Imath/website/functions/random.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/random.rst rename to third_party/Imath/website/functions/random.rst diff --git a/third_party/Imath-3.1.9/docs/functions/roots.rst b/third_party/Imath/website/functions/roots.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/roots.rst rename to third_party/Imath/website/functions/roots.rst diff --git a/third_party/Imath-3.1.9/docs/functions/vec.rst b/third_party/Imath/website/functions/vec.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/functions/vec.rst rename to third_party/Imath/website/functions/vec.rst diff --git a/third_party/Imath-3.1.9/docs/images/imath-fav.ico b/third_party/Imath/website/images/imath-fav.ico similarity index 100% rename from third_party/Imath-3.1.9/docs/images/imath-fav.ico rename to third_party/Imath/website/images/imath-fav.ico diff --git a/third_party/Imath-3.1.9/docs/images/imath-logo-black.png b/third_party/Imath/website/images/imath-logo-black.png similarity index 100% rename from third_party/Imath-3.1.9/docs/images/imath-logo-black.png rename to third_party/Imath/website/images/imath-logo-black.png diff --git a/third_party/Imath-3.1.9/docs/images/imath-logo-blue.png b/third_party/Imath/website/images/imath-logo-blue.png similarity index 100% rename from third_party/Imath-3.1.9/docs/images/imath-logo-blue.png rename to third_party/Imath/website/images/imath-logo-blue.png diff --git a/third_party/Imath-3.1.9/docs/images/imath-logo-white.png b/third_party/Imath/website/images/imath-logo-white.png similarity index 100% rename from third_party/Imath-3.1.9/docs/images/imath-logo-white.png rename to third_party/Imath/website/images/imath-logo-white.png diff --git a/third_party/Imath-3.1.9/docs/index.rst b/third_party/Imath/website/index.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/index.rst rename to third_party/Imath/website/index.rst diff --git a/third_party/Imath-3.1.9/docs/install.rst b/third_party/Imath/website/install.rst similarity index 68% rename from third_party/Imath-3.1.9/docs/install.rst rename to third_party/Imath/website/install.rst index 120153c0..36c4ceb9 100644 --- a/third_party/Imath-3.1.9/docs/install.rst +++ b/third_party/Imath/website/install.rst @@ -5,30 +5,68 @@ .. _Install: Install -======== +======= .. toctree:: :caption: Install The Imath library is available for download and installation in -binary form via package managers on many Linux distributions. See -`https://pkgs.org/download/Imath -`_ for a complete list. The common -ones that generally provide current releases include: +binary form via package managers on many Linux distributions. -* `Fedora `_ -* `Gentoo `_ -* `Ubuntu `_ +Refer to the current version of Imath on various major Linux distros at +`repology.org `_: -Beware that some distributions are out of date and only provide -distributions of outdated releases OpenEXR. We recommend against using -OpenEXR v2, and we *strongly* recommend against using OpenEXR v1. +.. image:: https://repology.org/badge/vertical-allrepos/imath.svg?exclude_unsupported=1&columns=4&header=Imath%20Packaging%20Status&minversion=3.0 + :target: https://repology.org/project/imath/versions -On macOS, we do not recommend installation via HomeBrew because the -distribution is outdated. +Older versions of Imath were distributed as a component of OpenEXR +called ``ilmbase``. We do not recommend using these outdated +versions. -Please note that ``pip install openexr`` installs the `openexrpython -`_ module, which is not +To install via ``yum`` on RHEL/CentOS: + +.. code-block:: + + % sudo yum makecache + % sudo yum install imath + +To install via ``apt-get`` on Ubuntu: + +.. code-block:: + + % sudo apt-get update + % sudo apt-get install imath + +macOS +----- + +On macOS, install via `Homebrew `_: + +.. code-block:: + + % brew install imath + +Alternatively, you can install on macOS via `MacPorts +`_: + +.. code-block:: + + % port install imath + +Windows +------- + +Install via `vcpkg `_: + +.. code-block:: + + % .\vcpkg install imath + +Python +------ + +Please note that ``pip install imath`` installs the `imath +`_ module, which is not affiliated with the OpenEXR project or the ASWF. Please direct questions there. @@ -51,7 +89,7 @@ Prerequisites Make sure these are installed on your system before building Imath: -* Imath requires CMake version 3.12 or newer +* Imath requires CMake version 3.14 or newer * C++ compiler that supports C++11 The instructions that follow describe building Imath with CMake. @@ -69,11 +107,12 @@ To build via CMake, you need to first identify three directories: libraries and headers, referred to below as ``$installdir``. To build: + .. code-block:: - $ cd $builddir - $ cmake $srcdir --install-prefix $installdir - $ cmake --build $builddir --target install --config Release + % cd $builddir + % cmake $srcdir --install-prefix $installdir + % cmake --build $builddir --target install --config Release Note that the CMake configuration prefers to apply an out-of-tree build process, since there may be multiple build configurations @@ -102,7 +141,7 @@ can specify a local install directory to cmake via the .. code-block:: - $ cmake .. -DCMAKE_INSTALL_PREFIX=$Imath_install_directory + % cmake .. -DCMAKE_INSTALL_PREFIX=$Imath_install_directory Library Names ------------- @@ -118,22 +157,36 @@ If you are building dynamic libraries, once you have configured, built, and installed the libraries, you should see the following pattern of symlinks and files in the install lib folder: +.. code-block:: + + libImath.so -> libImath.so.31 + libImath.so.$SOVERSION -> libImath.so.$SOVERSION.$RELEASE + libImath.so.$SOVERSION.$RELEASE (the shared object file) + +The ``SOVERSION`` number identifies the ABI version. Each Imath +release that changes the ABI in backwards-incompatible ways increases +this number. By policy, this changes only for major and minor +releases, never for patch releases. ``RELEASE`` is the +``MAJOR.MINOR.PATCH`` release name. For example, the resulting shared +library filename is ``libImath.so.31.3.1.10`` for Imath release +v3.1.10. This naming scheme reinforces the correspondence between the +real filename of the ``.so`` and the release it corresponds to. + +Library Suffix +~~~~~~~~~~~~~~ + +The ``IMATH_LIB_SUFFIX`` CMake option designates a suffix for the +library and appears between the library base name and the +``.so``. This defaults to encode the major and minor version, as in +``-3_1``: + .. code-block:: libImath.so -> libImath-3_1.so libImath-3_1.so -> libImath-3_1.so.30 - libImath-3_1.so.30 -> libImath-3_1.so.30.3.0 - libImath-3_1.so.30.3.0 (the shared object file) + libImath-3_1.so.30 -> libImath-3_1.so.30.3.1.10 + libImath-3_1.so.30.3.1.10 (the shared object file) -The ``-3_1`` suffix encodes the major and minor version, which can be -configured via the ``IMATH_LIB_SUFFIX`` CMake setting. The ``30`` -corresponds to the so version, or in ``libtool`` terminology the -``current`` shared object version; the `3` denotes the ``libtool`` -``revision``, and the ``0`` denotes the ``libtool`` ``age``. See the -`libtool -`_ -documentation for more details. - Porting Applications from OpenEXR v2 to v3 ------------------------------------------ @@ -141,27 +194,45 @@ See the :doc:`PortingGuide` for details about differences from previous releases and how to address them. Also refer to the porting guide for details about changes to Imath. -Building the Documentation --------------------------- +Building the Website +-------------------- The Imath technical documentation at `https://imath.readthedocs.io `_ is generated via `Sphinx `_ with the `Breathe `_ extension using information -extracted from header comments by `Doxygen `_. - -To build the documentation locally from the source headers and -``.rst`` files, set the CMake option ``BUILD_DOCS=ON``. This adds -``Doxygen`` and ``Sphinx`` CMake targets and enables building the docs -by default. generation is off by default. - -Building the documentation requires that ``sphinx``, ``breathe``, and +extracted from header comments by `Doxygen `_, +using the `sphinx-press-theme +`_, and is hosted by +`Read the Docs `_. +The website source is in `restructured text +`_ +in the ``website`` directory. + +To build the website locally from the source headers and +``.rst`` files, set the CMake option ``BUILD_WEBSITE=ON``. This adds +``website`` CMake target. Generation is off by default. + +Building the website requires that ``sphinx``, ``breathe``, and ``doxygen`` are installed. It further requires the `sphinx-press-theme -`_, as indicated in the -`requirements.txt -`_ +`_. Complete dependencies are +described in the `requirements.txt +`_ file. +On Debian/Ubuntu Linux: + +.. code-block:: + + % apt-get install doxygen python3-sphinx + % pip3 install breathe + % pip3 install sphinx_press_theme + + % mkdir _build + % cd _build + % cmake .. -DBUILD_WEBSITE=ON + % cmake --build . --target website + CMake Build-time Configuration Options -------------------------------------- @@ -171,7 +242,7 @@ variables, run: .. code-block:: - $ cmake -LAH $imath_source_directory + % cmake -LAH $imath_source_directory You can customize these options three ways: @@ -295,7 +366,7 @@ names and paths may need to be changed for your environment. More documentation: * Toolchains: https://cmake.org/cmake/help/v3.12/manual/cmake-toolchains.7.html -* Cross compiling: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/ +* Cross compiling: https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/CrossCompiling Ninja ----- @@ -306,5 +377,5 @@ initial generation: .. code-block:: - $ cmake -G “Ninja†.. + % cmake -G “Ninja†.. diff --git a/third_party/Imath-3.1.9/docs/license.rst b/third_party/Imath/website/license.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/license.rst rename to third_party/Imath/website/license.rst diff --git a/third_party/Imath/website/requirements.txt b/third_party/Imath/website/requirements.txt new file mode 100644 index 00000000..15e95b51 --- /dev/null +++ b/third_party/Imath/website/requirements.txt @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + +sphinx == 7.2.6 +breathe +sphinx-press-theme diff --git a/third_party/Imath-3.1.9/docs/toc_redirect.rst b/third_party/Imath/website/toc_redirect.rst similarity index 100% rename from third_party/Imath-3.1.9/docs/toc_redirect.rst rename to third_party/Imath/website/toc_redirect.rst diff --git a/third_party/abseil-cpp/.gitignore b/third_party/abseil-cpp/.gitignore index d54fa5a9..3a729f41 100644 --- a/third_party/abseil-cpp/.gitignore +++ b/third_party/abseil-cpp/.gitignore @@ -1,3 +1,5 @@ +# Bzlmod lockfile +MODULE.bazel.lock # Ignore all bazel-* symlinks. /bazel-* # Ignore Bazel verbose explanations diff --git a/third_party/abseil-cpp/BUILD.bazel b/third_party/abseil-cpp/BUILD.bazel index 79fb0ecd..03122a95 100644 --- a/third_party/abseil-cpp/BUILD.bazel +++ b/third_party/abseil-cpp/BUILD.bazel @@ -1,4 +1,3 @@ -# # Copyright 2020 The Abseil Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,3 +22,14 @@ exports_files([ "AUTHORS", "LICENSE", ]) + +# For building with clang-cl. +# https://bazel.build/configure/windows#clang +platform( + name = "x64_windows-clang-cl", + constraint_values = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + "@bazel_tools//tools/cpp:clang-cl", + ], +) diff --git a/third_party/abseil-cpp/CMake/AbseilDll.cmake b/third_party/abseil-cpp/CMake/AbseilDll.cmake index 7f030250..47f3beeb 100644 --- a/third_party/abseil-cpp/CMake/AbseilDll.cmake +++ b/third_party/abseil-cpp/CMake/AbseilDll.cmake @@ -311,6 +311,7 @@ set(ABSL_INTERNAL_DLL_FILES "strings/internal/string_constant.h" "strings/internal/stringify_sink.h" "strings/internal/stringify_sink.cc" + "strings/internal/has_absl_stringify.h" "strings/has_absl_stringify.h" "strings/has_ostream_operator.h" "strings/match.cc" @@ -626,17 +627,32 @@ include(CheckCXXSourceCompiles) check_cxx_source_compiles( [==[ #ifdef _MSC_VER -# if _MSVC_LANG < 201700L +# if _MSVC_LANG < 201703L # error "The compiler defaults or is configured for C++ < 17" # endif -#elif __cplusplus < 201700L +#elif __cplusplus < 201703L # error "The compiler defaults or is configured for C++ < 17" #endif int main() { return 0; } ]==] ABSL_INTERNAL_AT_LEAST_CXX17) -if(ABSL_INTERNAL_AT_LEAST_CXX17) +check_cxx_source_compiles( + [==[ +#ifdef _MSC_VER +# if _MSVC_LANG < 202002L +# error "The compiler defaults or is configured for C++ < 20" +# endif +#elif __cplusplus < 202002L +# error "The compiler defaults or is configured for C++ < 20" +#endif +int main() { return 0; } +]==] + ABSL_INTERNAL_AT_LEAST_CXX20) + +if(ABSL_INTERNAL_AT_LEAST_CXX20) + set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20) +elseif(ABSL_INTERNAL_AT_LEAST_CXX17) set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17) else() set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14) @@ -806,8 +822,8 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") if(ABSL_PROPAGATE_CXX_STD) # Abseil libraries require C++14 as the current minimum standard. When - # compiled with C++17 (either because it is the compiler's default or - # explicitly requested), then Abseil requires C++17. + # compiled with a higher minimum (either because it is the compiler's + # default or explicitly requested), then Abseil requires that standard. target_compile_features(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE}) endif() diff --git a/third_party/abseil-cpp/CMake/AbseilHelpers.cmake b/third_party/abseil-cpp/CMake/AbseilHelpers.cmake index 5a6c57fd..44f5bb3f 100644 --- a/third_party/abseil-cpp/CMake/AbseilHelpers.cmake +++ b/third_party/abseil-cpp/CMake/AbseilHelpers.cmake @@ -80,7 +80,7 @@ endif() # absl::fantastic_lib # ) # -# TODO: Implement "ALWAYSLINK" +# TODO(b/320467376): Implement "ALWAYSLINK". function(absl_cc_library) cmake_parse_arguments(ABSL_CC_LIB "DISABLE_INSTALL;PUBLIC;TESTONLY" @@ -186,8 +186,16 @@ function(absl_cc_library) endif() endif() endforeach() + set(skip_next_cflag OFF) foreach(cflag ${ABSL_CC_LIB_COPTS}) - if(${cflag} MATCHES "^(-Wno|/wd)") + if(skip_next_cflag) + set(skip_next_cflag OFF) + elseif(${cflag} MATCHES "^-Xarch_") + # An -Xarch_ flag implies that its successor only applies to the + # specified platform. Filter both of them out before the successor + # reaches the "^-m" filter. + set(skip_next_cflag ON) + elseif(${cflag} MATCHES "^(-Wno|/wd)") # These flags are needed to suppress warnings that might fire in our headers. set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") elseif(${cflag} MATCHES "^(-W|/w[1234eo])") @@ -287,8 +295,8 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") if(ABSL_PROPAGATE_CXX_STD) # Abseil libraries require C++14 as the current minimum standard. When - # compiled with C++17 (either because it is the compiler's default or - # explicitly requested), then Abseil requires C++17. + # compiled with a higher standard (either because it is the compiler's + # default or explicitly requested), then Abseil requires that standard. target_compile_features(${_NAME} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE}) endif() diff --git a/third_party/abseil-cpp/CMakeLists.txt b/third_party/abseil-cpp/CMakeLists.txt index ca74b80d..87f8ae82 100644 --- a/third_party/abseil-cpp/CMakeLists.txt +++ b/third_party/abseil-cpp/CMakeLists.txt @@ -236,20 +236,41 @@ if(ABSL_ENABLE_INSTALL) PATTERN "testdata" EXCLUDE ) + # Rewrite options.h to use the compiled ABI. file(READ "absl/base/options.h" ABSL_INTERNAL_OPTIONS_H_CONTENTS) - if (ABSL_INTERNAL_AT_LEAST_CXX17) - string(REGEX REPLACE - "#define ABSL_OPTION_USE_STD_([^ ]*) 2" - "#define ABSL_OPTION_USE_STD_\\1 1" + + # Handle features that require at least C++20. + if (ABSL_INTERNAL_AT_LEAST_CXX20) + foreach(FEATURE "ORDERING") + string(REPLACE + "#define ABSL_OPTION_USE_STD_${FEATURE} 2" + "#define ABSL_OPTION_USE_STD_${FEATURE} 1" ABSL_INTERNAL_OPTIONS_H_PINNED "${ABSL_INTERNAL_OPTIONS_H_CONTENTS}") - else() - string(REGEX REPLACE - "#define ABSL_OPTION_USE_STD_([^ ]*) 2" - "#define ABSL_OPTION_USE_STD_\\1 0" + set(ABSL_INTERNAL_OPTIONS_H_CONTENTS "${ABSL_INTERNAL_OPTIONS_H_PINNED}") + endforeach() + endif() + + # Handle features that require at least C++17. + if (ABSL_INTERNAL_AT_LEAST_CXX17) + foreach(FEATURE "ANY" "OPTIONAL" "STRING_VIEW" "VARIANT") + string(REPLACE + "#define ABSL_OPTION_USE_STD_${FEATURE} 2" + "#define ABSL_OPTION_USE_STD_${FEATURE} 1" ABSL_INTERNAL_OPTIONS_H_PINNED "${ABSL_INTERNAL_OPTIONS_H_CONTENTS}") + set(ABSL_INTERNAL_OPTIONS_H_CONTENTS "${ABSL_INTERNAL_OPTIONS_H_PINNED}") + endforeach() endif() + + # Any feature that still has the value of 2 (because it was not handled above) + # should be set to 0. + string(REGEX REPLACE + "#define ABSL_OPTION_USE_STD_([^ ]*) 2" + "#define ABSL_OPTION_USE_STD_\\1 0" + ABSL_INTERNAL_OPTIONS_H_PINNED + "${ABSL_INTERNAL_OPTIONS_H_CONTENTS}") + file(WRITE "${CMAKE_BINARY_DIR}/options-pinned.h" "${ABSL_INTERNAL_OPTIONS_H_PINNED}") install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h" diff --git a/third_party/abseil-cpp/MODULE.bazel b/third_party/abseil-cpp/MODULE.bazel new file mode 100644 index 00000000..fc1534a7 --- /dev/null +++ b/third_party/abseil-cpp/MODULE.bazel @@ -0,0 +1,42 @@ +# Copyright 2024 The Abseil Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# https://bazel.build/external/overview#bzlmod + +module( + name = "abseil-cpp", + version = "head", + compatibility_level = 1, +) + +cc_configure = use_extension("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_configure_extension") +use_repo(cc_configure, "local_config_cc") + +# Only direct dependencies need to be listed below. +# Please keep the versions in sync with the versions in the WORKSPACE file. + +bazel_dep(name = "bazel_skylib", + version = "1.5.0") + +bazel_dep(name = "google_benchmark", + version = "1.8.3", + repo_name = "com_github_google_benchmark", + dev_dependency = True) + +bazel_dep(name = "googletest", + version = "1.14.0.bcr.1", + repo_name = "com_google_googletest") + +bazel_dep(name = "platforms", + version = "0.0.8") diff --git a/third_party/abseil-cpp/PrivacyInfo.xcprivacy b/third_party/abseil-cpp/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..3ff4a9d9 --- /dev/null +++ b/third_party/abseil-cpp/PrivacyInfo.xcprivacy @@ -0,0 +1,14 @@ + + + + + NSPrivacyTracking + + NSPrivacyCollectedDataTypes + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + + diff --git a/third_party/abseil-cpp/WORKSPACE b/third_party/abseil-cpp/WORKSPACE index ffe387a3..0d886091 100644 --- a/third_party/abseil-cpp/WORKSPACE +++ b/third_party/abseil-cpp/WORKSPACE @@ -20,42 +20,40 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # GoogleTest/GoogleMock framework. Used by most unit-tests. http_archive( - name = "com_google_googletest", # 2023-10-05T21:13:04Z - sha256 = "ba96972e0aa8a1428596570ac573958c1c879483bd148a2b72994453f9dfa7c2", - strip_prefix = "googletest-2dd1c131950043a8ad5ab0d2dda0e0970596586a", + name = "com_google_googletest", + sha256 = "8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7", + strip_prefix = "googletest-1.14.0", # Keep this URL in sync with ABSL_GOOGLETEST_COMMIT in ci/cmake_common.sh and # ci/windows_msvc_cmake.bat. - urls = ["https://github.com/google/googletest/archive/2dd1c131950043a8ad5ab0d2dda0e0970596586a.zip"], + urls = ["https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz"], ) # RE2 (the regular expression library used by GoogleTest) http_archive( - name = "com_googlesource_code_re2", # 2023-03-17T11:36:51Z - sha256 = "cb8b5312a65f2598954545a76e8bce913f35fbb3a21a5c88797a4448e9f9b9d9", - strip_prefix = "re2-578843a516fd1da7084ae46209a75f3613b6065e", - urls = ["https://github.com/google/re2/archive/578843a516fd1da7084ae46209a75f3613b6065e.zip"], + name = "com_googlesource_code_re2", + sha256 = "828341ad08524618a626167bd320b0c2acc97bd1c28eff693a9ea33a7ed2a85f", + strip_prefix = "re2-2023-11-01", + urls = ["https://github.com/google/re2/releases/download/2023-11-01/re2-2023-11-01.zip"], ) # Google benchmark. http_archive( - name = "com_github_google_benchmark", # 2023-08-01T07:47:09Z - sha256 = "db1e39ee71dc38aa7e57ed007f2c8b3bb59e13656435974781a9dc0617d75cc9", - strip_prefix = "benchmark-02a354f3f323ae8256948e1dc77ddcb1dfc297da", - urls = ["https://github.com/google/benchmark/archive/02a354f3f323ae8256948e1dc77ddcb1dfc297da.zip"], + name = "com_github_google_benchmark", + sha256 = "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce", + strip_prefix = "benchmark-1.8.3", + urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz"], ) # Bazel Skylib. http_archive( - name = "bazel_skylib", # 2023-05-31T19:24:07Z - sha256 = "08c0386f45821ce246bbbf77503c973246ed6ee5c3463e41efc197fa9bc3a7f4", - strip_prefix = "bazel-skylib-288731ef9f7f688932bd50e704a91a45ec185f9b", - urls = ["https://github.com/bazelbuild/bazel-skylib/archive/288731ef9f7f688932bd50e704a91a45ec185f9b.zip"], + name = "bazel_skylib", + sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94", + urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"], ) # Bazel platform rules. http_archive( - name = "platforms", # 2023-07-28T19:44:27Z - sha256 = "40eb313613ff00a5c03eed20aba58890046f4d38dec7344f00bb9a8867853526", - strip_prefix = "platforms-4ad40ef271da8176d4fc0194d2089b8a76e19d7b", - urls = ["https://github.com/bazelbuild/platforms/archive/4ad40ef271da8176d4fc0194d2089b8a76e19d7b.zip"], + name = "platforms", + sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74", + urls = ["https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz"], ) diff --git a/third_party/bazel-toolchain-0.8/toolchain/aliases.bzl b/third_party/abseil-cpp/WORKSPACE.bzlmod similarity index 58% rename from third_party/bazel-toolchain-0.8/toolchain/aliases.bzl rename to third_party/abseil-cpp/WORKSPACE.bzlmod index 86bf8ac7..83e67baa 100644 --- a/third_party/bazel-toolchain-0.8/toolchain/aliases.bzl +++ b/third_party/abseil-cpp/WORKSPACE.bzlmod @@ -1,10 +1,10 @@ -# Copyright 2022 The Bazel Authors. +# Copyright 2024 The Abseil Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -12,14 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Files that will be made available as convenience targets under the bazel -# toolchain repository. - -aliased_libs = [ - "omp", -] - -aliased_tools = [ - "clang-format", - "llvm-cov", -] +# https://bazel.build/external/migration#workspace.bzlmod +# +# This file is intentionally empty. When bzlmod is enabled and this +# file exists, the contents of WORKSPACE is ignored. This prevents +# bzlmod builds from unintentionally depending on the WORKSPACE file. diff --git a/third_party/abseil-cpp/absl/abseil.podspec.gen.py b/third_party/abseil-cpp/absl/abseil.podspec.gen.py index 63752980..cbf7cb42 100755 --- a/third_party/abseil-cpp/absl/abseil.podspec.gen.py +++ b/third_party/abseil-cpp/absl/abseil.podspec.gen.py @@ -30,6 +30,9 @@ :git => 'https://github.com/abseil/abseil-cpp.git', :tag => '${tag}', } + s.resource_bundles = { + s.module_name => 'PrivacyInfo.xcprivacy', + } s.module_name = 'absl' s.header_mappings_dir = 'absl' s.header_dir = 'absl' @@ -41,9 +44,14 @@ 'ALWAYS_SEARCH_USER_PATHS' => 'NO', } s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.10' + s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.watchos.deployment_target = '2.0' + s.subspec 'xcprivacy' do |ss| + ss.resource_bundles = { + ss.module_name => 'PrivacyInfo.xcprivacy', + } + end """ # Rule object representing the rule of Bazel BUILD. @@ -188,6 +196,12 @@ def write_podspec_rule(f, rule, depth): name = get_spec_name(dep.replace(":", "/")) f.write("{indent}{var}.dependency '{dep}'\n".format( indent=indent, var=spec_var, dep=name)) + # Writes dependency to xcprivacy + f.write( + "{indent}{var}.dependency '{dep}'\n".format( + indent=indent, var=spec_var, dep="abseil/xcprivacy" + ) + ) def write_indented_list(f, leading, values): diff --git a/third_party/abseil-cpp/absl/base/BUILD.bazel b/third_party/abseil-cpp/absl/base/BUILD.bazel index 0eb735da..f0e3e63f 100644 --- a/third_party/abseil-cpp/absl/base/BUILD.bazel +++ b/third_party/abseil-cpp/absl/base/BUILD.bazel @@ -74,7 +74,10 @@ cc_library( hdrs = ["no_destructor.h"], copts = ABSL_DEFAULT_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [":config"], + deps = [ + ":config", + ":nullability", + ], ) cc_library( @@ -294,7 +297,7 @@ cc_library( cc_library( name = "atomic_hook_test_helper", - testonly = 1, + testonly = True, srcs = ["internal/atomic_hook_test_helper.cc"], hdrs = ["internal/atomic_hook_test_helper.h"], copts = ABSL_DEFAULT_COPTS, @@ -380,7 +383,7 @@ cc_test( cc_library( name = "exception_testing", - testonly = 1, + testonly = True, hdrs = ["internal/exception_testing.h"], copts = ABSL_TEST_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, @@ -404,7 +407,7 @@ cc_library( cc_library( name = "exception_safety_testing", - testonly = 1, + testonly = True, srcs = ["internal/exception_safety_testing.cc"], hdrs = ["internal/exception_safety_testing.h"], copts = ABSL_TEST_COPTS, @@ -470,7 +473,7 @@ cc_test( # AbslInternalSpinLockDelay and AbslInternalSpinLockWake. cc_library( name = "spinlock_test_common", - testonly = 1, + testonly = True, srcs = ["spinlock_test_common.cc"], copts = ABSL_TEST_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, @@ -507,7 +510,7 @@ cc_test( cc_library( name = "spinlock_benchmark_common", - testonly = 1, + testonly = True, srcs = ["internal/spinlock_benchmark.cc"], copts = ABSL_TEST_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, @@ -527,7 +530,7 @@ cc_library( cc_binary( name = "spinlock_benchmark", - testonly = 1, + testonly = True, copts = ABSL_DEFAULT_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, tags = ["benchmark"], @@ -608,7 +611,7 @@ cc_test( cc_binary( name = "no_destructor_benchmark", - testonly = 1, + testonly = True, srcs = ["no_destructor_benchmark.cc"], copts = ABSL_TEST_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, @@ -710,7 +713,7 @@ cc_test( cc_library( name = "scoped_set_env", - testonly = 1, + testonly = True, srcs = ["internal/scoped_set_env.cc"], hdrs = ["internal/scoped_set_env.h"], linkopts = ABSL_DEFAULT_LINKOPTS, @@ -784,7 +787,7 @@ cc_test( cc_binary( name = "strerror_benchmark", - testonly = 1, + testonly = True, srcs = ["internal/strerror_benchmark.cc"], copts = ABSL_TEST_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, diff --git a/third_party/abseil-cpp/absl/base/CMakeLists.txt b/third_party/abseil-cpp/absl/base/CMakeLists.txt index 4cfc2285..09c622ab 100644 --- a/third_party/abseil-cpp/absl/base/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/base/CMakeLists.txt @@ -62,6 +62,7 @@ absl_cc_library( "no_destructor.h" DEPS absl::config + absl::nullability COPTS ${ABSL_DEFAULT_COPTS} ) diff --git a/third_party/abseil-cpp/absl/base/attributes.h b/third_party/abseil-cpp/absl/base/attributes.h index f21dcb3c..a6c40a76 100644 --- a/third_party/abseil-cpp/absl/base/attributes.h +++ b/third_party/abseil-cpp/absl/base/attributes.h @@ -702,6 +702,11 @@ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") #define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING \ _Pragma("GCC diagnostic pop") +#elif defined(_MSC_VER) +#define ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING \ + _Pragma("warning(push)") _Pragma("warning(disable: 4996)") +#define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING \ + _Pragma("warning(pop)") #else #define ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING #define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING @@ -843,15 +848,11 @@ // See also the upstream documentation: // https://clang.llvm.org/docs/AttributeReference.html#trivial-abi // -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::trivial_abi) -#define ABSL_ATTRIBUTE_TRIVIAL_ABI [[clang::trivial_abi]] -#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1 -#elif ABSL_HAVE_ATTRIBUTE(trivial_abi) -#define ABSL_ATTRIBUTE_TRIVIAL_ABI __attribute__((trivial_abi)) -#define ABSL_HAVE_ATTRIBUTE_TRIVIAL_ABI 1 -#else +// b/321691395 - This is currently disabled in open-source builds since +// compiler support differs. If system libraries compiled with GCC are mixed +// with libraries compiled with Clang, types will have different ideas about +// their ABI, leading to hard to debug crashes. #define ABSL_ATTRIBUTE_TRIVIAL_ABI -#endif // ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS // @@ -875,4 +876,51 @@ #define ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS #endif +// ABSL_ATTRIBUTE_UNINITIALIZED +// +// GCC and Clang support a flag `-ftrivial-auto-var-init=