ProSHADE: src/proshade/ProSHADE_misc.hpp Source File

| ProSHADE 0.7.5.4 (MAR 2021) 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 addToUnsignVectorVector ( std::vector < std::vector < proshade_unsign > >* vecToAddTo, std::vector < proshade_unsign > elementToAdd );
47 void addToDoubleVectorVector ( std::vector < std::vector < proshade_double > >* vecToAddTo, std::vector < proshade_double > elementToAdd );
48
49 bool sortSymHlp ( const proshade_double* a, const proshade_double* b );
50 bool sortSymHlpInv ( const proshade_double* a, const proshade_double* b );
51 bool sortDSymHlpInv ( const proshade_double* a, const proshade_double* b );
52 bool sortSymInvFoldHlp ( const proshade_double* a, const proshade_double* b );
53
54 void deepCopyAxisToDblPtrVector ( std::vector < proshade_double* >* dblPtrVec, proshade_double* axis );
55 void deepCopyBoundsSigPtrVector ( std::vector < proshade_signed* >* sigPtrVec, proshade_signed* xFrom, proshade_signed* xTo, proshade_signed* yFrom,
56 proshade_signed* yTo, proshade_signed* zFrom, proshade_signed* zTo );
57
65 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." )
66 {
67 //============================================ Check against NULL
68 if ( checkVar == NULL )
69 {
70 throw ProSHADE_exception ( "Failed to allocate memory.", "E000007", fileP, lineP, funcP, infoP );
71 }
72
73 //============================================ Done
74 return ;
75
76 }
77 }
78
79 #endif
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:273
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:230
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:188
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::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:256
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:287
ProSHADE_messages.hpp
This header file contains all message function declarations.
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:65
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_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::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:243
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:323