COIN-OR::LEMON - Graph Library

Changeset 2399:ccf2a1fa1821 in lemon-0.x for lemon/steiner.h


Ignore:
Timestamp:
03/07/07 12:57:51 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3230
Message:

More query functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/steiner.h

    r2391 r2399  
    126126    FilterMap *_filter;
    127127    TreeMap *_tree;
     128
     129    Value _value;
    128130
    129131  public:
     
    248250      }
    249251
    250       prim(nodeSubUGraphAdaptor(_graph, *_filter), _cost, *_tree);
     252      _value = prim(nodeSubUGraphAdaptor(_graph, *_filter), _cost, *_tree);
    251253           
    252254    }
     
    269271      return (*_filter)[n];
    270272    }
    271    
    272 
     273
     274    /// \brief Checks if the node is a Steiner-node.
     275    ///
     276    /// Checks if the node is a Steiner-node (i.e. a tree node but
     277    /// not terminal).
     278    /// \param n is the node that will be checked
     279    /// \return \c true if n is a Steiner-node, \c false otherwise
     280    bool steiner(Node n){
     281      return (*_filter)[n] && (*_pred)[n] != INVALID;
     282    }
     283
     284    /// \brief Checks if the node is a terminal.
     285    ///
     286    /// Checks if the node is a terminal.
     287    /// \param n is the node that will be checked
     288    /// \return \c true if n is a terminal, \c false otherwise
     289    bool terminal(Node n){
     290      return _dijkstra.reached(n) && (*_pred)[n] == INVALID;
     291    }
     292   
     293    /// \brief The total cost of the tree
     294    ///
     295    /// The total cost of the constructed tree. The calculated value does
     296    /// not exceed the double of the optimal value.
     297    Value treeValue() const {
     298      return _value;
     299    }
     300   
    273301  };
    274302
Note: See TracChangeset for help on using the changeset viewer.