| Bsoft 2.0.5 Bernard's software package

Functions | Variables
model_compare.cpp File Reference

Functions to compare models and components. More...

`#include "model_select.h"`
`#include "model_util.h"`
`#include "Matrix3.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Functions
long | model_component_number_difference (Bmodel *model1, Bmodel *model2)
| Compares the numbers of components in two models. More...
long | model_maxnum_components (Bmodel *model)
| Calculates the largest number of components in a model. More...
double | model_compare (Bmodel *model1, Bmodel *model2)
| Compares two models. More...
Matrix | model_adjacency_matrix (Bmodel *model)
| Constructs the adjacency matrix for a model. More...
Matrix | model_distance_matrix (Bmodel *model, int view_flag)
| Calculates the distance matrix for a model. More...
Matrix | model_distance_matrix (Bmodel *m1, Bmodel *m2)
| Calculates the distance matrix between two models. More...
long | model_consolidate (Bmodel *model, double distance)
| Consolidates close components within a model. More...
Bmodel * | models_consensus (Bmodel *model, double distance)
| Determines a consensus between models in a list. More...

## Variables
int | verbose

## Detailed Description

Functions to compare models and components.

Author
  Bernard Heymann

Date
  Created: 20060908
  Modified: 20161012

Definition in file model_compare.cpp.

## Function Documentation

## ◆ model_adjacency_matrix()

Matrix model_adjacency_matrix | ( | Bmodel * | model | ) |

Constructs the adjacency matrix for a model.

Parameters

  *model | model structure.

Returns
  Matrix adjacency matrix.

      The matrix contains ones for adjacent components and zero elsewhere.
      Only the first model in the linked list is used.
      The component selections are reset.

Definition at line 152 of file model_compare.cpp.

## ◆ model_compare()

double model_compare | ( | Bmodel * | model1,
|  | Bmodel * | model2
| ) |  |

Compares two models.

Parameters

  *model1 | first model structure.
  *model2 | second model structure.

Returns
  double RMSD.

      Only the first models in the linked lists are compared.

Definition at line 66 of file model_compare.cpp.

## ◆ model_component_number_difference()

long model_component_number_difference | ( | Bmodel * | model1,
|  | Bmodel * | model2
| ) |  |

Compares the numbers of components in two models.

Parameters

  *model1 | first model.
  *model2 | second model.

Returns
  long difference in the number of components.

      Only the first models in the lists are compared.

Definition at line 26 of file model_compare.cpp.

## ◆ model_consolidate()

long model_consolidate | ( | Bmodel * | model,
|  | double | distance
| ) |  |

Consolidates close components within a model.

Parameters

  *model | model structure.
  distance | cutoff distance to consider components to be the same.

Returns
  long number of components retained.

      A matrix is calculated from the pairwise distances between selected components.
      Components closer to each other than the given distance are consolidated.
      Only the first model in the linked list is used.

Definition at line 266 of file model_compare.cpp.

## ◆ model_distance_matrix() [1/2]

Matrix model_distance_matrix | ( | Bmodel * | model,
|  | int | view_flag
| ) |  |

Calculates the distance matrix for a model.

Parameters

  *model | model structure.
  view_flag | flag to include views.

Returns
  Matrix distance matrix.

      The matrix is calculated from the pairwise distances between selected
      components, with the option to include the views.
      When the views are included, the euclidean distances are rescaled to
      the maximum so that their ranges are similar to the view differences.
      Only the first model in the linked list is used.

Definition at line 189 of file model_compare.cpp.

## ◆ model_distance_matrix() [2/2]

Matrix model_distance_matrix | ( | Bmodel * | m1,
|  | Bmodel * | m2
| ) |  |

Calculates the distance matrix between two models.

Parameters

  *m1 | first model structure.
  *m2 | second model structure.

Returns
  Matrix distance matrix.

      The matrix is calculated from the pairwise distances between selected
      components, with the option to include the views.
      When the views are included, the euclidean distances are rescaled to
      the maximum so that their ranges are similar to the view differences.
      Only the first model in the linked list is used.

Definition at line 238 of file model_compare.cpp.

## ◆ model_maxnum_components()

long model_maxnum_components | ( | Bmodel * | model | ) |

Calculates the largest number of components in a model.

Parameters

  *model | model.

Returns
  long largest number of components in a model.

Definition at line 43 of file model_compare.cpp.

## ◆ models_consensus()

Bmodel* models_consensus | ( | Bmodel * | model,
|  | double | distance
| ) |  |

Determines a consensus between models in a list.

Parameters

  *model | model list.
  distance | cutoff distance to consider components to be the same.

Returns
  long number of components retained.

      A matrix is calculated from the pairwise distances between selected components
      from each apir of models.
      Components closer to each other than the given distance in different
      models are consolidated.
      The component selection field contains the number of contributing components.
      A new model containing the result is returned.

Definition at line 324 of file model_compare.cpp.

## Variable Documentation

## ◆ verbose

int verbose