Detailed DescriptionHeader of the basic lineal algebra routines used in the CuikSuite. These are the routines that can be implemented using BLAS: vector and matrix manipulations (sums, differences, norms, products, etc). More complex operations (matrix decompositions, etc) are implemented in algebra.c and might use different libraries (gls, eigen, etc).
Definition in file basic_algebra.h.
Macro Definition Documentation
When using BLAS we inline the trivial numerical functions to gain some efficiency. Definition at line 48 of file basic_algebra.h.
Derermines the index in a vector of a given matrix element.
Definition at line 81 of file basic_algebra.h. Referenced by ColumnSquaredNorm(), CuikGradientInBox(), GetColumn(), GetRow(), LSSetMatrix(), MatrixMatrixProduct(), MatrixVectorProduct(), MinCosinusBetweenSubSpaces(), NewtonSetMatrix(), PrintMatrix(), PrintTMatrix(), RefineSingularPoint(), RowSquaredNorm(), SetColumn(), SetRow(), SubMatrixFromMatrix(), SubMatrixFromTMatrix(), TMatrixMatrixProduct(), TMatrixVectorProduct(), and TMatrixVectorStrideProduct(). 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(), GradientSmooth(), InsidePolytope(), InsideSPolytope(), PolytopeBoundaryPointFromExternalCornerInt(), RefineSingularPoint(), StepEffort(), and StepEffortGradient().
Multiplies all the elements of a vector by a given factor.
Definition at line 30 of file basic_algebra.c. Referenced by AddBorderConstraint(), AddBranchToRRT(), CDCallBackInfo(), ConnectSamplesChart(), DetermineSPolytopeNeighbour(), DistanceOnChart(), ExtendAtlasFromPoint(), ExtendAtlasTowardPoint(), FocusedPointOnBoundary(), GradientSmooth(), MinimizeOnAtlas(), NewChartFromPoint(), PathInChart(), PlotForceField(), PolytopeBoundaryPointFromExternalCornerInt(), StepDispersionGradient(), StepEffort(), StepEffortGradient(), StepLengthGradient(), 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 EvaluateTrans().
Adds a vector to another vector
Definition at line 55 of file basic_algebra.c. Referenced by AddBranchToAtlasRRT(), AddBranchToRRT(), ConnectSamplesChart(), EvaluateMEquationXVectors(), EvaluateTrans(), 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(), CombineGradients(), 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(), CuikGradientInBox(), EvaluateTrans(), EvaluateVectorsPATrans(), FindPointInOtherBranch(), FindSingularPoint(), GeodesicDistance(), GetJointDOFValues(), GetJointTransform(), InitWorldFromMolecule(), New_NewTemptativeSample(), New_PointTowardRandSample(), NewTemptativeSample(), NewTriangularPrism(), PointTowardRandSample(), StepDispersionGradient(), StepEffortGradient(), and StepLengthGradient().
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.
Scales a vector so that their values span a given range.
Definition at line 210 of file basic_algebra.c. Referenced by main().
Substracts a vector from another vector: v1=v1-v2
Definition at line 251 of file basic_algebra.c. Referenced by PolytopeBoundaryPointFromExternalCornerInt().
Substracts two vectors and stores the result in another vector: v=v1-v2
Definition at line 264 of file basic_algebra.c. Referenced by AdjustBioWorldGeometry(), Atoms2Transforms(), ConnectSamplesChart(), DifferenceVectorSubset(), DifferenceVectorTopology(), FindSingularPoint(), GetJointDOFValues(), InitPatchTrans(), InitWorldFromMolecule(), Manifold2Chart(), New_PointTowardRandSample(), NewTriangularPrism(), PointTowardRandSample(), StepEffort(), StepEffortGradient(), and TriangulateAtlas().
Substracts two vectors and stores the result in another vector: v=v1-v2 Only the selected components are operated. The rest are set to 0.
Definition at line 286 of file basic_algebra.c. References DifferenceVector(). Referenced by DifferenceVectorTopologySubset().
Substracts two vectors and stores the result in another vector considering the topology for each component.
Definition at line 306 of file basic_algebra.c. References DifferenceVector(), PI2PI, and TOPOLOGY_S. Referenced by AddBranchToAtlasRRT(), AddBranchToRRT(), Chart2Manifold(), ConnectSamples(), ConnectSamplesChart(), DifferenceVectorTopologySubset(), GeodesicDistance(), and Manifold2Chart().
Substracts two vectors and stores the result in another vector considering the topology for the selected components. The output for the non-selected components are set to 0.
Definition at line 325 of file basic_algebra.c. References DifferenceVectorSubset(), DifferenceVectorTopology(), PI2PI, and TOPOLOGY_S. Referenced by StepDispersionGradient(), StepEffort(), StepEffortGradient(), and StepLengthGradient().
Computes the norm of a vector with the given size.
Definition at line 356 of file basic_algebra.c. Referenced by AddBorderConstraint(), AddBranchToRRT(), ApplyLinkRot(), ApplyLinkRotAxisX(), ApplyLinkRotDeformX(), AtlasRRTSample(), CDCallBackInfo(), Chart2Manifold(), ConnectSamples(), ConnectSamplesChart(), CuikGradientInBox(), CuikNewtonInBox(), CutPolytope(), CutPolytopeWithFace(), CutSPolytope(), DetermineSPolytopeNeighbour(), DistanceOnChart(), ErrorInCSEquations(), ErrorInSimpCSEquations(), ErrorInSolution(), EvaluateTrans(), ExtendAtlasFromPoint(), ExtendAtlasTowardPoint(), GetJointDOFValues(), GetPolytopeInteriorPoint(), InsideSPolytope(), main(), Manifold2Chart(), MinCosinusBetweenSubSpaces(), MinimizeOnAtlas(), New_AddBranchToAtlasRRT(), New_NewTemptativeSample(), New_PointTowardRandSample(), NewChartFromPoint(), NewFixJoint(), NewInPatchJoint(), NewPrismaticJoint(), NewRevoluteJoint(), NewSphericalJoint(), NewTemptativeSample(), Newton2ManifoldPlane(), NewUniversalJoint(), Normalize(), PathInChart(), PlotForceField(), PointTowardRandSample(), PolytopeBoundaryPointFromExternalCornerInt(), ReconstructAtlasPath(), RefineSingularPoint(), StepDispersionGradient(), StepEffort(), StepEffortGradient(), and StepLengthGradient().
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 371 of file basic_algebra.c.
Computes the distance between two points given as a vector with a given size.
Definition at line 388 of file basic_algebra.c. Referenced by Distance(), DistanceTopology(), SquaredDistanceSubset(), and SquaredDistanceTopology().
Computes the distance between two points given as a vector with a given size along some of its components.
Definition at line 413 of file basic_algebra.c. References SquaredDistance(). Referenced by DistanceTopologySubset().
Computes the distance between two points given as a vector with a given size.
Definition at line 438 of file basic_algebra.c. References SquaredDistance(). Referenced by AddBranchToAtlasRRT(), AdjustBioWorldGeometry(), BioWorldRMSE(), CrossTopologyBorder(), DetermineChartNeighbours(), DistanceOnChart(), HTransformIsIdentity(), HTransformIsZero(), main(), New_AddBranchToAtlasRRT(), New_NewTemptativeSample(), NewTemptativeSample(), PathInChart(), ReadSTL(), and ReadTwoSamples().
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 443 of file basic_algebra.c. References M_PI, PI2PI, SquaredDistance(), and TOPOLOGY_S. Referenced by DistanceTopologySubset(), and 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 468 of file basic_algebra.c. References M_PI, PI2PI, and TOPOLOGY_S. Referenced by HaveChartAtPoint().
Computes the distance between two points given as a vector with a given size and considering the topology for each components.
Definition at line 498 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(), InitBranchStatus(), IntersectChartsInt(), New_AddBranchToAtlasRRT(), New_NewTemptativeSample(), NewTemptativeSample(), PathInChart(), PathStart2GoalInRRT(), PointOnChart(), RecursiveReWireRRTstar(), RRTPathLength(), RRTstar(), and RRTValidateSample().
Computes the distance between two points given as a vector with a given size and considering the topology for the selected components.
Definition at line 522 of file basic_algebra.c. References M_PI, PI2PI, SquaredDistanceSubset(), SquaredDistanceTopology(), and TOPOLOGY_S. Referenced by ConnectSamples(), ConnectSamplesChart(), PathLength(), StepDispersion(), StepDispersionGradient(), and StepLength().
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 556 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 587 of file basic_algebra.c. References Distance(), and DistanceTopology(). Referenced by TriangulateAtlas().
Normalizes a generic vector with the given size.
Definition at line 592 of file basic_algebra.c. References Error(), and Norm(). Referenced by Atoms2Transforms(), EvaluatePATrans(), GetJointDOFValues(), GetJointTransform(), GetTransform2LinkAxisX(), New_PointTowardRandSample(), NewTriangularPrism(), and PointTowardRandSample().
Computes the mean of an array of doubles.
Definition at line 616 of file basic_algebra.c. Referenced by PrintAverages().
Computes the sample standard deviation of an array of doubles.
Definition at line 628 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 646 of file basic_algebra.c. References PI2PI, and TOPOLOGY_S. Referenced by AddChart2Btree(), AddNodeToRRT(), Chart2Manifold(), ConnectSamples(), ConnectSamplesChart(), CuikGradientInBox(), CuikNewtonInBox(), CuikNewtonSimp(), InitChartInt(), Local2Global(), Manifold2Chart(), Newton2ManifoldPlane(), RefineSingularPoint(), and SearchInBtree().
Defines a vector taking the values from the row of a matrix.
Definition at line 659 of file basic_algebra.c. References RC2INDEX.
Defines a vector taking the values from the column of a matrix.
Definition at line 671 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 683 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 695 of file basic_algebra.c. References RC2INDEX.
Computes the squared norm of a row of a matrix.
Definition at line 707 of file basic_algebra.c. References RC2INDEX.
Computes the squared norm of a column of a matrix.
Definition at line 728 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 749 of file basic_algebra.c. References RC2INDEX. Referenced by Local2Global(), RefineSingularPoint(), and StepEffortGradient().
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 765 of file basic_algebra.c. References RC2INDEX. Referenced by Chart2Manifold(), CuikGradientInBox(), Manifold2Chart(), MinCosinusBetweenSubSpaces(), MinimizeOnAtlas(), RefineSingularPoint(), StepDispersionGradient(), StepEffort(), StepEffortGradient(), and StepLengthGradient().
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 781 of file basic_algebra.c. References RC2INDEX. Referenced by MinCosinusBetweenSubSpaces().
Computes the product of a matrix by another matrix.
Definition at line 797 of file basic_algebra.c. References RC2INDEX.
Computes the product of a matrix transposed by another matrix.
Definition at line 822 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 847 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 891 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 935 of file basic_algebra.c. References RC2INDEX. Referenced by Chart2Manifold(), GetChartDegree(), and RefineSingularPoint().
Prints a vector into a file.
Definition at line 979 of file basic_algebra.c. Referenced by ComputeJacobianKernelBasis(), and GetChartDegree().
Saves a vector into a file.
Definition at line 991 of file basic_algebra.c. Referenced by main().
Prints a matrix into a file.
Definition at line 1000 of file basic_algebra.c. References RC2INDEX. Referenced by FindRightNullVector(), and GetChartDegree().
Prints a transposed matrix into a file.
Definition at line 1016 of file basic_algebra.c. References RC2INDEX. Referenced by ComputeJacobianKernelBasis(), and FindRightNullVector(). |
Follow us!