]> git.tdb.fi Git - libs/math.git/commitdiff
Use vector and deque instead of list
authorMikko Rasa <tdb@tdb.fi>
Sun, 26 Jan 2025 10:21:59 +0000 (12:21 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 26 Jan 2025 10:21:59 +0000 (12:21 +0200)
source/geometry/loader.h
source/geometry/shape.h

index c3774b74f88b4b0a81d8dab3c0f82efe75811bbb..bcb5a90531ebd516f866d8b7a8ddb297b65ed7ca 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef MSP_GEOMETRY_LOADER_H_
 #define MSP_GEOMETRY_LOADER_H_
 
-#include <list>
+#include <vector>
 #include <msp/datafile/loader.h>
 #include "extrudedshape.h"
 #include "halfspace.h"
@@ -21,7 +21,7 @@ class DimensionIndependentLoader: public DataFile::Loader
 {
 protected:
        bool single = true;
-       std::list<std::unique_ptr<Shape<T, D>>> shapes;
+       std::vector<std::unique_ptr<Shape<T, D>>> shapes;
 
        DimensionIndependentLoader(bool = true);
 
index bd90ba62eca800f6a69f7b5b5802e5f82e36049b..91d622b11328bf06f02d0d4b3910834631687634 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef MSP_GEOMETRY_SHAPE_H_
 #define MSP_GEOMETRY_SHAPE_H_
 
-#include <list>
+#include <deque>
 #include <memory>
 #include <vector>
 #include <msp/linal/vector.h>
@@ -73,7 +73,7 @@ inline BoundingBox<T, D> Shape<T, D>::bisect_axis_aligned_bounding_box(unsigned
                throw std::invalid_argument("Shape::bisect_axis_aligned_bounding_box");
 
        // Form the root cell from the loosest approximation of a bounding box.
-       std::list<CoverageCell> queue;
+       std::deque<CoverageCell> queue;
        queue.push_back(CoverageCell());
        CoverageCell &root = queue.front();
        root.level = 0;