Download data/SHAPY/mesh-mesh-intersection/include/math_utils.hpp from duyle2408/SMPLer-X: direct link, hf CLI and curl.
- Browser
- Download file 1.8 kB
-
https://huggingface.co/duyle2408/SMPLer-X/resolve/main/data/SHAPY/mesh-mesh-intersection/include/math_utils.hpp
- Command line
-
hf download hf://duyle2408/SMPLer-X/data/SHAPY/mesh-mesh-intersection/include/math_utils.hpp
-
curl -L -o math_utils.hpp https://huggingface.co/duyle2408/SMPLer-X/resolve/main/data/SHAPY/mesh-mesh-intersection/include/math_utils.hpp
1.8 kB
| /* | |
| * Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is | |
| * holder of all proprietary rights on this computer program. | |
| * You can only use this computer program if you have closed | |
| * a license agreement with MPG or you get the right to use the computer | |
| * program from someone who is authorized to grant you that right. | |
| * Any use of the computer program without a valid license is prohibited and | |
| * liable to prosecution. | |
| * | |
| * Copyright©2019 Max-Planck-Gesellschaft zur Förderung | |
| * der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute | |
| * for Intelligent Systems. All rights reserved. | |
| * | |
| * @author Vasileios Choutas | |
| * Contact: vassilis.choutas@tuebingen.mpg.de | |
| * Contact: ps-license@tuebingen.mpg.de | |
| * | |
| */ | |
| template <typename T> | |
| __host__ __device__ T sign(T x) { | |
| return x > 0 ? 1 : (x < 0 ? -1 : 0); | |
| } | |
| template <typename T> | |
| __host__ __device__ __forceinline__ float vec_abs_diff(const vec3<T> &vec1, | |
| const vec3<T> &vec2) { | |
| return fabs(vec1.x - vec2.x) + fabs(vec1.y - vec2.y) + fabs(vec1.z - vec2.z); | |
| } | |
| template <typename T> | |
| __host__ __device__ __forceinline__ float vec_sq_diff(const vec3<T> &vec1, | |
| const vec3<T> &vec2) { | |
| return dot(vec1 - vec2, vec1 - vec2); | |
| } | |
| template <typename T> | |
| __host__ __device__ __forceinline__ T clamp(T value, T min_value, T max_value) { | |
| return min(max(value, min_value), max_value); | |
| } | |
| template <typename T> __host__ __device__ T dot2(vec3<T> v) { | |
| return dot(v, v); | |
| } | |