similgraph

package module
v0.0.0-...-ed6f72f Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: MIT Imports: 4 Imported by: 0

README

similgraph

GoDoc Reference Build Status Coverage Status Go Report Card

Description

similgraph is a golang package that provides primitives for computing a cosine similarity graph whose edges are computed on the fly.

Installation

This package can be installed with the go get command:

go get github.com/ebonetti/similgraph

Documentation

API documentation can be found in the associated godoc reference

Documentation

Overview

Package similgraph provides primitives for computing a cosine similarity graph whose edges are computed on the fly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	VertexA uint32
	VertexB uint32
	Weight  float32
}

Edge represent a weighted edge

func (Edge) Less

func (ei Edge) Less(ej Edge) bool

Less implement the Lexicographical order between two edges.

type SimilGraph

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

SimilGraph represents a cosine similarity graph whose edges are computed on the fly

func New

func New(edges func() (info Edge, ok bool), vertexACount, vertexBCount, edgeCount int) (g *SimilGraph, newoldVertexA []uint32, err error)

New creates a new similgraph from the edges iterator; vertexACount, vertexBCount and edgeCount contain size estimates, used for efficient memory allocation.

func (SimilGraph) EdgeIterator

func (g SimilGraph) EdgeIterator(v uint32) (smallerIterator, biggerIterator func() (info Edge, ok bool), err error)

EdgeIterator iterate over the edges of the cosine similarity graph, computed on the fly.

func (SimilGraph) VertexCount

func (g SimilGraph) VertexCount() uint32

VertexCount return the count of the vertex in the graph

Jump to

Keyboard shortcuts

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