Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/quadriflow/src/adjacent-matrix.hpp')
-rw-r--r--extern/quadriflow/src/adjacent-matrix.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/extern/quadriflow/src/adjacent-matrix.hpp b/extern/quadriflow/src/adjacent-matrix.hpp
new file mode 100644
index 00000000000..e3eb2e12a47
--- /dev/null
+++ b/extern/quadriflow/src/adjacent-matrix.hpp
@@ -0,0 +1,37 @@
+#ifndef ADJACENT_MATRIX_H_
+#define ADJACENT_MATRIX_H_
+
+#include <vector>
+
+namespace qflow {
+
+struct Link
+{
+ Link(){}
+ Link(int _id, double _w = 1)
+ : id(_id), weight(_w)
+ {}
+ inline bool operator<(const Link &link) const { return id < link.id; }
+ int id;
+ double weight;
+};
+
+struct TaggedLink {
+ int id;
+ unsigned char flag;
+ TaggedLink(){}
+ TaggedLink(int id) : id(id), flag(0) { }
+ bool used() const { return flag & 1; }
+ void markUsed() { flag |= 1; }
+ TaggedLink& operator=(const Link& l) {
+ flag = 0;
+ id = l.id;
+ return *this;
+ }
+};
+
+typedef std::vector<std::vector<Link> > AdjacentMatrix;
+
+} // namespace qflow
+
+#endif \ No newline at end of file