Bsoft 2.1.4
Bernard's software package
model_path.cpp File Reference

Library routines used for model processing. More...

#include "model_util.h"
#include "model_transform.h"
#include "model_select.h"
#include "model_compare.h"
#include "mol_transform.h"
#include "mol_compare.h"
#include "mol_util.h"
#include "symmetry.h"
#include "Matrix3.h"
#include "random_numbers.h"
#include "linked_list.h"
#include "utilities.h"

Functions

Matrix model_shortest_path (Bmodel *model)
 Calculates the shortest path between every pair of vertices. More...
 
double model_wiener_index (Bmodel *model)
 Calculates the Wiener index. More...
 
int comp_link_check (Bcomponent *comp, Bcomponent *comp2)
 
int comp_link_check (Bmodel *model, string &id1, string &id2)
 
Blinkmodel_link_add (Bmodel *model, string &id1, string &id2)
 
int model_check_path (Bmodel *model, Bcomponent **path)
 
double model_add_path (Bmodel *model, Bcomponent **path)
 
int comp_pick_next (int i, int n, Bcomponent *comp, Bcomponent **path, Bmodel *model)
 
Bmodelmodel_hamiltonian_cycle (Bmodel *model)
 Calculates the Hamiltonian cycles in a model. More...
 

Variables

int verbose
 

Detailed Description

Library routines used for model processing.

Author
Bernard Heymann
Date
Created: 20060908
Modified: 20150208

Function Documentation

◆ comp_link_check() [1/2]

int comp_link_check ( Bcomponent comp,
Bcomponent comp2 
)

◆ comp_link_check() [2/2]

int comp_link_check ( Bmodel model,
string &  id1,
string &  id2 
)

◆ comp_pick_next()

int comp_pick_next ( int  i,
int  n,
Bcomponent comp,
Bcomponent **  path,
Bmodel model 
)

◆ model_add_path()

double model_add_path ( Bmodel model,
Bcomponent **  path 
)

◆ model_check_path()

int model_check_path ( Bmodel model,
Bcomponent **  path 
)

◆ model_hamiltonian_cycle()

Bmodel * model_hamiltonian_cycle ( Bmodel model)

Calculates the Hamiltonian cycles in a model.

Parameters
*modelmodel structure.
Returns
Bmodel* linked list of models with cycle links.
A Hamiltonian cycle passes through each component once.
The cycles are limited to the links in the input model.
Redundant cycles are discarded.
Only the first model in the linked list is used.
Each of the resultant models has links forming a Hamiltonian cycle.
Reference: H. Wiener, J. Am. Chem. Soc., 1947, 69, 17.

◆ model_link_add()

Blink * model_link_add ( Bmodel model,
string &  id1,
string &  id2 
)

◆ model_shortest_path()

Matrix model_shortest_path ( Bmodel model)

Calculates the shortest path between every pair of vertices.

Parameters
*modelmodel structure.
Returns
Matrix path matrix.
The adjacency matrix is calculated as a starting point.
Only the first model in the linked list is used.

◆ model_wiener_index()

double model_wiener_index ( Bmodel model)

Calculates the Wiener index.

Parameters
*modelmodel structure.
Returns
double average Wiener index.
The Wiener index is calculated as the sum of the elements of
the shortest path matrix.
Only the first model in the linked list is used.
Reference: H. Wiener, J. Am. Chem. Soc., 1947, 69, 17.

Variable Documentation

◆ verbose

int verbose
extern