ProSHADE  0.7.6.6 (JUL 2022)
Protein Shape Detection
ProSHADE_misc.hpp
Go to the documentation of this file.
1 
23 //==================================================== ProSHADE
24 #include "ProSHADE_messages.hpp"
25 
26 //==================================================== Overinclusion protection
27 #ifndef PROSHADE_MISC
28 #define PROSHADE_MISC
29 
30 //==================================================== ProSHADE_internal_messages Namespace
37 namespace ProSHADE_internal_misc
38 {
39  void addToStringVector ( std::vector < std::string >* vecToAddTo, std::string elementToAdd );
40  void addToSingleVector ( std::vector < proshade_single >* vecToAddTo, proshade_single elementToAdd );
41  void addToDoubleVector ( std::vector < proshade_double >* vecToAddTo, proshade_double elementToAdd );
42  void addToUnsignVector ( std::vector < proshade_unsign >* vecToAddTo, proshade_unsign elementToAdd );
43  void addToSignedVector ( std::vector < proshade_signed >* vecToAddTo, proshade_signed elementToAdd );
44  void addToDblPtrVector ( std::vector < proshade_double* >* vecToAddTo, proshade_double* elementToAdd );
45  void addToSigPtrVector ( std::vector < proshade_signed* >* vecToAddTo, proshade_signed* elementToAdd );
46  void addToUnsPtrVector ( std::vector < proshade_unsign* >* vecToAddTo, proshade_unsign* elementToAdd );
47  void addToUnsignVectorVector ( std::vector < std::vector < proshade_unsign > >* vecToAddTo, std::vector < proshade_unsign > elementToAdd );
48  void addToDoubleVectorVector ( std::vector < std::vector < proshade_double > >* vecToAddTo, std::vector < proshade_double > elementToAdd );
49  void addToDblPtrVectorVector ( std::vector < std::vector < proshade_double* > >* vecToAddTo, std::vector < proshade_double* > elementToAdd );
50 
51  bool sortSymHlp ( const proshade_double* a, const proshade_double* b );
52  bool sortSymHlpInv ( const proshade_double* a, const proshade_double* b );
53  bool sortSymFSCHlp ( const proshade_double* a, const proshade_double* b );
54  bool sortSymFSCHlpInv ( const proshade_double* a, const proshade_double* b );
55  bool sortTSymByPeak ( const std::vector< proshade_double* > a, const std::vector< proshade_double* > b );
56  bool sortOSymByPeak ( const std::vector< proshade_double* > a, const std::vector< proshade_double* > b );
57  bool sortISymByPeak ( const std::vector< proshade_double* > a, const std::vector< proshade_double* > b );
58  bool sortDSymHlpInv ( const proshade_double* a, const proshade_double* b );
59  bool sortSymFoldHlp ( const proshade_double* a, const proshade_double* b );
60  bool sortSymInvFoldHlp ( const proshade_double* a, const proshade_double* b );
61 
62  void deepCopyAxisToDblPtrVector ( std::vector < proshade_double* >* dblPtrVec, proshade_double* axis );
63  void deepCopyBoundsSigPtrVector ( std::vector < proshade_signed* >* sigPtrVec, proshade_signed* xFrom, proshade_signed* xTo, proshade_signed* yFrom,
64  proshade_signed* yTo, proshade_signed* zFrom, proshade_signed* zTo );
65 
73  template <class chVar> inline void checkMemoryAllocation ( chVar checkVar, std::string fileP, unsigned int lineP, std::string funcP, std::string infoP = "This error may occurs when ProSHADE requests memory to be\n : allocated to it and this operation fails. This could\n : happen when not enough memory is available, either due to\n : other processes using a lot of memory, or when the machine\n : does not have sufficient memory available. Re-run to see\n : if this problem persists." )
74  {
75  //============================================ Check against NULL
76  if ( checkVar == nullptr )
77  {
78  throw ProSHADE_exception ( "Failed to allocate memory.", "E000007", fileP, lineP, funcP, infoP );
79  }
80 
81  //============================================ Done
82  return ;
83 
84  }
85 }
86 
87 #endif
ProSHADE_internal_misc::addToDblPtrVectorVector
void addToDblPtrVectorVector(std::vector< std::vector< proshade_double * > > *vecToAddTo, std::vector< proshade_double * > elementToAdd)
Adds the element to the vector of vectors of double pointers.
Definition: ProSHADE_misc.cpp:255
ProSHADE_internal_misc::sortSymInvFoldHlp
bool sortSymInvFoldHlp(const proshade_double *a, const proshade_double *b)
This function compares two arrays of two based on the first number, sorting highest first.
Definition: ProSHADE_misc.cpp:419
ProSHADE_internal_misc::addToDblPtrVector
void addToDblPtrVector(std::vector< proshade_double * > *vecToAddTo, proshade_double *elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:143
ProSHADE_internal_misc::sortSymHlp
bool sortSymHlp(const proshade_double *a, const proshade_double *b)
This function compares two arrays of two based on the fifth number, sorting lowest first.
Definition: ProSHADE_misc.cpp:275
ProSHADE_internal_misc::sortSymFSCHlp
bool sortSymFSCHlp(const proshade_double *a, const proshade_double *b)
This function compares two arrays of two based on the sixth number, sorting highest first.
Definition: ProSHADE_misc.cpp:301
ProSHADE_exception
This class is the representation of ProSHADE exception.
Definition: ProSHADE_exceptions.hpp:37
ProSHADE_internal_misc::addToUnsignVectorVector
void addToUnsignVectorVector(std::vector< std::vector< proshade_unsign > > *vecToAddTo, std::vector< proshade_unsign > elementToAdd)
Adds the element to the vector of vectors.
Definition: ProSHADE_misc.cpp:211
ProSHADE_internal_misc::addToDoubleVector
void addToDoubleVector(std::vector< proshade_double > *vecToAddTo, proshade_double elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:77
ProSHADE_internal_misc::addToSigPtrVector
void addToSigPtrVector(std::vector< proshade_signed * > *vecToAddTo, proshade_signed *elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:166
ProSHADE_internal_misc::addToSignedVector
void addToSignedVector(std::vector< proshade_signed > *vecToAddTo, proshade_signed elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:121
ProSHADE_internal_misc::sortOSymByPeak
bool sortOSymByPeak(const std::vector< proshade_double * > a, const std::vector< proshade_double * > b)
This function compares two vectors of arrays based on the sum of the fifth column,...
Definition: ProSHADE_misc.cpp:352
ProSHADE_internal_misc::sortDSymHlpInv
bool sortDSymHlpInv(const proshade_double *a, const proshade_double *b)
This function compares two arrays of the ProSHADE dihedral symmetry list based on combination of axes...
Definition: ProSHADE_misc.cpp:402
ProSHADE_internal_misc::deepCopyAxisToDblPtrVector
void deepCopyAxisToDblPtrVector(std::vector< proshade_double * > *dblPtrVec, proshade_double *axis)
Does a deep copy of a double array to a vector of double arrays.
Definition: ProSHADE_misc.cpp:433
ProSHADE_messages.hpp
This header file contains all message function declarations.
ProSHADE_internal_misc::sortISymByPeak
bool sortISymByPeak(const std::vector< proshade_double * > a, const std::vector< proshade_double * > b)
This function compares two vectors of arrays based on the sum of the fifth column,...
Definition: ProSHADE_misc.cpp:377
ProSHADE_internal_misc::checkMemoryAllocation
void checkMemoryAllocation(chVar checkVar, std::string fileP, unsigned int lineP, std::string funcP, std::string infoP="This error may occurs when ProSHADE requests memory to be\n : allocated to it and this operation fails. This could\n : happen when not enough memory is available, either due to\n : other processes using a lot of memory, or when the machine\n : does not have sufficient memory available. Re-run to see\n : if this problem persists.")
Checks if memory was allocated properly.
Definition: ProSHADE_misc.hpp:73
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:233
ProSHADE_internal_misc::sortTSymByPeak
bool sortTSymByPeak(const std::vector< proshade_double * > a, const std::vector< proshade_double * > b)
This function compares two vectors of arrays based on the sum of the fifth column,...
Definition: ProSHADE_misc.cpp:327
ProSHADE_internal_misc::addToUnsignVector
void addToUnsignVector(std::vector< proshade_unsign > *vecToAddTo, proshade_unsign elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:99
ProSHADE_internal_misc
This namespace contains all the miscellaneous functions used throughout the code but unrelated to it.
ProSHADE_internal_misc::addToSingleVector
void addToSingleVector(std::vector< proshade_single > *vecToAddTo, proshade_single elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:55
ProSHADE_internal_misc::sortSymFSCHlpInv
bool sortSymFSCHlpInv(const proshade_double *a, const proshade_double *b)
This function compares two arrays of two based on the sixth number, sorting highest first.
Definition: ProSHADE_misc.cpp:314
ProSHADE_internal_misc::addToUnsPtrVector
void addToUnsPtrVector(std::vector< proshade_unsign * > *vecToAddTo, proshade_unsign *elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:189
ProSHADE_internal_misc::sortSymHlpInv
bool sortSymHlpInv(const proshade_double *a, const proshade_double *b)
This function compares two arrays of two based on the fifth number, sorting highest first.
Definition: ProSHADE_misc.cpp:288
ProSHADE_internal_misc::addToStringVector
void addToStringVector(std::vector< std::string > *vecToAddTo, std::string elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:33
ProSHADE_internal_misc::deepCopyBoundsSigPtrVector
void deepCopyBoundsSigPtrVector(std::vector< proshade_signed * > *sigPtrVec, proshade_signed *xFrom, proshade_signed *xTo, proshade_signed *yFrom, proshade_signed *yTo, proshade_signed *zFrom, proshade_signed *zTo)
Does a deep copy of a signed int array to a vector of signed int arrays.
Definition: ProSHADE_misc.cpp:470