Search Results for

    Show / Hide Table of Contents

    Class model::Terms::Variable

    Inheritance
    utils::Component
    model::Terms::Variable
    Inherited Members
    configure
    ~Component
    Component
    get_status
    param

    Methods

    <()

    Declaration
    bool model::Terms::Variable::operator<(const Variable&other) const

    <()

    Declaration
    bool model::Terms::Variable::operator<(const Variable&other) const

    render()

    render the object in structured form

    Return a structured representation of the object. This is intended for output purposes. For instance, the solution your solver finds should have a render method which allows it to be returned as part of the result. Example:

    {c++}
     MySolution : public Component {
      public:
       // Represent the internal bool vector as +-1 output.
       utils::Structure render() const override {
         utils::Structure rendered;
         for (bool item : solution_) rendered.push_back(item ? 1 : -1);
         return rendered;
       }
    
      private:
       std::vector<bool> solution_;
     }
    
     MySolution solution;
     std::cout << solution.render().to_string() << std::endl;
    

    utils::Structure

    Declaration
    utils::Structure model::Terms::Variable::render() const override

    get_class_name()

    get_class_name shows an identifier of the (derived) class name

    Its primary use is for type identification during stream output and logging, where a component is rendered as <ClassName: status>. Example:

    {c++}
     MyClass : public Component {}
    
     // This will render as '<MyClass>'
     MyClass my_object;
     std::cout << my_object << std::endl;
    
    Note

    You do not need to overload this method unless you want to change the output of the default implementation.

    Declaration
    std::string model::Terms::Variable::get_class_name() const override
    In This Article
    Back to top Generated with Doxygen and DocFX