mod_adjacency_mat Module

This module is used to efficiently handle the topological problem of finding all the atom pairs in the molecule separated by exactly n bonds. To do so the molecule is tought as an undirected unweighted graph, represented in memory with a boolean adjacency matrix. Since this matrix is sparse and symmetric, it is effeciently represented in the Yale format (sometime referred as compressed sparse row, CSR) omitting the value array.

From the adjacency matrix , the matrix containing the atom pairs separated by exactly n bonds are computed according the following recoursive formula: Note that in this context since we are manipulating boolean matrices, the product is replaced by logical and, sum by logical or, and - by
logical and not. To apply this recursive definition, we also assume that .

The module contains all the routines needed to perform such operations, including the linear scaling multiplication between sparse matrices.


Uses

  • module~~mod_adjacency_mat~~UsesGraph module~mod_adjacency_mat mod_adjacency_mat module~mod_memory mod_memory module~mod_adjacency_mat->module~mod_memory module~mod_io mod_io module~mod_memory->module~mod_io iso_c_binding iso_c_binding module~mod_memory->iso_c_binding module~mod_constants mod_constants module~mod_memory->module~mod_constants module~mod_io->module~mod_constants module~mod_constants->iso_c_binding

Used by

  • module~~mod_adjacency_mat~~UsedByGraph module~mod_adjacency_mat mod_adjacency_mat module~mod_topology mod_topology module~mod_topology->module~mod_adjacency_mat module~mod_nonbonded mod_nonbonded module~mod_nonbonded->module~mod_adjacency_mat module~mod_nonbonded->module~mod_topology module~mod_neighbor_list mod_neighbor_list module~mod_nonbonded->module~mod_neighbor_list proc~topology_terminate topology_terminate proc~topology_terminate->module~mod_adjacency_mat proc~mmpol_prepare mmpol_prepare proc~mmpol_prepare->module~mod_adjacency_mat module~mod_electrostatics mod_electrostatics proc~mmpol_prepare->module~mod_electrostatics proc~make_screening_lists make_screening_lists proc~make_screening_lists->module~mod_adjacency_mat proc~vdw_terminate vdw_terminate proc~vdw_terminate->module~mod_adjacency_mat proc~vdw_terminate->module~mod_neighbor_list proc~check_conn_matrix check_conn_matrix proc~check_conn_matrix->module~mod_adjacency_mat proc~mmpol_init_from_mmp mmpol_init_from_mmp proc~mmpol_init_from_mmp->module~mod_adjacency_mat proc~mmpol_init_from_mmp->module~mod_electrostatics module~mod_mmpol mod_mmpol proc~mmpol_init_from_mmp->module~mod_mmpol proc~ommp_system_from_qm_helper ommp_system_from_qm_helper proc~ommp_system_from_qm_helper->module~mod_adjacency_mat proc~ommp_system_from_qm_helper->module~mod_topology proc~ommp_system_from_qm_helper->module~mod_mmpol module~mod_prm mod_prm proc~ommp_system_from_qm_helper->module~mod_prm proc~mmpol_init_from_xyz mmpol_init_from_xyz proc~mmpol_init_from_xyz->module~mod_adjacency_mat proc~mmpol_init_from_xyz->module~mod_topology proc~mmpol_init_from_xyz->module~mod_electrostatics proc~mmpol_init_from_xyz->module~mod_mmpol proc~mmpol_init_from_xyz->module~mod_prm proc~build_pg_adjacency_matrix build_pg_adjacency_matrix proc~build_pg_adjacency_matrix->module~mod_adjacency_mat module~mod_electrostatics->module~mod_adjacency_mat module~mod_electrostatics->module~mod_topology proc~guess_connectivity guess_connectivity proc~guess_connectivity->module~mod_adjacency_mat module~mod_mmpol->module~mod_adjacency_mat module~mod_mmpol->module~mod_topology module~mod_mmpol->module~mod_nonbonded module~mod_mmpol->module~mod_electrostatics module~mod_link_atom mod_link_atom module~mod_mmpol->module~mod_link_atom module~mod_bonded mod_bonded module~mod_mmpol->module~mod_bonded proc~electrostatics_terminate electrostatics_terminate proc~electrostatics_terminate->module~mod_adjacency_mat proc~nl_update nl_update proc~nl_update->module~mod_adjacency_mat proc~qm_helper_update_coord qm_helper_update_coord proc~qm_helper_update_coord->module~mod_adjacency_mat proc~qm_helper_update_coord->module~mod_topology proc~nl_terminate nl_terminate proc~nl_terminate->module~mod_adjacency_mat module~mod_neighbor_list->module~mod_adjacency_mat proc~create_new_bond create_new_bond proc~create_new_bond->module~mod_adjacency_mat proc~ommp_potential_mmpol2ext ommp_potential_mmpol2ext proc~ommp_potential_mmpol2ext->module~mod_electrostatics proc~qm_helper_vdw_geomgrad qm_helper_vdw_geomgrad proc~qm_helper_vdw_geomgrad->module~mod_nonbonded proc~qm_helper_vdw_geomgrad->module~mod_mmpol proc~qm_helper_vdw_geomgrad->module~mod_link_atom proc~qm_helper_link_atom_geomgrad qm_helper_link_atom_geomgrad proc~qm_helper_link_atom_geomgrad->module~mod_mmpol proc~qm_helper_link_atom_geomgrad->module~mod_link_atom proc~ommp_set_default_solver ommp_set_default_solver proc~ommp_set_default_solver->module~mod_electrostatics proc~ommp_set_external_field ommp_set_external_field proc~ommp_set_external_field->module~mod_electrostatics module~mod_polarization mod_polarization proc~ommp_set_external_field->module~mod_polarization proc~rotation_geomgrad rotation_geomgrad proc~rotation_geomgrad->module~mod_electrostatics module~mod_inputloader mod_inputloader module~mod_inputloader->module~mod_mmpol proc~ommp_get_fixedelec_energy ommp_get_fixedelec_energy proc~ommp_get_fixedelec_energy->module~mod_electrostatics proc~ommp_vdw_geomgrad ommp_vdw_geomgrad proc~ommp_vdw_geomgrad->module~mod_nonbonded proc~ommp_create_link_atom ommp_create_link_atom proc~ommp_create_link_atom->module~mod_topology proc~ommp_create_link_atom->module~mod_nonbonded proc~ommp_create_link_atom->module~mod_mmpol proc~ommp_create_link_atom->module~mod_link_atom module~mod_qm_helper mod_qm_helper proc~ommp_create_link_atom->module~mod_qm_helper proc~init_vdw_for_link_atom init_vdw_for_link_atom proc~init_vdw_for_link_atom->module~mod_topology proc~init_bonded_for_link_atom init_bonded_for_link_atom proc~init_bonded_for_link_atom->module~mod_topology proc~init_bonded_for_link_atom->module~mod_bonded proc~init_bonded_for_link_atom->module~mod_prm module~mod_link_atom->module~mod_topology module~mod_link_atom->module~mod_nonbonded module~mod_link_atom->module~mod_bonded module~mod_bonded->module~mod_topology proc~ommp_qm_helper_set_frozen_atoms ommp_qm_helper_set_frozen_atoms proc~ommp_qm_helper_set_frozen_atoms->module~mod_topology module~ommp_interface ommp_interface module~ommp_interface->module~mod_topology module~ommp_interface->module~mod_electrostatics module~ommp_interface->module~mod_mmpol module~ommp_interface->module~mod_qm_helper proc~qm_helper_init_vdw qm_helper_init_vdw proc~qm_helper_init_vdw->module~mod_nonbonded proc~assign_vdw assign_vdw proc~assign_vdw->module~mod_nonbonded proc~assign_mpoles assign_mpoles proc~assign_mpoles->module~mod_electrostatics proc~ommp_field_mm2ext ommp_field_mm2ext proc~ommp_field_mm2ext->module~mod_electrostatics proc~polelec_geomgrad polelec_geomgrad proc~polelec_geomgrad->module~mod_electrostatics proc~polelec_geomgrad->module~mod_polarization proc~c_ommp_field_mm2ext C_ommp_field_mm2ext proc~c_ommp_field_mm2ext->module~mod_electrostatics proc~ommp_field_mmpol2ext ommp_field_mmpol2ext proc~ommp_field_mmpol2ext->module~mod_electrostatics proc~qm_helper_vdw_energy qm_helper_vdw_energy proc~qm_helper_vdw_energy->module~mod_nonbonded proc~qm_helper_vdw_energy->module~mod_mmpol proc~qm_helper_vdw_energy->module~mod_link_atom proc~ommp_get_polelec_energy ommp_get_polelec_energy proc~ommp_get_polelec_energy->module~mod_electrostatics proc~ommp_get_polelec_energy->module~mod_polarization proc~c_ommp_update_coordinates C_ommp_update_coordinates proc~c_ommp_update_coordinates->module~mod_mmpol proc~dipole_t dipole_T proc~dipole_t->module~mod_electrostatics proc~electrostatic_for_ene electrostatic_for_ene proc~electrostatic_for_ene->module~mod_electrostatics proc~ommp_turn_pol_off ommp_turn_pol_off proc~ommp_turn_pol_off->module~mod_electrostatics proc~vdw_geomgrad vdw_geomgrad proc~vdw_geomgrad->module~mod_neighbor_list proc~ommp_potential_mm2ext ommp_potential_mm2ext proc~ommp_potential_mm2ext->module~mod_electrostatics proc~vdw_init vdw_init proc~vdw_init->module~mod_neighbor_list proc~tmatvec_otf TMatVec_otf proc~tmatvec_otf->module~mod_electrostatics proc~vdw_potential vdw_potential proc~vdw_potential->module~mod_neighbor_list proc~numerical_geomgrad numerical_geomgrad proc~numerical_geomgrad->module~mod_mmpol proc~ommp_potential_pol2ext ommp_potential_pol2ext proc~ommp_potential_pol2ext->module~mod_electrostatics proc~electrostatic_for_grad electrostatic_for_grad proc~electrostatic_for_grad->module~mod_electrostatics proc~ommp_field_pol2ext ommp_field_pol2ext proc~ommp_field_pol2ext->module~mod_electrostatics proc~mmpol_init mmpol_init proc~mmpol_init->module~mod_electrostatics proc~fixedelec_geomgrad fixedelec_geomgrad proc~fixedelec_geomgrad->module~mod_electrostatics proc~rotate_multipoles rotate_multipoles proc~rotate_multipoles->module~mod_electrostatics proc~ommp_set_vdw_cutoff ommp_set_vdw_cutoff proc~ommp_set_vdw_cutoff->module~mod_nonbonded proc~add_link_atom add_link_atom proc~add_link_atom->module~mod_topology module~mod_prm->module~mod_topology module~mod_prm->module~mod_electrostatics module~mod_prm->module~mod_bonded proc~mmpol_terminate mmpol_terminate proc~mmpol_terminate->module~mod_nonbonded proc~mmpol_terminate->module~mod_electrostatics proc~mmpol_terminate->module~mod_bonded proc~qm_helper_init qm_helper_init proc~qm_helper_init->module~mod_topology module~mod_qm_helper->module~mod_topology module~mod_qm_helper->module~mod_nonbonded module~mod_qm_helper->module~mod_mmpol module~mod_geomgrad mod_geomgrad module~mod_geomgrad->module~mod_topology module~mod_geomgrad->module~mod_mmpol proc~init_link_atom init_link_atom proc~init_link_atom->module~mod_topology proc~ommp_set_frozen_atoms ommp_set_frozen_atoms proc~ommp_set_frozen_atoms->module~mod_topology proc~ommp_full_geomgrad ommp_full_geomgrad proc~ommp_full_geomgrad->module~mod_nonbonded proc~ommp_full_geomgrad->module~mod_geomgrad proc~qm_helper_terminate qm_helper_terminate proc~qm_helper_terminate->module~mod_topology proc~qm_helper_terminate->module~mod_nonbonded proc~ommp_set_default_matv ommp_set_default_matv proc~ommp_set_default_matv->module~mod_electrostatics module~mod_polarization->module~mod_electrostatics module~mod_polarization->module~mod_mmpol proc~c_ommp_field_pol2ext C_ommp_field_pol2ext proc~c_ommp_field_pol2ext->module~mod_electrostatics module~mod_solvers mod_solvers module~mod_solvers->module~mod_electrostatics proc~assign_pol assign_pol proc~assign_pol->module~mod_electrostatics proc~vdw_set_cutoff vdw_set_cutoff proc~vdw_set_cutoff->module~mod_neighbor_list proc~init_eel_for_link_atom init_eel_for_link_atom proc~init_eel_for_link_atom->module~mod_electrostatics proc~init_eel_for_link_atom->module~mod_prm proc~ommp_get_vdw_energy ommp_get_vdw_energy proc~ommp_get_vdw_energy->module~mod_nonbonded proc~ommp_terminate ommp_terminate proc~ommp_terminate->module~mod_mmpol proc~c_ommp_qm_helper_get_e_p2n C_ommp_qm_helper_get_E_p2n proc~c_ommp_qm_helper_get_e_p2n->module~mod_qm_helper proc~ommp_get_strbnd_energy ommp_get_strbnd_energy proc~ommp_get_strbnd_energy->module~mod_bonded proc~ommp_get_imptorsion_energy ommp_get_imptorsion_energy proc~ommp_get_imptorsion_energy->module~mod_bonded proc~ommp_init_mmp ommp_init_mmp proc~ommp_init_mmp->module~mod_inputloader proc~link_atom_angle_geomgrad link_atom_angle_geomgrad proc~link_atom_angle_geomgrad->module~mod_bonded module~test_geomgrad~2 test_geomgrad module~test_geomgrad~2->module~ommp_interface proc~ommp_angtor_geomgrad ommp_angtor_geomgrad proc~ommp_angtor_geomgrad->module~mod_bonded program~test_si_init test_SI_init program~test_si_init->module~ommp_interface proc~c_ommp_qm_helper_get_npol C_ommp_qm_helper_get_npol proc~c_ommp_qm_helper_get_npol->module~mod_qm_helper proc~ommp_strtor_geomgrad ommp_strtor_geomgrad proc~ommp_strtor_geomgrad->module~mod_bonded proc~ommp_qm_helper_vdw_energy ommp_qm_helper_vdw_energy proc~ommp_qm_helper_vdw_energy->module~mod_qm_helper proc~c_ommp_qm_helper_use_frozen C_ommp_qm_helper_use_frozen proc~c_ommp_qm_helper_use_frozen->module~mod_qm_helper proc~update_coordinates update_coordinates proc~update_coordinates->module~mod_link_atom proc~ommp_get_angle_energy ommp_get_angle_energy proc~ommp_get_angle_energy->module~mod_link_atom proc~ommp_get_angle_energy->module~mod_bonded proc~assign_imptorsion assign_imptorsion proc~assign_imptorsion->module~mod_bonded program~test_si_geomgrad test_SI_geomgrad program~test_si_geomgrad->module~ommp_interface module~test_geomgrad test_geomgrad program~test_si_geomgrad->module~test_geomgrad proc~ommp_qm_helper_update_coord ommp_qm_helper_update_coord proc~ommp_qm_helper_update_coord->module~mod_qm_helper proc~c_ommp_qm_helper_get_v_p2n C_ommp_qm_helper_get_V_p2n proc~c_ommp_qm_helper_get_v_p2n->module~mod_qm_helper proc~ommp_polelec_geomgrad ommp_polelec_geomgrad proc~ommp_polelec_geomgrad->module~mod_geomgrad proc~ommp_torsion_geomgrad ommp_torsion_geomgrad proc~ommp_torsion_geomgrad->module~mod_link_atom proc~ommp_torsion_geomgrad->module~mod_bonded proc~ommp_get_angtor_energy ommp_get_angtor_energy proc~ommp_get_angtor_energy->module~mod_bonded proc~ommp_full_bnd_geomgrad ommp_full_bnd_geomgrad proc~ommp_full_bnd_geomgrad->module~mod_link_atom proc~ommp_full_bnd_geomgrad->module~mod_bonded proc~c_ommp_qm_helper_get_g_n2m C_ommp_qm_helper_get_G_n2m proc~c_ommp_qm_helper_get_g_n2m->module~mod_qm_helper proc~ommp_opb_geomgrad ommp_opb_geomgrad proc~ommp_opb_geomgrad->module~mod_bonded proc~ommp_urey_geomgrad ommp_urey_geomgrad proc~ommp_urey_geomgrad->module~mod_bonded proc~assign_angtor assign_angtor proc~assign_angtor->module~mod_bonded proc~c_ommp_qm_helper_get_frozen C_ommp_qm_helper_get_frozen proc~c_ommp_qm_helper_get_frozen->module~mod_qm_helper proc~ommp_get_link_atom_coordinates ommp_get_link_atom_coordinates proc~ommp_get_link_atom_coordinates->module~mod_link_atom proc~c_ommp_full_geomgrad C_ommp_full_geomgrad proc~c_ommp_full_geomgrad->module~ommp_interface module~test_geomgrad->module~ommp_interface proc~c_ommp_qm_helper_get_cqm C_ommp_qm_helper_get_cqm proc~c_ommp_qm_helper_get_cqm->module~mod_qm_helper proc~c_ommp_qm_helper_get_e_m2n C_ommp_qm_helper_get_E_m2n proc~c_ommp_qm_helper_get_e_m2n->module~mod_qm_helper program~test_si_geomgrad_num test_SI_geomgrad_num program~test_si_geomgrad_num->module~ommp_interface program~test_si_geomgrad_num->module~test_geomgrad proc~ommp_qm_helper_vdw_geomgrad ommp_qm_helper_vdw_geomgrad proc~ommp_qm_helper_vdw_geomgrad->module~mod_qm_helper proc~ommp_qm_helper_link_atom_geomgrad ommp_qm_helper_link_atom_geomgrad proc~ommp_qm_helper_link_atom_geomgrad->module~mod_qm_helper proc~c_ommp_qm_helper_get_g_n2p C_ommp_qm_helper_get_G_n2p proc~c_ommp_qm_helper_get_g_n2p->module~mod_qm_helper proc~assign_angle assign_angle proc~assign_angle->module~mod_bonded proc~ommp_get_torsion_energy ommp_get_torsion_energy proc~ommp_get_torsion_energy->module~mod_link_atom proc~ommp_get_torsion_energy->module~mod_bonded proc~ommp_update_link_atoms_position ommp_update_link_atoms_position proc~ommp_update_link_atoms_position->module~mod_link_atom proc~ommp_update_link_atoms_position->module~mod_qm_helper proc~assign_strbnd assign_strbnd proc~assign_strbnd->module~mod_bonded proc~c_ommp_qm_helper_get_v_m2n C_ommp_qm_helper_get_V_m2n proc~c_ommp_qm_helper_get_v_m2n->module~mod_qm_helper proc~ommp_get_bond_energy ommp_get_bond_energy proc~ommp_get_bond_energy->module~mod_link_atom proc~ommp_get_bond_energy->module~mod_bonded program~test_si_potential test_SI_potential program~test_si_potential->module~ommp_interface proc~qm_helper_init_vdw_prm qm_helper_init_vdw_prm proc~qm_helper_init_vdw_prm->module~mod_prm proc~ommp_fixedelec_geomgrad ommp_fixedelec_geomgrad proc~ommp_fixedelec_geomgrad->module~mod_geomgrad proc~ommp_pitors_geomgrad ommp_pitors_geomgrad proc~ommp_pitors_geomgrad->module~mod_bonded proc~c_ommp_terminate_qm_helper C_ommp_terminate_qm_helper proc~c_ommp_terminate_qm_helper->module~mod_qm_helper proc~ommp_bond_geomgrad ommp_bond_geomgrad proc~ommp_bond_geomgrad->module~mod_link_atom proc~ommp_bond_geomgrad->module~mod_bonded proc~link_atom_bond_geomgrad link_atom_bond_geomgrad proc~link_atom_bond_geomgrad->module~mod_bonded proc~c_ommp_get_opb_energy C_ommp_get_opb_energy proc~c_ommp_get_opb_energy->module~mod_bonded proc~assign_urey assign_urey proc~assign_urey->module~mod_bonded proc~c_ommp_qm_helper_get_h_n2m C_ommp_qm_helper_get_H_n2m proc~c_ommp_qm_helper_get_h_n2m->module~mod_qm_helper proc~ommp_strbnd_geomgrad ommp_strbnd_geomgrad proc~ommp_strbnd_geomgrad->module~mod_bonded proc~link_atom_torsion_geomgrad link_atom_torsion_geomgrad proc~link_atom_torsion_geomgrad->module~mod_bonded proc~ommp_init_qm_helper ommp_init_qm_helper proc~ommp_init_qm_helper->module~mod_qm_helper proc~ommp_get_opb_energy ommp_get_opb_energy proc~ommp_get_opb_energy->module~mod_bonded proc~ommp_get_pitors_energy ommp_get_pitors_energy proc~ommp_get_pitors_energy->module~mod_bonded module~mod_ommp_c_interface mod_ommp_C_interface module~mod_ommp_c_interface->module~ommp_interface proc~ommp_angle_geomgrad ommp_angle_geomgrad proc~ommp_angle_geomgrad->module~mod_link_atom proc~ommp_angle_geomgrad->module~mod_bonded proc~c_ommp_qm_helper_get_nmm C_ommp_qm_helper_get_nmm proc~c_ommp_qm_helper_get_nmm->module~mod_qm_helper proc~c_ommp_qm_helper_use_nonbonded C_ommp_qm_helper_use_nonbonded proc~c_ommp_qm_helper_use_nonbonded->module~mod_qm_helper proc~c_ommp_qm_helper_get_e_n2p C_ommp_qm_helper_get_E_n2p proc~c_ommp_qm_helper_get_e_n2p->module~mod_qm_helper proc~ommp_init_xyz ommp_init_xyz proc~ommp_init_xyz->module~mod_inputloader proc~assign_pitors assign_pitors proc~assign_pitors->module~mod_bonded proc~polarization polarization proc~polarization->module~mod_solvers proc~ommp_get_strtor_energy ommp_get_strtor_energy proc~ommp_get_strtor_energy->module~mod_bonded proc~c_ommp_qm_helper_get_e_n2m C_ommp_qm_helper_get_E_n2m proc~c_ommp_qm_helper_get_e_n2m->module~mod_qm_helper proc~ommp_get_full_bnd_energy ommp_get_full_bnd_energy proc~ommp_get_full_bnd_energy->module~mod_link_atom proc~ommp_get_full_bnd_energy->module~mod_bonded proc~assign_strtor assign_strtor proc~assign_strtor->module~mod_bonded proc~assign_bond assign_bond proc~assign_bond->module~mod_bonded proc~assign_torsion assign_torsion proc~assign_torsion->module~mod_bonded proc~ommp_get_tortor_energy ommp_get_tortor_energy proc~ommp_get_tortor_energy->module~mod_bonded proc~ommp_tortor_geomgrad ommp_tortor_geomgrad proc~ommp_tortor_geomgrad->module~mod_bonded proc~assign_opb assign_opb proc~assign_opb->module~mod_bonded proc~c_ommp_qm_helper_get_qm_atoms C_ommp_qm_helper_get_qm_atoms proc~c_ommp_qm_helper_get_qm_atoms->module~mod_qm_helper proc~ommp_imptorsion_geomgrad ommp_imptorsion_geomgrad proc~ommp_imptorsion_geomgrad->module~mod_bonded proc~assign_tortors assign_tortors proc~assign_tortors->module~mod_bonded proc~ommp_terminate_qm_helper ommp_terminate_qm_helper proc~ommp_terminate_qm_helper->module~mod_qm_helper proc~ommp_get_urey_energy ommp_get_urey_energy proc~ommp_get_urey_energy->module~mod_bonded

Contents


Derived Types

type, public ::  yale_sparse

Describe a square boolean sparse matrix n x n.
Indices of non-zero elements in the i-th row are contained in the array ci(ri(i):ri(i+1)).

Components

Type Visibility Attributes Name Initial
integer(kind=ip), public :: n

Dimension of the matrix

integer(kind=ip), public, allocatable :: ri(:)

Row index vector, always dimensioned n+1

integer(kind=ip), public, allocatable :: ci(:)

Column index vector, dimension number of non-zero elements


Subroutines

public subroutine matcpy(f, t)

Copy boolean sparse matrix in yale format f to t.

Arguments

Type IntentOptional Attributes Name
type(yale_sparse), intent(in) :: f

Matrix to copy

type(yale_sparse), intent(out) :: t

Destination matrix

public subroutine matfree(m)

Deallocate a boolean sparse matrix (in Yale format)

Arguments

Type IntentOptional Attributes Name
type(yale_sparse), intent(inout) :: m

Matrix to free

public subroutine adj_mat_from_conn(i12, sparse)

Create adjacency matrix from connectivity lists.
Array i12 and n12 contain the connectivity list in the following format: i12(0:n(j),j) contains the index of all the atoms connected to atom with index j.

Arguments

Type IntentOptional Attributes Name
integer(kind=ip), intent(inout) :: i12(:,:)

Indices of connected atoms for each atom in the molecule

type(yale_sparse), intent(out) :: sparse

Adjacency matrix in Yale format ()

public subroutine reallocate_mat(m, nnz)

Reshape a boolean sparse matrix in Yale format to accomodate a larger number of non-zero elements or to trim unused non-zero elements after a guess allocation.

Arguments

Type IntentOptional Attributes Name
type(yale_sparse), intent(inout) :: m

Matrix to be reshaped

integer(kind=ip), intent(in) :: nnz

New shape for the matrix

private subroutine mat_mult2(sp1, sp2, res)

Performs the operation on boolean sparse matrices; product correspond to logical and while sum correspond to logical or.
This subroutine is just for test pourposes as it performs the matrix product without exploiting the sparsity, and therefore with an unfavorable scaling .

Arguments

Type IntentOptional Attributes Name
type(yale_sparse), intent(in) :: sp1

Input matrices (sparse boolean matrices in Yale format)

type(yale_sparse), intent(in) :: sp2

Input matrices (sparse boolean matrices in Yale format)

type(yale_sparse), intent(out) :: res

Output matrix (sparse boolean matrices in Yale format)

private subroutine mat_mult(sp1, sp2, res)

Performs the operation on boolean sparse matrices; product correspond to logical and while sum correspond to logical or.
This subroutine is the one actually used in the code; It performs matrix product exploiting the sparsity, and therefore with a scaling .

Arguments

Type IntentOptional Attributes Name
type(yale_sparse), intent(in) :: sp1

Input matrices (sparse boolean matrices in Yale format)

type(yale_sparse), intent(in) :: sp2

Input matrices (sparse boolean matrices in Yale format)

type(yale_sparse), intent(out) :: res

Output matrix (sparse boolean matrices in Yale format)

private subroutine mat_andnot(sp1, sp2, res)

Performs the operation on boolean sparse matrices.

Read more…

Arguments

Type IntentOptional Attributes Name
type(yale_sparse), intent(in) :: sp1

Input matrices (sparse boolean matrices in Yale format)

type(yale_sparse), intent(in) :: sp2

Input matrices (sparse boolean matrices in Yale format)

type(yale_sparse), intent(out) :: res

Output matrix (sparse boolean matrices in Yale format)

private subroutine sparse_identity(n, res)

Create an identity matrix (boolean sparse, represented in Yale format) of dimension .

Arguments

Type IntentOptional Attributes Name
integer(kind=ip), intent(in) :: n

Rank of the output matrix

type(yale_sparse), intent(out) :: res

Output matrix

public subroutine build_conn_upto_n(adj, n, res, start_id)

Build connectivity matrices up to starting from . Results are stored in an array of boolean sparse matrix in Yale format in such a way that ; since FORTRAN is 1-based the useless is not stored.

Arguments

Type IntentOptional Attributes Name
type(yale_sparse), intent(in) :: adj

Adjacency matrix in Yale format

integer(kind=ip), intent(in) :: n

Maximum level of connectivity that should be computed

type(yale_sparse), intent(out), allocatable :: res(:)

Results connectivity matrices

logical :: start_id

Specifies if the first matrix allocated res(1) should be the identity (true) or the adjacency (false).

public subroutine reverse_grp_tab(a2g, g2a, ng_in)

Takes as argument an array of group index for each atom, and create a list of atms in each group using the sparse matrix format (saved as Yale format). This is used by cell lists, polarization group etc.

Arguments

Type IntentOptional Attributes Name
integer(kind=ip), intent(in) :: a2g(:)

Index of polarization group for each MM atom

type(yale_sparse), intent(out) :: g2a

Indices of atoms included in each polarization group; Atom indeces for the n-th group are found at pg2mm%ci(pg2mm%ri(n):pg2mm%ri(n+1)-1)

integer(kind=ip), intent(in), optional :: ng_in

Number of groups if it is not provided in input it is assumed that the number of group equals the largest group index, that is no empty groups are present after the one with the largest index.

public subroutine compress_list(n, uc_list, nit, s)

This subroutine takes as input a sparse matrix (rank [n]) in an uncompressed yale format [uc_list], as a rectangular matrix ([n] x max_el_per_row) and the actual number of items [nit] for each row (remaining elements are not considered) and compress in a Yale format sparse matrix [s]. The task is parallelized to handle large matrices.

Arguments

Type IntentOptional Attributes Name
integer(kind=ip), intent(in) :: n

Rank of matrix

integer(kind=ip), intent(in) :: uc_list(:,:)

Uncompressed list/boolean sparse matrix

integer(kind=ip), intent(in) :: nit(n)

Number of elements for each row of [uc_list]

type(yale_sparse), intent(out) :: s

Output sparse matrix

public subroutine compress_data(s, uc_data, c_data)

Compress the data in uc_data to the same Yale sparse format described in s

Arguments

Type IntentOptional Attributes Name
type(yale_sparse), intent(in) :: s

Input Yale format binary matrix/sparse list

real(kind=rp), intent(in) :: uc_data(:,:)

Uncompressed data in input

real(kind=rp), intent(out), allocatable :: c_data(:)

Compressed data in output