chemgraph

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: LGPL-2.1 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Atom

type Atom struct {
	*chem.Atom
	Bonds  []*Bond
	IDFunc func(*Atom) int64
}

func (*Atom) AtID

func (A *Atom) AtID() int

func (*Atom) ID

func (A *Atom) ID() int64

type Atoms

type Atoms struct {
	Atoms []*Atom
	// contains filtered or unexported fields
}

Implements gonum.graph.Nodes

func (*Atoms) Len

func (A *Atoms) Len() int

func (*Atoms) Next

func (A *Atoms) Next() bool

func (*Atoms) Node

func (A *Atoms) Node() graph.Node

func (*Atoms) Reset

func (A *Atoms) Reset()

type Bond

type Bond struct {
	*chem.Bond
	At1, At2   *Atom
	Weightfunc func(*Bond) float64
}

func (*Bond) From

func (B *Bond) From() graph.Node

func (*Bond) ReversedEdge

func (B *Bond) ReversedEdge() graph.Edge

I'll try to just switch them in place, as bonds are not directional look here if you have issues

func (*Bond) To

func (B *Bond) To() graph.Node

func (*Bond) Weight

func (B *Bond) Weight() float64

type Bonds

type Bonds []*Bond

func (Bonds) Contains

func (B Bonds) Contains(index int) bool

func (Bonds) Len

func (B Bonds) Len() int

type Topology

type Topology struct {
	*chem.Topology
	Bonds
	*Atoms
}

implements Gonum graph.Graph and graph.Weighted interfaces

func TopologyFromChem

func TopologyFromChem(mol *chem.Molecule, IDFunc func(*Atom) int64, weightfunc func(*Bond) float64) *Topology

I might add an interafece to avoid using chem.Molecule

func (*Topology) AddNode

func (T *Topology) AddNode(n graph.Node)

Will panic if a non-atom node is given

func (*Topology) Edge

func (T *Topology) Edge(id1, id2 int64) graph.Edge

func (*Topology) From

func (T *Topology) From(id int64) graph.Nodes

func (*Topology) HasEdgeBetween

func (T *Topology) HasEdgeBetween(id1, id2 int64) bool

func (*Topology) NewNode

func (T *Topology) NewNode() graph.Node

func (*Topology) Nodes

func (T *Topology) Nodes() *Atoms

func (*Topology) SetWeightedEdge

func (T *Topology) SetWeightedEdge(e graph.WeightedEdge)

Will panic if a non-bond edge is given

func (*Topology) SymmetrizePath

func (T *Topology) SymmetrizePath()

For each edge from A1->A2 adds a corresponding, equal edge from A2->A1

func (*Topology) Weight

func (T *Topology) Weight(id1, id2 int64) (w float64, ok bool)

func (*Topology) WeightedEdge

func (T *Topology) WeightedEdge(id1, id2 int64) graph.Edge

func (*Topology) WeightedEdgeBetween

func (T *Topology) WeightedEdgeBetween(id1, id2 int64) *Bond

Jump to

Keyboard shortcuts

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