basic_algebra.c File Reference Detailed DescriptionDefinition of the basic lineal algebra routines used in the CuikSuite. These basic routines are implemented using BLAS, if available. Definition in file basic_algebra.c.
Function Documentation
Computes the dot product of two general vectors.
Definition at line 15 of file basic_algebra.c. Referenced by AddBorderConstraint(), CutPolytopeWithFace(), DetermineSPolytopeNeighbour(), EnlargeSPolytope(), InsidePolytope(), InsideSPolytope(), PolytopeBoundaryPointFromExternalCornerInt(), and RefineSingularPoint().
Multiplies all the elements of a vector by a given factor.
Definition at line 30 of file basic_algebra.c. Referenced by AddBorderConstraint(), AddBranchToRRT(), ConnectSamplesChart(), DetermineSPolytopeNeighbour(), DistanceOnChart(), ExtendAtlasFromPoint(), ExtendAtlasTowardPoint(), FocusedPointOnBoundary(), GradientSmooth(), MinimizeOnAtlas(), NewChartFromPoint(), PathInChart(), PolytopeBoundaryPointFromExternalCornerInt(), SaveChartCenters(), and TriangulateAtlas().
Multiplies all the elements of a vector by a given factor and stores the result in a new vector.
Definition at line 42 of file basic_algebra.c. Referenced by EvaluateTransSeq().
Adds a vector to another vector
Definition at line 55 of file basic_algebra.c. Referenced by AddBranchToAtlasRRT(), AddBranchToRRT(), ConnectSamplesChart(), EvaluateMEquationXVectors(), EvaluateTransSeq(), InitPatchTrans(), Local2Global(), PolytopeBoundaryPointFromExternalCornerInt(), and PrintTransSeq().
Adds two vectors and stores the result in another vector..
Definition at line 67 of file basic_algebra.c. Referenced by Chart2Manifold(), GetJointTransSeq(), Local2Global(), PrintJoint(), and PrintTransSeq().
Adds two vectors /scaling the second vector) and stores the result in another vector.. This is basically used in Gram-Smidth orthogonalization.
Definition at line 86 of file basic_algebra.c. Referenced by AddBranchToRRT(), ConnectSamples(), ConnectSamplesChart(), EvaluateTransSeq(), EvaluateVectorsPATrans(), FindPointInOtherBranch(), FindSingularPoint(), GeodesicDistance(), GetJointDOFValues(), GetJointTransform(), InitWorldFromMolecule(), MoveJointFromTransforms(), NewTemptativeSample(), and PointTowardRandSample().
Compputes the cosine for all the elements of a vector.
Definition at line 108 of file basic_algebra.c.
Compputes the sine for all the elements of a vector.
Definition at line 116 of file basic_algebra.c.
Returns the index of the maximum element in the given vector.
Definition at line 124 of file basic_algebra.c. References NO_UINT.
Returns the value of the maximum element in the given vector.
Definition at line 148 of file basic_algebra.c. Referenced by ErrorInInequalities(), ErrorInSimpInequalitiesOnPoint(), InequalitiesHoldOnPoint(), and SimpInequalitiesHoldOnPoint().
Returns the index of the minimum element in the given vector.
Definition at line 167 of file basic_algebra.c. References NO_UINT.
Returns the value of the minimum element in the given vector.
Definition at line 191 of file basic_algebra.c.
Substracts a vector from another vector: v1=v1-v2
Definition at line 210 of file basic_algebra.c. Referenced by GradientSmooth(), and PolytopeBoundaryPointFromExternalCornerInt().
Substracts two vectors and stores the result in another vector: v=v1-v2
Definition at line 223 of file basic_algebra.c. Referenced by AdjustBioWorldGeometry(), Atoms2Transforms(), ConnectSamplesChart(), DifferenceVectorTopology(), FindSingularPoint(), GenerateJointSolution(), GetJointDOFValues(), InitPatchTrans(), InitWorldFromMolecule(), Manifold2Chart(), MoveJointFromTransforms(), PointTowardRandSample(), and TriangulateAtlas().
Substracts two vectors and stores the result in another vector considering the topology for each dimension.
Definition at line 245 of file basic_algebra.c. References DifferenceVector(), PI2PI, and TOPOLOGY_S. Referenced by AddBranchToAtlasRRT(), AddBranchToRRT(), Chart2Manifold(), ConnectSamples(), ConnectSamplesChart(), GeodesicDistance(), and Manifold2Chart().
Computes the norm of a vector with the given size.
Definition at line 265 of file basic_algebra.c. Referenced by AddBorderConstraint(), AddBranchToRRT(), AtlasRRTSample(), Chart2Manifold(), ConnectSamples(), ConnectSamplesChart(), CuikNewtonInBox(), CutPolytope(), CutPolytopeWithFace(), CutSPolytope(), DetermineSPolytopeNeighbour(), DistanceOnChart(), ErrorInCSEquations(), ErrorInSimpCSEquations(), ErrorInSolution(), EvaluateTransSeq(), ExtendAtlasFromPoint(), ExtendAtlasTowardPoint(), GetJointDOFValues(), GetPolytopeInteriorPoint(), GradientSmooth(), InsideSPolytope(), main(), Manifold2Chart(), MinCosinusBetweenSubSpaces(), MinimizeOnAtlas(), MoveJointFromTransforms(), NewChartFromPoint(), NewFixJoint(), NewInPatchJoint(), NewPrismaticJoint(), NewRevoluteJoint(), NewSphericalJoint(), NewSphPrsSphJoint(), NewSphSphJoint(), NewTemptativeSample(), Newton2ManifoldPlane(), NewUniversalJoint(), Normalize(), PathInChart(), PointTowardRandSample(), PolytopeBoundaryPointFromExternalCornerInt(), ReconstructAtlasPath(), and RefineSingularPoint().
Computes the norm of a vector with the given size and whose elements might not be continuous in memory but separated by a given stride.
Definition at line 280 of file basic_algebra.c.
Computes the distance between two points given as a vector with a given size.
Definition at line 297 of file basic_algebra.c. Referenced by Distance(), DistanceTopology(), and SquaredDistanceTopology().
Computes the distance between two points given as a vector with a given size.
Definition at line 323 of file basic_algebra.c. References SquaredDistance(). Referenced by AddBranchToAtlasRRT(), AdjustBioWorldGeometry(), BioWorldRMSE(), CrossTopologyBorder(), DistanceOnChart(), HTransformIsIdentity(), main(), NewTemptativeSample(), PathInChart(), and ReadSTL().
Computes the squared distance between two points given as a vector with a given size and considering the topology for each dimension.
Definition at line 328 of file basic_algebra.c. References M_PI, PI2PI, SquaredDistance(), and TOPOLOGY_S. Referenced by GetRRTNN().
Computes the squared distance between two points given as a vector with a given size and considering the topology for each dimension. The squared distance is only fully computed for points closer than a given threshold. This accelerates the distance computations.
Definition at line 352 of file basic_algebra.c. References M_PI, PI2PI, and TOPOLOGY_S.
Computes the distance between two points given as a vector with a given size and considering the topology for each dimension.
Definition at line 382 of file basic_algebra.c. References M_PI, PI2PI, SquaredDistance(), and TOPOLOGY_S. Referenced by AddBranchToAtlasRRT(), AddBranchToRRT(), AddNodeToRRT(), AddSample2AtlasRRT(), AddStepToAtlasRRTstar(), AddStepToRRTstar(), AtlasAStar(), AtlasBiRRTstar(), AtlasGBF(), AtlasRRT(), AtlasRRTstar(), AtlasRRTValidateSample(), BiRRTstar(), BuildAtlasFromPoint(), cBiRRT(), ccRRT(), ccTRRT(), Chart2Manifold(), ChartErrorFromParameters(), ClassifyPointInChart(), ConnectSamples(), ConnectSamplesChart(), CrossTopologyBorder(), DistanceOnChart(), FindPointInOtherBranch(), GeodesicDistance(), GradientSmooth(), InDynamicDomain(), IntersectChartsInt(), NewTemptativeSample(), PathInChart(), PathLength(), PathStart2GoalInRRT(), PointOnChart(), RecursiveReWireRRTstar(), RRTPathLength(), RRTstar(), and RRTValidateSample().
This is like DistanceTopology, but it only computes the distance as far it is below a given threshold. This is usefuls to rapidly abort computing distances for points that are further away than other points when searching for nearest neighbours. Note that if the output is above the given threshold, the distance is not actually fully computed (the output is not the true distance between the given points).
Definition at line 406 of file basic_algebra.c. References M_PI, PI2PI, and TOPOLOGY_S. Referenced by GetRRTNN(), GetRRTNNInBall(), GetRRTNNInBranch(), and GetRRTNNInChart().
Checks if the shortest line connecting two points crosses the borders imposed by the topology of each variable, i.e., if it goes across the pi,-pi discontinuity.
Definition at line 437 of file basic_algebra.c. References Distance(), and DistanceTopology(). Referenced by TriangulateAtlas().
Normalizes a generic vector with the given size.
Definition at line 442 of file basic_algebra.c. References Error(), and Norm(). Referenced by Atoms2Transforms(), CDCallBackInfo(), EvaluatePATrans(), GenerateJointSolution(), GetJointDOFValues(), GetJointTransform(), and PointTowardRandSample().
Computes the mean of an array of doubles.
Definition at line 466 of file basic_algebra.c. Referenced by PrintAverages().
Computes the sample standard deviation of an array of doubles.
Definition at line 478 of file basic_algebra.c. Referenced by PrintAverages().
Applies PI2PI to an array but only to those elements that have sphere topology.
Definition at line 496 of file basic_algebra.c. References PI2PI, and TOPOLOGY_S. Referenced by AddChart2Btree(), AddNodeToRRT(), Chart2Manifold(), ConnectSamples(), ConnectSamplesChart(), CuikNewtonInBox(), CuikNewtonSimp(), Local2Global(), Manifold2Chart(), Newton2ManifoldPlane(), RefineSingularPoint(), and SearchInBtree().
Defines a vector taking the values from the row of a matrix.
Definition at line 509 of file basic_algebra.c. References RC2INDEX.
Defines a vector taking the values from the column of a matrix.
Definition at line 521 of file basic_algebra.c. References RC2INDEX. Referenced by FindRightNullVector(), and RefineSingularPoint().
Defines a row of a matrix taking the values from a vector.
Definition at line 533 of file basic_algebra.c. References RC2INDEX. Referenced by Newton2ManifoldPlane().
Defines a column of a matrix taking the values from a vector.
Definition at line 545 of file basic_algebra.c. References RC2INDEX.
Computes the squared norm of a row of a matrix.
Definition at line 557 of file basic_algebra.c. References RC2INDEX.
Computes the squared norm of a column of a matrix.
Definition at line 578 of file basic_algebra.c. References RC2INDEX. Referenced by FindRightNullVector().
Product of a matrix with r rows and c columns by a vector with c elements. The output is a vector of r entries. The input and output vectors must be allocated externally. Here we assume they have the correct size.
Definition at line 599 of file basic_algebra.c. References RC2INDEX. Referenced by Local2Global(), and RefineSingularPoint().
Product of a transposed matrix with r rows and c columns by a vector with r elements. The output is a vector of c entries. The input and output vectors must be allocated externally. Here we assume they have the correct size.
Definition at line 615 of file basic_algebra.c. References RC2INDEX. Referenced by Chart2Manifold(), GradientSmooth(), Manifold2Chart(), MinCosinusBetweenSubSpaces(), and RefineSingularPoint().
Product of a transposed matrix with r rows and c columns by a vector with r elements where the elements are separeted by stride positions. The output is a vector of c entries. The input and output vectors must be allocated externally. Here we assume they have the correct size.
Definition at line 631 of file basic_algebra.c. References RC2INDEX. Referenced by MinCosinusBetweenSubSpaces().
Computes the product of a matrix by another matrix.
Definition at line 647 of file basic_algebra.c. References RC2INDEX.
Computes the product of a matrix transposed by another matrix.
Definition at line 672 of file basic_algebra.c. References RC2INDEX. Referenced by CompareTangentSpaces(), and FindRightNullVector().
We determine the cosinus of the maximum angle between tangent spaces. Note that we actually return the minimum of the absolute values of the cosinus. This is so since aligned tangent spaces form an angle of 0 or of pi (with cosinus 1 or -1 respectively). In other words, for subspaces to be equal this function shouls return 1. If the output is 0, the subspaces are orthogonal. In any case, we assume that the matrices defining the subspaces are orthonormal.
Definition at line 697 of file basic_algebra.c. References NEW, Norm(), RC2INDEX, TMatrixVectorProduct(), and TMatrixVectorStrideProduct(). Referenced by MinCosinusBetweenCharts().
Inserts a matrix as a submatrix of a larger matrix.
Definition at line 741 of file basic_algebra.c. References RC2INDEX. Referenced by EvaluateJacobianInVector(), EvaluateJacobianSubSetInVector(), EvaluateTransposedJacobianInVector(), EvaluateTransposedJacobianSubSetInVector(), and RefineSingularPoint().
Inserts a transposed matrix as a submatrix of a larger matrix.
Definition at line 785 of file basic_algebra.c. References RC2INDEX. Referenced by Chart2Manifold(), GetChartDegree(), and RefineSingularPoint().
Prints a vector into a file.
Definition at line 829 of file basic_algebra.c. Referenced by ComputeJacobianKernelBasis(), and GetChartDegree().
Prints a matrix into a file.
Definition at line 841 of file basic_algebra.c. References RC2INDEX. Referenced by FindRightNullVector(), and GetChartDegree().
Prints a transposed matrix into a file.
Definition at line 857 of file basic_algebra.c. References RC2INDEX. Referenced by ComputeJacobianKernelBasis(), and FindRightNullVector(). |
Follow us!