aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/contourpy/src/chunk_local.cpp
diff options
context:
space:
mode:
authorshumkovnd <shumkovnd@yandex-team.com>2023-11-10 14:39:34 +0300
committershumkovnd <shumkovnd@yandex-team.com>2023-11-10 16:42:24 +0300
commit77eb2d3fdcec5c978c64e025ced2764c57c00285 (patch)
treec51edb0748ca8d4a08d7c7323312c27ba1a8b79a /contrib/python/contourpy/src/chunk_local.cpp
parentdd6d20cadb65582270ac23f4b3b14ae189704b9d (diff)
downloadydb-77eb2d3fdcec5c978c64e025ced2764c57c00285.tar.gz
KIKIMR-19287: add task_stats_drawing script
Diffstat (limited to 'contrib/python/contourpy/src/chunk_local.cpp')
-rw-r--r--contrib/python/contourpy/src/chunk_local.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/contrib/python/contourpy/src/chunk_local.cpp b/contrib/python/contourpy/src/chunk_local.cpp
new file mode 100644
index 0000000000..1c8833ab0b
--- /dev/null
+++ b/contrib/python/contourpy/src/chunk_local.cpp
@@ -0,0 +1,59 @@
+#include "chunk_local.h"
+#include <iostream>
+#include <limits>
+
+namespace contourpy {
+
+ChunkLocal::ChunkLocal()
+{
+ look_up_quads.reserve(100);
+ clear();
+}
+
+void ChunkLocal::clear()
+{
+ chunk = -1;
+ istart = iend = jstart = jend = -1;
+ pass = -1;
+
+ total_point_count = 0;
+ line_count = 0;
+ hole_count = 0;
+
+ points.clear();
+ line_offsets.clear();
+ outer_offsets.clear();
+
+ look_up_quads.clear();
+}
+
+std::ostream &operator<<(std::ostream &os, const ChunkLocal& local)
+{
+ os << "ChunkLocal:"
+ << " chunk=" << local.chunk
+ << " istart=" << local.istart
+ << " iend=" << local.iend
+ << " jstart=" << local.jstart
+ << " jend=" << local.jend
+ << " total_point_count=" << local.total_point_count
+ << " line_count=" << local.line_count
+ << " hole_count=" << local.hole_count;
+
+ if (local.line_offsets.start != nullptr) {
+ os << " line_offsets=";
+ for (count_t i = 0; i < local.line_count + 1; ++i) {
+ os << local.line_offsets.start[i] << " ";
+ }
+ }
+
+ if (local.outer_offsets.start != nullptr) {
+ os << " outer_offsets=";
+ for (count_t i = 0; i < local.line_count - local.hole_count + 1; ++i) {
+ os << local.outer_offsets.start[i] << " ";
+ }
+ }
+
+ return os;
+}
+
+} // namespace contourpy