-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.h
More file actions
30 lines (30 loc) · 1.41 KB
/
Copy pathutil.h
File metadata and controls
30 lines (30 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
#ifndef UTIL_H
#define UTIL_H
#include <cstddef>
#include <map>
#include <set>
#include <string>
#include <vector>
double distance(std::vector<double> p0, std::vector<double> p1);
double distance(std::vector<std::vector<double>> p);
bool NanString(const char *buffer, size_t len);
void OutGeo(std::string filename, std::vector<std::vector<double>> outerbox,
std::vector<std::vector<std::vector<double>>> innerbnd);
std::vector<double> intersect(std::vector<double> p0, std::vector<double> n0,
std::vector<double> p1, std::vector<double> n1);
std::vector<double> AddVect(const double a1, const std::vector<double> &a,
const double b1, const std::vector<double> &b);
std::vector<double> GetBoundingBox(std::vector<std::vector<double>> &pts);
int findNlayers(double h, double q, double R, double m);
void FindTreesDepths(int root, int lroot, std::map<int, std::set<int>> &trees,
std::vector<int> &levels);
void BuildTopoTree(std::vector<std::vector<std::vector<double>>> &pts,
std::map<int, std::set<int>> &trees, std::set<int> &roots);
int FindRelationByBoundBox(
std::vector<double> &box0,
std::vector<double>
&box1); // 1, 0 contains 1; -1, 1 contains 0; 0 overlap; 2, no contact.
void parserDouble(const char *cstr, std::vector<double> &value);
void parserUInt(const char *cstr, std::vector<int> &value);
#endif