/** \file itasc/kdl/jntarray.cpp * \ingroup itasc */ // Copyright (C) 2007 Ruben Smits // Version: 1.0 // Author: Ruben Smits // Maintainer: Ruben Smits // URL: http://www.orocos.org/kdl // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "jntarray.hpp" namespace KDL { JntArray::JntArray(): size(0), data(NULL) { } JntArray::JntArray(unsigned int _size): size(_size) { assert(0 < size); data = new double[size]; SetToZero(*this); } JntArray::JntArray(const JntArray& arg): size(arg.size) { data = ((0 < size) ? new double[size] : NULL); for(unsigned int i=0;i=size) return NULL; return &data[i]; } unsigned int JntArray::rows()const { return size; } unsigned int JntArray::columns()const { return 0; } void Add(const JntArray& src1,const JntArray& src2,JntArray& dest) { assert(src1.size==src2.size&&src1.size==dest.size); for(unsigned int i=0;i