C++QEDCore  v2 Milestone 10
a framework for simulating open quantum dynamics – core
ArrayTraits.h
Go to the documentation of this file.
1 // Copyright András Vukics 2006–2014. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)
3 // -*- C++ -*-
4 #ifndef CPPQEDCORE_UTILS_ARRAYTRAITS_H_INCLUDED
5 #define CPPQEDCORE_UTILS_ARRAYTRAITS_H_INCLUDED
6 
7 #include <string>
8 #include <vector>
9 
10 namespace cpputils {
11 
12 
14 template<typename A>
15 struct Rank;
16 
18 template<typename A>
19 struct TypeID;
20 
22 template<typename A>
23 struct ElementType;
24 
25 
27 
28 
29 
30 template<typename A>
31 bool isStorageContiguous(const A& a);
32 
33 
34 template<typename A>
35 size_t size(const A& a);
36 
37 template<typename A>
38 std::vector<size_t> dimensions(const A& a);
39 
40 
41 
42 template<typename A>
43 const double* data(const A& a);
44 
45 template<typename A>
46  double* data( A& a);
47 
48 
49 
50 template<typename A>
51  A create( double* y, const A& a);
52 
53 template<typename A>
54 const A create(const double* y, const A& a);
55 
56 
57 template<typename A>
58 A create(const A& a);
59 
60 
61 
62 
64 
65 
67 
71 template<typename A>
72 const typename A::element_type& subscript(const A& a, size_t i);
73 
74 
76 template<typename A>
77  typename A::element_type& subscript( A& a, size_t i);
78 
79 
80 template<typename A>
81 size_t subscriptLimit(const A& a);
82 
84 
85 } // cpputils
86 
87 
88 #endif // CPPQEDCORE_UTILS_ARRAYTRAITS_H_INCLUDED
template metafunction providing an identifier string for the multi-array A
Definition: ArrayTraits.h:19
Namespace comprising otherwise hard-to-classify generic utilities.
Definition: Algorithm.h:10
template metafunction for the rank (arity) of the multi-array A
Definition: ArrayTraits.h:15
template metafunction returning (by convention, as a member typedef type) the type of elements of the...
Definition: ArrayTraits.h:23
A create(double *y, const A &a)
Clone (create a non-owning array of data y of the same memory layout as a)
const A::element_type & subscript(const A &a, size_t i)
subscription of a (which might be a multi-array) with a single integer