ProSHADE  0.7.5.1 (JAN 2021)
Protein Shape Detection
ProSHADE_internal_data Namespace Reference

This namespace contains the structure and functions required for data reading and storing their derivates. More...

Classes

class  ProSHADE_data
 This class contains all inputed and derived data for a single structure. More...
 

Functions

std::vector< std::vector< proshade_double > > joinElementsFromDifferentGroups (std::vector< std::vector< proshade_double > > *first, std::vector< std::vector< proshade_double > > *second, proshade_double matrixTolerance, bool combine)
 This function joins two group element lists using only unique elements. More...
 

Detailed Description

This namespace contains the structure and functions required for data reading and storing their derivates.

The ProSHADE_internal_data namespace contains the data structure. It also has the data derivates storing variables, but it does not provide the computation code except for the forward declarations. The user should not need to access this namespace when using the library.

Function Documentation

◆ joinElementsFromDifferentGroups()

std::vector< std::vector< proshade_double > > ProSHADE_internal_data::joinElementsFromDifferentGroups ( std::vector< std::vector< proshade_double > > *  first,
std::vector< std::vector< proshade_double > > *  second,
proshade_double  matrixTolerance,
bool  combine 
)

This function joins two group element lists using only unique elements.

Parameters
[in]firstVector of group elements.
[in]secondVector of group elements.
[in]matrixToleranceThe maximum trace error for rotation matrices to be still considered the same.
[in]combineShould the element combinations be added as well?
[out]retA vector of group elements containing all unique elements from both input element groups.

Definition at line 2486 of file ProSHADE_data.cpp.

2487 {
2488  //================================================ Initialise variables
2489  std::vector< std::vector< proshade_double > > ret;
2490 
2491  //================================================ Add the first list to ret, checking for uniqueness
2492  for ( proshade_unsign elIt = 0; elIt < static_cast<proshade_unsign> ( first->size() ); elIt++ )
2493  {
2494  if ( !checkElementAlreadyExists( &ret, &first->at(elIt), matrixTolerance ) )
2495  {
2496  ProSHADE_internal_misc::addToDoubleVectorVector ( &ret, first->at(elIt) );
2497  }
2498  }
2499 
2500  //================================================ Add the second list to ret, checking for uniqueness
2501  for ( proshade_unsign elIt = 0; elIt < static_cast<proshade_unsign> ( second->size() ); elIt++ )
2502  {
2503  if ( !checkElementAlreadyExists( &ret, &second->at(elIt), matrixTolerance ) )
2504  {
2505  ProSHADE_internal_misc::addToDoubleVectorVector ( &ret, second->at(elIt) );
2506  }
2507  }
2508 
2509  //================================================ Multiply all combinations of first and second and check for uniqueness
2510  if ( combine )
2511  {
2512  for ( proshade_unsign gr1 = 0; gr1 < static_cast<proshade_unsign> ( first->size() ); gr1++ )
2513  {
2514  for ( proshade_unsign gr2 = 0; gr2 < static_cast<proshade_unsign> ( second->size() ); gr2++ )
2515  {
2516  //==================================== Multiply the two rotation matrices
2517  std::vector< proshade_double > product = ProSHADE_internal_maths::multiplyGroupElementMatrices ( &first->at(gr1), &second->at(gr2) );
2518 
2519  //==================================== Add
2520  if ( !checkElementAlreadyExists( &ret, &product, matrixTolerance ) )
2521  {
2523  }
2524 
2525  }
2526  }
2527  }
2528 
2529  //================================================ Done
2530  return ( ret );
2531 
2532 }
ProSHADE_internal_misc::addToDoubleVectorVector
void addToDoubleVectorVector(std::vector< std::vector< proshade_double > > *vecToAddTo, std::vector< proshade_double > elementToAdd)
Adds the element to the vector of vectors.
Definition: ProSHADE_misc.cpp:210
ProSHADE_internal_maths::multiplyGroupElementMatrices
std::vector< proshade_double > multiplyGroupElementMatrices(std::vector< proshade_double > *el1, std::vector< proshade_double > *el2)
This function computes matrix multiplication using the ProSHADE group element matrix format as input ...
Definition: ProSHADE_maths.cpp:1925
checkElementAlreadyExists
bool checkElementAlreadyExists(std::vector< std::vector< proshade_double > > *elements, std::vector< proshade_double > *elem, proshade_double matrixTolerance)
This function checks if the element list already contains a given matrix.
Definition: ProSHADE_data.cpp:2419