/* Copyright 2015, Michele Santullo * This file is part of DoorKeeper. * * DoorKeeper 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 3 of the License, or * (at your option) any later version. * * DoorKeeper 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. * * You should have received a copy of the GNU General Public License * along with DoorKeeper. If not, see . */ #ifndef id134A9223C9F7403B9BC600DCAC4875BC #define id134A9223C9F7403B9BC600DCAC4875BC #include "vectorwrapper/vectorwrapper.hpp" #include #include #include #if defined(WITH_VECTOR_IOSTREAM) # include #endif namespace vwr { template struct VectorWrapperInfo> { enum { dimensions = D }; typedef T scalar_type; typedef std::array vector_type; typedef std::array higher_vector_type; typedef std::array lower_vector_type; static scalar_type& get_at (std::size_t parIndex, vector_type& parVector) { return parVector[parIndex]; } }; template struct VectorWrapperInfo> { enum { dimensions = 1 }; typedef T scalar_type; typedef std::array vector_type; typedef std::array higher_vector_type; static scalar_type& get_at (std::size_t, vector_type& parVector) { return parVector[0]; } }; #if defined(WITH_VECTOR_IOSTREAM) template std::ostream& operator<< (std::ostream& parStream, const vwr::Vec& parVec) { const int dim = vwr::Vec::dimensions; parStream << '<'; for (int z = 0; z < dim - 1; ++z) { parStream << parVec[z] << ", "; } parStream << parVec[dim - 1] << '>'; return parStream; } #endif } //namespace vwr #endif