<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_model__compare_8h">
<title>/Users/bernard/b20/bsoft/include/model_compare.h File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/include/model_compare.h</primary></indexterm>
<para>

<para>Functions to compare models and components. </para>
 
</para>
<programlisting>#include &quot;rwmodel.h&quot;
#include &quot;Matrix.h&quot;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>long <link linkend="_model__compare_8h_1a30312d0b35a89fec88a01c7afb4525b7">model_component_number_difference</link> (<link linkend="_struct_bmodel">Bmodel</link> *model1, <link linkend="_struct_bmodel">Bmodel</link> *model2)</para>

<para>Compares the numbers of components in two models. </para>
</listitem>
            <listitem><para>long <link linkend="_model__compare_8h_1a17ade38978bad2dd5edbb0617b554155">model_maxnum_components</link> (<link linkend="_struct_bmodel">Bmodel</link> *<link linkend="_tcltk__bmodel_8cpp_1a828359eaa8de833b547ac96934f43841">model</link>)</para>

<para>Calculates the largest number of components in a model. </para>
</listitem>
            <listitem><para>double <link linkend="_model__compare_8h_1a8934d9a98336ca22d7f4993b3656eae0">model_compare</link> (<link linkend="_struct_bmodel">Bmodel</link> *model1, <link linkend="_struct_bmodel">Bmodel</link> *model2)</para>

<para>Compares two models. </para>
</listitem>
            <listitem><para><link linkend="_class_matrix">Matrix</link> <link linkend="_model__compare_8h_1ae80d4946f0add73436060f9af488edef">model_distance_matrix</link> (<link linkend="_struct_bmodel">Bmodel</link> *<link linkend="_tcltk__bmodel_8cpp_1a828359eaa8de833b547ac96934f43841">model</link>, int view_flag)</para>

<para>Calculates the distance matrix for a model. </para>
</listitem>
            <listitem><para><link linkend="_class_matrix">Matrix</link> <link linkend="_model__compare_8h_1ab301af02ed616345a55843209c898621">model_distance_matrix</link> (<link linkend="_struct_bmodel">Bmodel</link> *m1, <link linkend="_struct_bmodel">Bmodel</link> *m2)</para>

<para>Calculates the distance matrix between two models. </para>
</listitem>
            <listitem><para><link linkend="_class_matrix">Matrix</link> <link linkend="_model__compare_8h_1a2d7da704355c64c207562eec44b2025d">model_adjacency_matrix</link> (<link linkend="_struct_bmodel">Bmodel</link> *<link linkend="_tcltk__bmodel_8cpp_1a828359eaa8de833b547ac96934f43841">model</link>)</para>

<para>Constructs the adjacency matrix for a model. </para>
</listitem>
            <listitem><para>long <link linkend="_model__compare_8h_1a787cdffda20a0217c15d7cecb8dd0c34">model_consolidate</link> (<link linkend="_struct_bmodel">Bmodel</link> *<link linkend="_tcltk__bmodel_8cpp_1a828359eaa8de833b547ac96934f43841">model</link>, double <link linkend="__vector3_8h_1aa60745aa4e45acde64f733424e37dbb9">distance</link>)</para>

<para>Consolidates close components within a model. </para>
</listitem>
            <listitem><para><link linkend="_struct_bmodel">Bmodel</link> * <link linkend="_model__compare_8h_1aaff25d0fb973abcae1da88336f802dc1">models_consensus</link> (<link linkend="_struct_bmodel">Bmodel</link> *<link linkend="_tcltk__bmodel_8cpp_1a828359eaa8de833b547ac96934f43841">model</link>, double <link linkend="__vector3_8h_1aa60745aa4e45acde64f733424e37dbb9">distance</link>)</para>

<para>Determines a consensus between models in a list. </para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Functions to compare models and components. </para>

<para><formalpara><title>Author: </title>

<para>Bernard Heymann </para>
</formalpara>
<formalpara><title>Date: </title>

<para>Created: 20060908 </para>

<para>Modified: 20161011 </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_model__compare_8h_1a2d7da704355c64c207562eec44b2025d"/>    <section>
    <title>model_adjacency_matrix()</title>
<indexterm><primary>model_adjacency_matrix</primary><secondary>model_compare.h</secondary></indexterm>
<indexterm><primary>model_compare.h</primary><secondary>model_adjacency_matrix</secondary></indexterm>
<para><computeroutput><link linkend="_class_matrix">Matrix</link> model_adjacency_matrix (<link linkend="_struct_bmodel">Bmodel</link> * model)</computeroutput></para><para>

<para>Constructs the adjacency matrix for a model. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*model</entry>
                                <entry>
<para>model structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_matrix">Matrix</link> adjacency matrix. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 152 of file model_compare.cpp.</para>
    </section><anchor xml:id="_model__compare_8h_1a8934d9a98336ca22d7f4993b3656eae0"/>    <section>
    <title>model_compare()</title>
<indexterm><primary>model_compare</primary><secondary>model_compare.h</secondary></indexterm>
<indexterm><primary>model_compare.h</primary><secondary>model_compare</secondary></indexterm>
<para><computeroutput>double model_compare (<link linkend="_struct_bmodel">Bmodel</link> * model1, <link linkend="_struct_bmodel">Bmodel</link> * model2)</computeroutput></para><para>

<para>Compares two models. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*model1</entry>
                                <entry>
<para>first model structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*model2</entry>
                                <entry>
<para>second model structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double RMSD. <literallayout><computeroutput>Only the first models in the linked lists are compared.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 66 of file model_compare.cpp.</para>
    </section><anchor xml:id="_model__compare_8h_1a30312d0b35a89fec88a01c7afb4525b7"/>    <section>
    <title>model_component_number_difference()</title>
<indexterm><primary>model_component_number_difference</primary><secondary>model_compare.h</secondary></indexterm>
<indexterm><primary>model_compare.h</primary><secondary>model_component_number_difference</secondary></indexterm>
<para><computeroutput>long model_component_number_difference (<link linkend="_struct_bmodel">Bmodel</link> * model1, <link linkend="_struct_bmodel">Bmodel</link> * model2)</computeroutput></para><para>

<para>Compares the numbers of components in two models. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*model1</entry>
                                <entry>
<para>first model. </para>
</entry>
                            </row>
                            <row>
                                <entry>*model2</entry>
                                <entry>
<para>second model. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long difference in the number of components. <literallayout><computeroutput>Only the first models in the lists are compared.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 26 of file model_compare.cpp.</para>
    </section><anchor xml:id="_model__compare_8h_1a787cdffda20a0217c15d7cecb8dd0c34"/>    <section>
    <title>model_consolidate()</title>
<indexterm><primary>model_consolidate</primary><secondary>model_compare.h</secondary></indexterm>
<indexterm><primary>model_compare.h</primary><secondary>model_consolidate</secondary></indexterm>
<para><computeroutput>long model_consolidate (<link linkend="_struct_bmodel">Bmodel</link> * model, double distance)</computeroutput></para><para>

<para>Consolidates close components within a model. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*model</entry>
                                <entry>
<para>model structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>distance</entry>
                                <entry>
<para>cutoff distance to consider components to be the same. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of components retained. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 266 of file model_compare.cpp.</para>
    </section><anchor xml:id="_model__compare_8h_1ae80d4946f0add73436060f9af488edef"/>    <section>
    <title>model_distance_matrix()<computeroutput>[1/2]</computeroutput></title>
<indexterm><primary>model_distance_matrix</primary><secondary>model_compare.h</secondary></indexterm>
<indexterm><primary>model_compare.h</primary><secondary>model_distance_matrix</secondary></indexterm>
<para><computeroutput><link linkend="_class_matrix">Matrix</link> model_distance_matrix (<link linkend="_struct_bmodel">Bmodel</link> * model, int view_flag)</computeroutput></para><para>

<para>Calculates the distance matrix for a model. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*model</entry>
                                <entry>
<para>model structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>view_flag</entry>
                                <entry>
<para>flag to include views. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_matrix">Matrix</link> distance matrix. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 189 of file model_compare.cpp.</para>
    </section><anchor xml:id="_model__compare_8h_1ab301af02ed616345a55843209c898621"/>    <section>
    <title>model_distance_matrix()<computeroutput>[2/2]</computeroutput></title>
<indexterm><primary>model_distance_matrix</primary><secondary>model_compare.h</secondary></indexterm>
<indexterm><primary>model_compare.h</primary><secondary>model_distance_matrix</secondary></indexterm>
<para><computeroutput><link linkend="_class_matrix">Matrix</link> model_distance_matrix (<link linkend="_struct_bmodel">Bmodel</link> * m1, <link linkend="_struct_bmodel">Bmodel</link> * m2)</computeroutput></para><para>

<para>Calculates the distance matrix between two models. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*m1</entry>
                                <entry>
<para>first model structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*m2</entry>
                                <entry>
<para>second model structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_matrix">Matrix</link> distance matrix. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 238 of file model_compare.cpp.</para>
    </section><anchor xml:id="_model__compare_8h_1a17ade38978bad2dd5edbb0617b554155"/>    <section>
    <title>model_maxnum_components()</title>
<indexterm><primary>model_maxnum_components</primary><secondary>model_compare.h</secondary></indexterm>
<indexterm><primary>model_compare.h</primary><secondary>model_maxnum_components</secondary></indexterm>
<para><computeroutput>long model_maxnum_components (<link linkend="_struct_bmodel">Bmodel</link> * model)</computeroutput></para><para>

<para>Calculates the largest number of components in a model. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*model</entry>
                                <entry>
<para>model. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long largest number of components in a model. </para>
</formalpara>
</para>
<para>
Definition at line 43 of file model_compare.cpp.</para>
    </section><anchor xml:id="_model__compare_8h_1aaff25d0fb973abcae1da88336f802dc1"/>    <section>
    <title>models_consensus()</title>
<indexterm><primary>models_consensus</primary><secondary>model_compare.h</secondary></indexterm>
<indexterm><primary>model_compare.h</primary><secondary>models_consensus</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmodel">Bmodel</link>* models_consensus (<link linkend="_struct_bmodel">Bmodel</link> * model, double distance)</computeroutput></para><para>

<para>Determines a consensus between models in a list. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*model</entry>
                                <entry>
<para>model list. </para>
</entry>
                            </row>
                            <row>
                                <entry>distance</entry>
                                <entry>
<para>cutoff distance to consider components to be the same. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of components retained. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 324 of file model_compare.cpp.</para>
</section>
</section>
</section>
