DoorKeeper/include/doorkeeper/implem/coords_utils.hpp

43 lines
1.3 KiB
C++

/* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef id2FC7119D67FA4704B5FE8A9FDA148F46
#define id2FC7119D67FA4704B5FE8A9FDA148F46
#include "doorkeeper/primitivetypes.hpp"
#include <cstdint>
namespace dk {
template <uint32_t D>
typename Vector<D>::scalar_type tile_volume ( const Vector<D>& parVec ) a_pure;
template <uint32_t D>
inline
typename Vector<D>::scalar_type tile_volume (const Vector<D>& parVec) {
typedef typename Vector<D>::scalar_type scalar_type;
scalar_type ret_val((1));
for (uint32_t z = 0; z < D; ++z) {
ret_val *= parVec[z];
}
return ret_val;
}
} //namespace dk
#endif