symbol_graph

package
v0.0.0-...-6b870f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2014 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author: anupam.kapoor@gmail.com (Anupam Kapoor)

this package implements the symbol digraph where vertex names are strings and number of edges/vertices are implicitly defined. this is more typical of real-world (tm) graph applications

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author: anupam.kapoor@gmail.com (Anupam Kapoor)

this package implements the symbol graph where vertex names are strings and number of edges/vertices are implicitly defined. this is more typical of real-world (tm) graph applications

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SymbolDigraph

type SymbolDigraph struct {
	// contains filtered or unexported fields
}

func DigraphFromFile

func DigraphFromFile(fname string, sep string) (sg *SymbolDigraph, err error)

this is a convenience interface over LoadSymbolDigraphFromReader(...) to create a symbol-graph from its serialized definition stored in a file identified by 'fname'

func DigraphFromReader

func DigraphFromReader(src *bufio.Reader, sep string) (sg *SymbolDigraph, sg_err error)

this function is called to create a symbol-graph from it's serialized definition.

func (*SymbolDigraph) Contains

func (sg *SymbolDigraph) Contains(str string) bool

this function returns true if the symbol-graph contains 'str' as a vertex

func (*SymbolDigraph) G

func (sg *SymbolDigraph) G() (g *graph.Digraph)

this function returns a pointer to the underlying graph in the symbol graph.

func (*SymbolDigraph) Index

func (sg *SymbolDigraph) Index(key string) (idx int32)

this function returns the index associated with a given key, if the key doesn't exist, it panics. thus clients, are expected to ensure that the key is available before coming here.

func (*SymbolDigraph) Name

func (sg *SymbolDigraph) Name(vertex_id int32) (name string, err error)

this function returns the name associated with a given vertex. if the vertex is invalid, an error is flagged

func (*SymbolDigraph) String

func (sg *SymbolDigraph) String() (retval string)

this function returns the stringified representation of the symbol-graph

type SymbolGraph

type SymbolGraph struct {
	// contains filtered or unexported fields
}

func LoadFromFile

func LoadFromFile(fname string, sep string) (sg *SymbolGraph, err error)

this is a convenience interface over LoadSymbolGraphFromReader(...) to create a symbol-graph from its serialized definition stored in a file identified by 'fname'

func LoadFromReader

func LoadFromReader(src *bufio.Reader, sep string) (sg *SymbolGraph, sg_err error)

this function is called to create a symbol-graph from it's serialized definition.

func (*SymbolGraph) Contains

func (sg *SymbolGraph) Contains(str string) bool

this function returns true if the symbol-graph contains 'str' as a vertex

func (*SymbolGraph) G

func (sg *SymbolGraph) G() (g *graph.Graph)

this function returns a pointer to the underlying graph in the symbol graph.

func (*SymbolGraph) Index

func (sg *SymbolGraph) Index(key string) (idx int32)

this function returns the index associated with a given key, if the key doesn't exist, it panics. thus clients, are expected to ensure that the key is available before coming here.

func (*SymbolGraph) Name

func (sg *SymbolGraph) Name(vertex_id int32) (name string, err error)

this function returns the name associated with a given vertex. if the vertex is invalid, an error is flagged

func (*SymbolGraph) String

func (sg *SymbolGraph) String() (retval string)

this function returns the stringified representation of the symbol-graph

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL