adeeconometrics / LazyMat

Experimenting with Generic Lazy Matrix implementation in Cpp
https://adeeconometrics.github.io/LazyMat/
MIT License
0 stars 0 forks source link

Symbolic parser #21

Open adeeconometrics opened 1 month ago

adeeconometrics commented 1 month ago

Write a symbolic wrapper to get metadata about the object's content

Requirements

struct Symbol {
   std::string name;
  std::size_t value;
};
adeeconometrics commented 1 month ago

For now, settle with a dumb symbolic instance assignment

template <typename T, std::size_t Row, std::size_t Col> struct Symbol {

  Symbol() { m_counter++; }

  auto name() const noexcept -> std::string {
    return m_name + "_" + std::to_string(m_counter);
  }

private:
  static std::string m_name;
  static std::size_t m_counter;
};

template <typename T, std::size_t Rows, std::size_t Cols>
std::size_t Symbol<T, Rows, Cols>::m_counter = 0;

template <typename T, std::size_t Rows, std::size_t Cols>
std::string Symbol<T, Rows, Cols>::m_name = "x";
adeeconometrics commented 3 weeks ago

Checkout Embedded DSL efforts in Cpp Talk: https://www.youtube.com/watch?v=XH00wB_bbU4