RSMesh 1.0.0
一个曲面重构的系统,输入为点云,输出为obj,stl等主流格式的网格文件,使用的方法为径向基函数插值,采取了并行优化、Intel-MKL等优化措施,支持百万级别的点云
载入中...
搜索中...
未找到
fold.h
1//
2// Created by RainSure on 2023/10/26.
3//
4
5#ifndef RSMESH_FOLD_H
6#define RSMESH_FOLD_H
7
8#include <utility>
9
10namespace rsmesh {
11 namespace common {
12
13 template<class BinaryFunction, class T>
14 auto fold_left(BinaryFunction f, const T& init) {
15 return init;
16 }
17 template<class BinaryFunction, class T1, class T2, class... Ts>
18 auto fold_left(BinaryFunction f, T1&& x1, T2&& x2, Ts&&... xs) {
19 return fold_left(f, f(std::forward<T1>(x1), std::forward<T2>(x2)), std::forward<Ts>(xs)...);
20 }
21
22 template<class BinaryFunction, class T>
23 auto fold_right(BinaryFunction f, const T& init) {
24 return init;
25 }
26
27 template<class BinaryFunction, class T1, class T2, class... Ts>
28 auto fold_right(BinaryFunction f, T1&& x1, T2&& x2, Ts&&... xs) {
29 return f(std::forward<T1>(x1), fold_right(f, std::forward<T2>(x2), std::forward<Ts>(xs)...));
30 }
31 } // common
32} // rsmesh
33
34
35#endif //RSMESH_FOLD_H
本系统的主命名空间,包含了common, examples, fmm, geometry, numeric, point_cloud等子命名空间