From 52a71a5f7649cb67ca8c54dd7f0980dd21644f40 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Mon, 12 Dec 2022 20:03:17 +0100 Subject: [PATCH] Table from FlatTable --- libsrc/core/table.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libsrc/core/table.hpp b/libsrc/core/table.hpp index 701e8a2f..6aa4e66a 100644 --- a/libsrc/core/table.hpp +++ b/libsrc/core/table.hpp @@ -143,6 +143,21 @@ namespace ngcore data = new T[cnt]; } + explicit NETGEN_INLINE Table (const FlatTable & tab2) + : FlatTable(0, nullptr, nullptr) + { + size = tab2.Size(); + + index = new size_t[size+1]; + for (size_t i = 0; i <= size; i++) + index[i] = tab2.index[i]; + + size_t cnt = index[size]; + data = new T[cnt]; + for (size_t i = 0; i < cnt; i++) + data[i] = tab2.data[i]; + } + explicit NETGEN_INLINE Table (const Table & tab2) : FlatTable(0, nullptr, nullptr) {