#ifndef _VEC_H_ #define _VEC_H_ #include #include #include #include "Mat.h" /** * @addtogroup math * @{ * @author Philipp Schoenberger * @version 2.0 * * @section LICENSE * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program 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 * General Public License for more details at * https://www.gnu.org/copyleft/gpl.html * * @section DESCRIPTION * * This file contains the Trajectory for a linear trajectory * The linear trajectory only uses the max speed and ignores * the acceleration parameter. * The movement is a strict hard acceleration and deacceration. * * The slowest joint is defining the speed of the other joints. * By that all joints start and stop the movement synchronously */ template class Vec; template class Mat; /** * Vector class for class and simple data types * template with type and size of the vector * * @author Philipp Schoenberger * @copyright 2012 philipp schoenberger All rights reserved. * @license This project is released under the GNU Public License. */ template class Vec { public: /** * standard constructor */ Vec () { // initialize all elements with zero for (unsigned int i=0; i (const T tData) { for (unsigned int i=0; i (const T atData[SIZE]) { for (unsigned int i=0; i (const Vec &vec) { if (this==&vec) return; // nothing to do, it's me for (unsigned int i=0; i &operator = (const Vec &vec) { /// check if the L and R values are the same /// do nothing in this case if (this==&vec) return (*this); /// not the same values so copy content data for (unsigned int i=0; i &operator = (const T atData[SIZE]) { for (unsigned int i=0; i static std::ostream& operator<< (std::ostream& output,const Vec &vec) { output << "( "; for(unsigned int i = 0 ; i< SIZE; ++i) { output << vec(i); if (i