Bsoft  2.1.0
Bernard's software package
model_neighbors.cpp File Reference

Functions to manipulate model component neighbors. More...

#include "model_neighbors.h"
#include "model_util.h"
#include "linked_list.h"
#include "utilities.h"

Go to the source code of this file.

Functions

int model_set_neighbors (Bmodel *model, int number)
 Sets the desired number of components as neighbors for each component. More...
 
int model_set_neighbors (Bmodel *model, int number, double distance)
 
int model_neighbor_reciprocity (Bmodel *model)
 Counts how many neighbors of a component also has that component as a neighbor. More...
 

Variables

int verbose
 

Detailed Description

Functions to manipulate model component neighbors.

Author
Bernard Heymann
Date
Created: 20010828
Modified: 20141006

Definition in file model_neighbors.cpp.

Function Documentation

◆ model_neighbor_reciprocity()

int model_neighbor_reciprocity ( Bmodel *  model)

Counts how many neighbors of a component also has that component as a neighbor.

For each neighbor of component, the neighbor list of the neighbor is searched
for the id of the first component.
Only the first model in the linked list is used.
Parameters
*modelmodel.
Returns
int number of non-reciprocated neighbors.

Definition at line 149 of file model_neighbors.cpp.

◆ model_set_neighbors() [1/2]

int model_set_neighbors ( Bmodel *  model,
int  number 
)

Sets the desired number of components as neighbors for each component.

For each component, its neighbor list is set to the closest components.
Only the first model in the linked list is used.
Parameters
*modelmodel.
numbernumber of neighbors to set.
Returns
int 0.

Definition at line 28 of file model_neighbors.cpp.

◆ model_set_neighbors() [2/2]

int model_set_neighbors ( Bmodel *  model,
int  number,
double  distance 
)

Definition at line 60 of file model_neighbors.cpp.

Variable Documentation

◆ verbose

int verbose
extern