vector.c File Reference Detailed Description
Function Documentation
Comparison operator for identifiers. To be used when defining a vector of identifiers (i.e., unsigned int).
Definition at line 19 of file vector.c. Referenced by New_NewTemptativeSample().
Copy constructor for identifiers. To be used when defining a vector of identifiers (i.e., unsigned int). This is a direct assignation.
Definition at line 24 of file vector.c. Referenced by DetectLinksAndJoints(), DetectLinksAndJointsFromResidues(), DetectLinksAndJointsFromRigidsAndHinges(), InitBranchStatus(), and InitHeap().
Destructor for identifiers. To be used when defining a vector of identifiers (i.e., unsigned int). This basically frees the space taken by the identifier.
Definition at line 29 of file vector.c. Referenced by DetectLinksAndJoints(), DetectLinksAndJointsFromResidues(), DetectLinksAndJointsFromRigidsAndHinges(), and InitHeap().
Copy constructor for doubles. To be used when defining a vector of doubles. This is a direct assignation.
Definition at line 39 of file vector.c. Referenced by InitSample(), and LoadSample().
Destructor for doubles. To be used when defining a vector of doubles. This basically frees the space taken by the double.
Definition at line 44 of file vector.c. Referenced by InitSample(), and LoadSample().
Defines a double pair form two doubles.
Definition at line 49 of file vector.c. References TDoublePair::f, and TDoublePair::s. Referenced by RecursiveReWireRRTstar(), WireAtlasRRTstar(), and WireRRTstar().
Returns the first element of a pair of doubles.
Definition at line 55 of file vector.c. References TDoublePair::f. Referenced by RecursiveReWireRRTstar().
Returns the second element of a pair of doubles.
Definition at line 60 of file vector.c. References TDoublePair::s.
Copy constructor for pairs of doubles. To be used when defining a vector of pairs of doubles. This is a direct assignation.
Definition at line 71 of file vector.c. Referenced by AtlasBiRRTstar(), AtlasRRTstar(), BiRRTstar(), and RRTstar().
Destructor for pairs of doubles. To be used when defining a vector of doubles. This basically frees the space taken by the pair of double.
Definition at line 77 of file vector.c. Referenced by BiRRTstar(), and RRTstar().
Copy constructor for doubles. To be used when defining a vector of pointers. This is a direct assignation.
Definition at line 87 of file vector.c. Referenced by CopyLink(), CreateBranch(), GenerateKinTree(), InitEnvironment(), InitLink(), and InitMechanism().
Destructor for void pointers. To be used when defining a vector of pointers. This basically frees the space taken by the pointer.
Definition at line 92 of file vector.c. Referenced by CopyLink(), CreateBranch(), GenerateKinTree(), InitEnvironment(), InitLink(), and InitMechanism().
Initializes an empty vector Examples of use:
Alternatively you can also use
since the delete functions are actually empty.
Definition at line 100 of file vector.c. References Tvector::Copy, Tvector::Delete, Tvector::ele_size, Tvector::elements, Error(), Tvector::max_ele, NEW, and Tvector::num_ele. Referenced by AtlasBiRRTstar(), BiRRTstar(), CopyLink(), CreateBranch(), DetectLinksAndJoints(), DetectLinksAndJointsFromResidues(), DetectLinksAndJointsFromRigidsAndHinges(), GenerateKinTree(), InitBranchStatus(), InitEnvironment(), InitHeap(), InitLink(), InitMechanism(), InitSample(), LoadSample(), and RRTPathSteps().
Removes all the elements from a vector but it does not frees the allocated memory nor resets the maximum number of elements. If you plan to re-use a vector it is more efficient to reset it instead of deleting it and re-initializing it again.
Definition at line 120 of file vector.c. References Tvector::Delete, Tvector::elements, and Tvector::num_ele. Referenced by ChangeBiRRTSteps(), DeleteVector(), and ResetHeap(). Initializes a vector from another vector.
Definition at line 138 of file vector.c. References Tvector::Copy, Tvector::Delete, Tvector::ele_size, Tvector::elements, Tvector::max_ele, NEW, and Tvector::num_ele. Referenced by CopyHeap(), and CopySample().
Returns the first (i.e., with lower identifier) free position in a vector.
Definition at line 162 of file vector.c. References Tvector::elements. Referenced by NewFreeVectorElement().
Returns the number of elements in a vector. Note that the vector can have "holes", i.e., empty slots in position explicitly deleted using RemoveVectorElement.
Definition at line 173 of file vector.c. References Tvector::num_ele. Referenced by ChangeBiRRTSteps(), CheckHeap(), GetEnvironmentNObstacles(), GetMechanismLinkID(), GetMechanismNJoints(), GetMechanismNLinks(), GetObstacleID(), GetSampleDim(), InitWorldKinCS(), LinkNBodies(), nStepsBranch(), PrintSample(), SaveSample(), Steps2PathinAtlasRRT(), Steps2PathinRRT(), and UpdateBiRRTSteps().
Returns the maximum number of elements in a vector. Note that the vector can have "holes", i.e., empty slots in position explicitly deleted using RemoveVectorElement.
Definition at line 178 of file vector.c. References Tvector::max_ele. Checks if a vector is empty
Definition at line 183 of file vector.c. References Tvector::num_ele. Looks for an element in a vector.
Definition at line 188 of file vector.c. References FindPos(). Referenced by New_NewTemptativeSample(). Looks for an element in a vector.
Definition at line 193 of file vector.c. References Tvector::elements, FALSE, and TRUE. Referenced by ElementInVector().
Adds an element at the end of the list.
Definition at line 216 of file vector.c. References Tvector::num_ele, and SetVectorElement(). Referenced by AddBody2Link(), AddShape2Environment(), AddStepToBranch(), ChangeBiRRTSteps(), ConcatVectors(), DetectLinksAndJoints(), DetectLinksAndJointsFromResidues(), DetectLinksAndJointsFromRigidsAndHinges(), GenerateKinTree(), InitBranchStatus(), New_AddBranchToAtlasRRT(), New_NewTemptativeSample(), and RRTPathSteps().
Looks for a free vector position and stores the given element.
Definition at line 227 of file vector.c. References SetVectorElement(), and VectorFirstFreePos().
Adds an element to the vector in a given position. If the vector position was already occupied, the stored element is deleted before copying the new element.
Definition at line 238 of file vector.c. References Tvector::Copy, Tvector::Delete, Tvector::ele_size, Tvector::elements, Tvector::max_ele, MEM_EXPAND, NEW, and Tvector::num_ele. Referenced by AddElement2Heap(), AddJoint2Mechanism(), AddLink2Mechanism(), AddShape2Environment(), InitSample(), LoadSample(), NewFreeVectorElement(), NewVectorElement(), and UpdateHeapElement().
Returns a pointer to a given vector element.
Definition at line 270 of file vector.c. References Tvector::elements. Referenced by Atoms2Transforms(), BioWordGetAtomPositionsFromConformation(), ChangeBiRRTSteps(), CheckHeap(), DeleteBranch(), DetectLinksAndJointsFromRigidsAndHinges(), DistanceToSubBoxCenter(), ExtractMinElement(), GetBranchStep(), GetHeapElement(), GetHeapPosition(), GetLinkBody(), GetLinkBodyStatus(), GetMechanismJoint(), GetMechanismLink(), GetMechanismLinkID(), GetObstacleColor(), GetObstacleID(), GetObstacleName(), GetObstacleShape(), GetObstacleShapeStatus(), GetSampleValue(), GetTransformFromBranch(), HeapDown(), HeapUp(), InitWorldFromMolecule(), InitWorldKinCS(), PointInSubBox(), PointInSystemBox(), PrintSample(), Steps2PathinAtlasRRT(), Steps2PathinRRT(), UpdateBiRRTSteps(), and UpdateHeapElement().
Returns a pointer to a the last element of a vector.
Definition at line 278 of file vector.c. References Tvector::elements, and Tvector::num_ele.
Removes an element from the vector. Note that elements in the vector are not compacted after the deletion. In this way indexes in other data structured refered to this vector still hold after the deletion. The drawnback is that we can end up with a vector with "holes" and we have to be carefull when retriving elements from the vector.
Definition at line 286 of file vector.c. References Tvector::Delete, Tvector::elements, and Tvector::num_ele. Referenced by ExtractMinElement(), ExtractVectorElement(), and MoveVectorElement().
Swaps two elements in a vector. This operation is provided since it is more efficient than extracting the two elements and then inserting them again in the vector in their new positions. If one of the two elements to swap is empty, this function triggers an error.
Definition at line 299 of file vector.c. References Tvector::elements, and Error(). Referenced by ExtractMinElement(), HeapDown(), and HeapUp().
Reverses the elements in a vector.
Definition at line 319 of file vector.c. References Tvector::elements, and Tvector::num_ele. Adds a vector to the end of another vector.
Definition at line 333 of file vector.c. References Tvector::elements, NewVectorElement(), and Tvector::num_ele. Referenced by ChangeBiRRTSteps().
Extracts an element from a vector. The element is copied to the given buffer and removed from the vector. If the given element of the vector is empty, this function triggers an error.
Definition at line 342 of file vector.c. References Tvector::Copy, Tvector::elements, Error(), and RemoveVectorElement(). Referenced by ExtractMinElement().
Moves a vector element from one position to another. If the element to move is empty, this function triggers an error. If the element where to store the moved element is full, it is removed before the moving.
Definition at line 363 of file vector.c. References Tvector::elements, Error(), and RemoveVectorElement().
Deletes the information stored in the vector and frees the allocated memory space.
Definition at line 389 of file vector.c. References ResetVector(). Referenced by AtlasBiRRTstar(), BiRRTstar(), ChangeBiRRTSteps(), DeleteBioWorld(), DeleteBranch(), DeleteBranchStatus(), DeleteEnvironment(), DeleteHeap(), DeleteLink(), DeleteMechanism(), DeleteSample(), InitWorldKinCS(), and ReconstructRRTPath(). |
Follow us!