TTK
Loading...
Searching...
No Matches
MergeTreePrincipalGeodesicsBase.cpp
Go to the documentation of this file.
2
3// other includes
4#include <Geometry.h>
5#include <vector>
6
7namespace ttk {
8 // ----------------------------------------------------------------------------
9 // Vector Utils
10 // ----------------------------------------------------------------------------
12 std::vector<std::vector<double>> &vS,
13 std::vector<double> &v,
14 std::vector<double> &newV) {
15 std::vector<std::vector<double>> allVs = vS, uS;
16 allVs.push_back(v);
18 newV = uS[uS.size() - 1];
19 }
20
21 void
23 double *&pVec) {
24 pVec = vec.data();
25 }
26
28 std::vector<std::vector<double>> &vec, std::vector<double *> &pVec) {
29 pVec.resize(vec.size());
30 for(unsigned int i = 0; i < vec.size(); ++i)
31 vectorToPointer(vec[i], pVec[i]);
32 }
33
35 std::vector<std::vector<std::vector<double>>> &vS,
36 std::vector<std::vector<double *>> &pVS) {
37 pVS.resize(vS.size());
38 for(unsigned int i = 0; i < vS.size(); ++i)
39 vectorsToPointers(vS[i], pVS[i]);
40 }
41
43 double *pVec, size_t size, std::vector<double> &vec) {
44 vec.resize(size);
45 for(unsigned int i = 0; i < size; ++i)
46 vec[i] = pVec[i];
47 }
48
50 std::vector<double *> &pVec,
51 std::vector<size_t> sizes,
52 std::vector<std::vector<double>> &vec) {
53 vec.resize(pVec.size());
54 for(unsigned int i = 0; i < pVec.size(); ++i)
55 pointerToVector(pVec[i], sizes[i], vec[i]);
56 }
57
59 std::vector<double *> &pVec,
60 size_t size,
61 std::vector<std::vector<double>> &vec) {
62 std::vector<size_t> sizes(pVec.size(), size);
63 pointersToVectors(pVec, sizes, vec);
64 }
65} // namespace ttk
void vectorToPointer(std::vector< double > &vec, double *&pVec)
void pointersToVectors(std::vector< double * > &pVec, std::vector< size_t > sizes, std::vector< std::vector< double > > &vec)
void vectorsToPointers(std::vector< std::vector< double > > &vec, std::vector< double * > &pVec)
void pointerToVector(double *pVec, size_t size, std::vector< double > &vec)
void vectorOfVectorsToPointers(std::vector< std::vector< std::vector< double > > > &vS, std::vector< std::vector< double * > > &pVS)
void callGramSchmidt(std::vector< std::vector< double > > &vS, std::vector< double > &v, std::vector< double > &newV)
void gramSchmidt(const std::vector< std::vector< T > > &a, std::vector< std::vector< T > > &out)
Definition: Geometry.cpp:629
The Topology ToolKit.