Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91952193
common.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 16, 01:55
Size
1 KB
Mime Type
text/x-c
Expires
Mon, Nov 18, 01:55 (2 d)
Engine
blob
Format
Raw Data
Handle
22353055
Attached To
rMSPPROTO µSpectre prototype implementation
common.hh
View Options
/**
* file common.hh
*
* @author Till Junge <till.junge@epfl.ch>
*
* @date 01 May 2017
*
* @brief Small definitions of commonly used types througout µSpectre
*
* @section LICENCE
*
* Copyright (C) 2017 Till Junge
*
* µSpectre 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, or (at
* your option) any later version.
*
* µSpectre 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 GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <array>
#include <complex>
#include <iostream>
#ifndef COMMON_H
#define COMMON_H
namespace muSpectre {
using Dim_t = int;// needs to represent -1 for eigen
const Dim_t oneD{1};
const Dim_t twoD{2};
const Dim_t threeD{3};
//! Ccoord_t are cell coordinates, i.e. integer coordinates
template<Dim_t dim>
using Ccoord_t = std::array<Dim_t, dim>;
template<size_t dim>
std::ostream & operator << (std::ostream & os, const Ccoord_t<dim> & index) {
os << "(";
for (size_t i = 0; i < dim-1; ++i) {
os << index[i] << ", ";
}
os << index.back() << ")";
return os;
}
using Uint = unsigned int;
using Int = int;
using Real = double;
using Complex = std::complex<Real>;
} // muSpectre
#endif /* COMMON_H */
Event Timeline
Log In to Comment