From 0cea5c25c4125368299cdfd7ac50ff92cf7403e4 Mon Sep 17 00:00:00 2001
From: Stephen Roderick <kiwi.net@mac.com>
Date: Tue, 4 May 2010 14:46:32 -0400
Subject: [PATCH] Correctly declare friends functions to make them externally available

---
 src/jntarray.hpp |  136 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 72 insertions(+), 64 deletions(-)

diff --git a/src/jntarray.hpp b/src/jntarray.hpp
index 03275c4..8e25b1f 100644
--- a/src/jntarray.hpp
+++ b/src/jntarray.hpp
@@ -135,76 +135,13 @@ class MyTask : public RTT::TaskContext
          */
         unsigned int columns()const;
 
-        /**
-         * Function to add two joint arrays, all the arguments must
-         * have the same size: A + B = C. This function is
-         * aliasing-safe, A or B can be the same array as C.
-         *
-         * @param src1 A
-         * @param src2 B
-         * @param dest C
-         */
         friend void Add(const JntArray& src1,const JntArray& src2,JntArray& dest);
-        /**
-         * Function to subtract two joint arrays, all the arguments must
-         * have the same size: A - B = C. This function is
-         * aliasing-safe, A or B can be the same array as C.
-         *
-         * @param src1 A
-         * @param src2 B
-         * @param dest C
-         */
         friend void Subtract(const JntArray& src1,const JntArray& src2,JntArray& dest);
-        /**
-         * Function to multiply all the array values with a scalar
-         * factor: A*b=C. This function is aliasing-safe, A can be the
-         * same array as C.
-         *
-         * @param src A
-         * @param factor b
-         * @param dest C
-         */
         friend void Multiply(const JntArray& src,const double& factor,JntArray& dest);
-        /**
-         * Function to divide all the array values with a scalar
-         * factor: A/b=C. This function is aliasing-safe, A can be the
-         * same array as C.
-         *
-         * @param src A
-         * @param factor b
-         * @param dest C
-         */
         friend void Divide(const JntArray& src,const double& factor,JntArray& dest);
-        /**
-         * Function to multiply a KDL::Jacobian with a KDL::JntArray
-         * to get a KDL::Twist, it should not be used to calculate the
-         * forward velocity kinematics, the solver classes are built
-         * for this purpose.
-         * J*q = t
-         *
-         * @param jac J
-         * @param src q
-         * @param dest t
-         * @post dest==Twist::Zero() if 0==src.rows() (ie src is empty)
-         */
         friend void MultiplyJacobian(const Jacobian& jac, const JntArray& src, Twist& dest);
-        /**
-         * Function to set all the values of the array to 0
-         *
-         * @param array
-         */
         friend void SetToZero(JntArray& array);
-        /**
-         * Function to check if two arrays are the same with a
-         *precision of eps
-         *
-         * @param src1
-         * @param src2
-         * @param eps default: epsilon
-         * @return true if each element of src1 is within eps of the same
-		 * element in src2, or if both src1 and src2 have no data (ie 0==rows())
-         */
-        friend bool Equal(const JntArray& src1,const JntArray& src2,double eps=epsilon);
+        friend bool Equal(const JntArray& src1,const JntArray& src2,double eps);
 
         friend bool operator==(const JntArray& src1,const JntArray& src2);
         //friend bool operator!=(const JntArray& src1,const JntArray& src2);
@@ -213,6 +150,77 @@ class MyTask : public RTT::TaskContext
     bool operator==(const JntArray& src1,const JntArray& src2);
     //bool operator!=(const JntArray& src1,const JntArray& src2);
 
+    /**
+     * Function to add two joint arrays, all the arguments must
+     * have the same size: A + B = C. This function is
+     * aliasing-safe, A or B can be the same array as C.
+     *
+     * @param src1 A
+     * @param src2 B
+     * @param dest C
+     */
+    void Add(const JntArray& src1,const JntArray& src2,JntArray& dest);
+    /**
+     * Function to subtract two joint arrays, all the arguments must
+     * have the same size: A - B = C. This function is
+     * aliasing-safe, A or B can be the same array as C.
+     *
+     * @param src1 A
+     * @param src2 B
+     * @param dest C
+     */
+    void Subtract(const JntArray& src1,const JntArray& src2,JntArray& dest);
+    /**
+     * Function to multiply all the array values with a scalar
+     * factor: A*b=C. This function is aliasing-safe, A can be the
+     * same array as C.
+     *
+     * @param src A
+     * @param factor b
+     * @param dest C
+     */
+    void Multiply(const JntArray& src,const double& factor,JntArray& dest);
+    /**
+     * Function to divide all the array values with a scalar
+     * factor: A/b=C. This function is aliasing-safe, A can be the
+     * same array as C.
+     *
+     * @param src A
+     * @param factor b
+     * @param dest C
+     */
+    void Divide(const JntArray& src,const double& factor,JntArray& dest);
+    /**
+     * Function to multiply a KDL::Jacobian with a KDL::JntArray
+     * to get a KDL::Twist, it should not be used to calculate the
+     * forward velocity kinematics, the solver classes are built
+     * for this purpose.
+     * J*q = t
+     *
+     * @param jac J
+     * @param src q
+     * @param dest t
+     * @post dest==Twist::Zero() if 0==src.rows() (ie src is empty)
+     */
+    void MultiplyJacobian(const Jacobian& jac, const JntArray& src, Twist& dest);
+    /**
+     * Function to set all the values of the array to 0
+     *
+     * @param array
+     */
+    void SetToZero(JntArray& array);
+    /**
+     * Function to check if two arrays are the same with a
+     *precision of eps
+     *
+     * @param src1
+     * @param src2
+     * @param eps default: epsilon
+     * @return true if each element of src1 is within eps of the same
+     * element in src2, or if both src1 and src2 have no data (ie 0==rows())
+     */
+    bool Equal(const JntArray& src1,const JntArray& src2,double eps=epsilon);
+
 }
 
 #endif
-- 
1.7.0.2

