1 #ifndef MADNESS_STDARRAY_BITS_H
2 #define MADNESS_STDARRAY_BITS_H
10 template <
typename T, std::
size_t N>
28 iterator
end() {
return elems+
N; }
29 const_iterator
end()
const {
return elems+
N; }
36 const_reverse_iterator
rbegin()
const {
40 const_reverse_iterator
rend()
const {
46 const_reference
operator[](size_type i)
const {
return elems[i]; }
49 reference
at(size_type i) { rangecheck(i);
return elems[i]; }
50 const_reference
at(size_type i)
const { rangecheck(i);
return elems[i]; }
53 reference
front() {
return elems[0]; }
54 const_reference
front()
const {
return elems[0]; }
55 reference
back() {
return elems[
N-1]; }
56 const_reference
back()
const {
return elems[
N-1]; }
59 static size_type
size() {
return N; }
60 static bool empty() {
return false; }
76 template <
typename T2>
90 static void rangecheck (size_type i) {
92 throw std::out_of_range(
"array<>: index out of range");
113 iterator
begin() {
return reinterpret_cast< iterator
>( &
c ); }
114 const_iterator
begin()
const {
return reinterpret_cast< const_iterator
>( &
c ); }
115 iterator
end() {
return reinterpret_cast< iterator
>( &
c ); }
116 const_iterator
end()
const {
return reinterpret_cast< const_iterator
>( &
c ); }
127 const_reverse_iterator
rend()
const {
132 reference
at(size_type i) {
135 const_reference
at(size_type i)
const {
140 static size_type
size() {
return 0; }
141 static bool empty() {
return true; }
151 const T*
data()
const {
return NULL; }
155 template <
typename T2 >
164 const_reference
operator[](size_type i)
const { makes_no_sense(); }
167 reference
front() { makes_no_sense(); }
168 const_reference
front()
const { makes_no_sense(); }
169 reference
back() { makes_no_sense(); }
170 const_reference
back()
const { makes_no_sense(); }
175 static void makes_no_sense () {
177 throw std::out_of_range(
"array<0>: index out of range");
182 template<
class T, std::
size_t N>
186 template<
class T, std::
size_t N>
188 return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
190 template<
class T, std::
size_t N>
194 template<
class T, std::
size_t N>
198 template<
class T, std::
size_t N>
202 template<
class T, std::
size_t N>
208 template<
class T, std::
size_t N>
void assign(const T &value)
Definition: stdarray_bits.h:83
const_reverse_iterator rend() const
Definition: stdarray_bits.h:40
T * iterator
Definition: stdarray_bits.h:105
bool operator>(const array< T, N > &x, const array< T, N > &y)
Definition: stdarray_bits.h:195
T * data()
Definition: stdarray_bits.h:152
reverse_iterator rbegin()
Definition: stdarray_bits.h:122
std::ptrdiff_t difference_type
Definition: stdarray_bits.h:110
void swap(array< T, N > &y)
Definition: stdarray_bits.h:65
static size_type max_size()
Definition: stdarray_bits.h:61
const_reverse_iterator rend() const
Definition: stdarray_bits.h:127
reference back()
Definition: stdarray_bits.h:169
bool operator==(const array< T, N > &x, const array< T, N > &y)
Definition: stdarray_bits.h:183
reference at(size_type i)
Definition: stdarray_bits.h:49
reference at(size_type i)
Definition: stdarray_bits.h:132
std::reverse_iterator< iterator > reverse_iterator
Definition: stdarray_bits.h:32
const_iterator end() const
Definition: stdarray_bits.h:116
std::size_t size_type
Definition: stdarray_bits.h:109
void swap(array< T, N > &x, array< T, N > &y)
Definition: stdarray_bits.h:209
reference back()
Definition: stdarray_bits.h:55
reverse_iterator rend()
Definition: stdarray_bits.h:126
const T * data() const
Definition: stdarray_bits.h:151
reverse_iterator rbegin()
Definition: stdarray_bits.h:35
const_reference back() const
Definition: stdarray_bits.h:56
const T * const_iterator
Definition: stdarray_bits.h:106
static bool empty()
Definition: stdarray_bits.h:141
const_reverse_iterator rbegin() const
Definition: stdarray_bits.h:36
const_iterator end() const
Definition: stdarray_bits.h:29
Array idential to C++0X arrays.
Definition: stdarray_bits.h:11
const T * const_iterator
Definition: stdarray_bits.h:19
const T & const_reference
Definition: stdarray_bits.h:108
static bool empty()
Definition: stdarray_bits.h:60
const_reference operator[](size_type i) const
Definition: stdarray_bits.h:46
void swap(array< T, 0 > &y)
Definition: stdarray_bits.h:146
iterator begin()
Definition: stdarray_bits.h:113
T * iterator
Definition: stdarray_bits.h:18
T elems[N]
Definition: stdarray_bits.h:13
reference operator[](size_type i)
Definition: stdarray_bits.h:163
const_reverse_iterator rbegin() const
Definition: stdarray_bits.h:123
iterator end()
Definition: stdarray_bits.h:115
std::reverse_iterator< iterator > reverse_iterator
Definition: stdarray_bits.h:119
const_reference operator[](size_type i) const
Definition: stdarray_bits.h:164
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
std::ptrdiff_t difference_type
Definition: stdarray_bits.h:23
const_reference back() const
Definition: stdarray_bits.h:170
const_reference front() const
Definition: stdarray_bits.h:168
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence. ...
Definition: mra.h:1835
static size_type size()
Definition: stdarray_bits.h:59
const double N
Definition: navstokes_cosines.cc:94
bool operator!=(const array< T, N > &x, const array< T, N > &y)
Definition: stdarray_bits.h:191
T & reference
Definition: stdarray_bits.h:20
const_iterator begin() const
Definition: stdarray_bits.h:114
char c
Definition: stdarray_bits.h:100
const_reference at(size_type i) const
Definition: stdarray_bits.h:50
const_reference at(size_type i) const
Definition: stdarray_bits.h:135
const T & const_reference
Definition: stdarray_bits.h:21
reference front()
Definition: stdarray_bits.h:53
Definition: stdarray_bits.h:98
const T * data() const
Definition: stdarray_bits.h:70
iterator begin()
Definition: stdarray_bits.h:26
reference front()
Definition: stdarray_bits.h:167
T & reference
Definition: stdarray_bits.h:107
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: stdarray_bits.h:33
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: stdarray_bits.h:120
T * data()
Definition: stdarray_bits.h:73
const_iterator begin() const
Definition: stdarray_bits.h:27
array< T, N > & operator=(const array< T2, N > &rhs)
Definition: stdarray_bits.h:77
bool operator>=(const array< T, N > &x, const array< T, N > &y)
Definition: stdarray_bits.h:203
T value_type
Definition: stdarray_bits.h:17
Definition: stdarray_bits.h:62
const_reference front() const
Definition: stdarray_bits.h:54
T value_type
Definition: stdarray_bits.h:104
reverse_iterator rend()
Definition: stdarray_bits.h:39
static size_type max_size()
Definition: stdarray_bits.h:142
reference operator[](size_type i)
Definition: stdarray_bits.h:45
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
const double c
Definition: gfit.cc:200
static size_type size()
Definition: stdarray_bits.h:140
std::size_t size_type
Definition: stdarray_bits.h:22
iterator end()
Definition: stdarray_bits.h:28