GithubHelp home page GithubHelp logo

Comments (2)

mtao avatar mtao commented on July 18, 2024

Subsequent issues:

from wildmeshing-toolkit.

mtao avatar mtao commented on July 18, 2024

@daniel-zint to continue the discussion in
#369 (comment)
and
#369 (comment)

My main issue here is that currently the validity of SimplexCollection::get_union() and SimplexCollection::get_intersection() are completely ambiguous, as they both depend on std::set_union and std:::set_intersection, which REQUIRE their input ranges are sorted.
see:

  1. Add a flag to SimplexCollection for whether it is sorted and branch between different algorithms if the input is not sorted
  2. Add assertions / checks for sortedness of SimplexCollection
  3. guarantee that a SimplexCollection is always sorted

I much prefer the last option, and I think that there is an easy semantic choice that enables your performance worries AND this semantic:

  1. Functions that return a std::vector<Simplex> do not have a guarantee of being sorted
  2. Functions that return a SimplexCollection are sorted

The inclusion of a mesh-like object in SimplexCollection is therefore:

struct SimplexCollection {
  public:
    SimplexCollection(const Mesh& mesh, std::vector<Simplex>&& simplices): m_complex(mesh), m_simplices(std::move(simplices)) {}
  private:
  std::vector<Simplex> m_simplices;
  SimplicialComplex m_complex;
  protected:
  void fix_state(); // uses m_complex to sort and unique
};

where

struct SimplicialComplex {
bool less_than(const Simplex&, const Simplex&) const;
bool equal(const Simplex&, const Simplex&) const;
SimplexLessThanFunctor less_than_functor() const;
SimplexEqualFunctor equal_functor() const;
private:
const Mesh& m_mesh;
};

In this case SimplicialComplex is more like a "view" of a Mesh to utilize simplex-specific tools

from wildmeshing-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.