class QPanda::ArchGraph

Overview

This is the base class for the architectures that this project will be supporting. More…

#include <ArchGraph.h>

class ArchGraph: public QPanda::WeightedGraph
{
public:
    // typedefs

    typedef ArchGraph* Ref;
    typedef std::unique_ptr<ArchGraph> uRef;
    typedef std::shared_ptr<ArchGraph> sRef;
    typedef std::vector<std::pair<std::string, uint32_t>> RegsVector;
    typedef RegsVector::iterator RegsIterator;

    // methods

    uint32_t putVertex(std::string s);

    void putReg(
        std::string id,
        std::string size
        );

    uint32_t get_vertex_count();
    std::vector<std::vector<int>> get_adjacent_matrix();
    std::vector<std::vector<double>> get_adj_weight_matrix();
    bool isGeneric();
    RegsIterator reg_begin();
    RegsIterator reg_end();
    std::vector<std::pair<uint32_t, uint32_t>> get_all_edges();
    static bool ClassOf(const Graph* g);
    static uRef Create(uint32_t n);
};

Inherited Members

public:
    // typedefs

    typedef Graph* Ref;
    typedef std::unique_ptr<Graph> uRef;
    typedef std::shared_ptr<Graph> sRef;
    typedef WeightedGraph<T>* Ref;
    typedef std::unique_ptr<WeightedGraph<T>> uRef;
    typedef std::shared_ptr<WeightedGraph<T>> sRef;

    // enums

    enum Kind;
    enum Type;

    // methods

    uint32_t inDegree(uint32_t i) const;
    uint32_t outDegree(uint32_t i) const;
    uint32_t size() const;
    std::set<uint32_t>& succ(uint32_t i);
    const std::set<uint32_t>& c_succ(uint32_t i) const;
    std::set<uint32_t>& pred(uint32_t i);
    std::set<uint32_t> adj(uint32_t i) const;
    void putEdge(uint32_t i, uint32_t j);
    bool hasEdge(uint32_t i, uint32_t j) const;
    bool isWeighted() const;
    bool isArch() const;
    bool isDirectedGraph() const;
    std::string dotify(std::string name = "Dump") const;
    static bool ClassOf(const Graph* g);
    static uRef Create(uint32_t n, Type ty = Undirected);
    void putEdge(uint32_t i, uint32_t j, T w);
    void setW(uint32_t i, uint32_t j, T w);
    T getW(uint32_t i, uint32_t j) const;
    static bool ClassOf(const Graph* g);
    static uRef Create(uint32_t n, Type ty = Undirected);

Detailed Documentation

This is the base class for the architectures that this project will be supporting.

Methods

bool isGeneric()

Returns true if this is a generic architechture graph, i.e.: it was not created by any of the architechtures compiled within the program.