mcpele
1.0.0
The Monte Carlo Python Energy Landscape Explorer
|
#include <array.h>
Public Types | |
typedef dtype * | iterator |
typedef dtype const * | const_iterator |
Public Member Functions | |
Array () | |
Array (size_t size) | |
Array (size_t size, dtype const &val) | |
Array (dtype *data, size_t size) | |
Array (std::vector< dtype > &x) | |
void | wrap (Array< dtype > x) |
dtype * | data () |
dtype const * | data () const |
size_t | size () const |
dtype & | operator[] (const size_t i) |
dtype const & | operator[] (const size_t i) const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
bool | operator== (Array< dtype > const rhs) const |
bool | operator!= (Array< dtype > const rhs) const |
Array< dtype > & | assign (const Array< dtype > &rhs) |
Array< dtype > & | assign (dtype const &d) |
Array< dtype > | copy () const |
void | free () |
bool | empty () const |
long int | reference_count () const |
Array< dtype > & | operator+= (const Array< dtype > &rhs) |
Array< dtype > & | operator+= (const dtype &rhs) |
Array< dtype > & | operator-= (const Array< dtype > &rhs) |
Array< dtype > & | operator-= (const dtype &rhs) |
Array< dtype > & | operator*= (const Array< dtype > &rhs) |
Array< dtype > & | operator*= (const dtype &rhs) |
Array< dtype > & | operator/= (const Array< dtype > &rhs) |
Array< dtype > & | operator/= (const dtype &rhs) |
dtype | sum () const |
dtype | prod () const |
Array< dtype > | view (size_t ibegin, size_t iend) const |
dtype | get_max () const |
dtype | get_min () const |
typedef dtype const* pele::Array< dtype >::const_iterator |
typedef dtype* pele::Array< dtype >::iterator |
pele::Array< dtype >::Array | ( | ) | [inline] |
pele::Array< dtype >::Array | ( | size_t | size | ) | [inline] |
pele::Array< dtype >::Array | ( | size_t | size, |
dtype const & | val | ||
) | [inline] |
pele::Array< dtype >::Array | ( | dtype * | data, |
size_t | size | ||
) | [inline] |
pele::Array< dtype >::Array | ( | std::vector< dtype > & | x | ) | [inline] |
Array<dtype>& pele::Array< dtype >::assign | ( | const Array< dtype > & | rhs | ) | [inline] |
Array<dtype>& pele::Array< dtype >::assign | ( | dtype const & | d | ) | [inline] |
iterator pele::Array< dtype >::begin | ( | ) | [inline] |
const_iterator pele::Array< dtype >::begin | ( | ) | const [inline] |
Array<dtype> pele::Array< dtype >::copy | ( | ) | const [inline] |
dtype* pele::Array< dtype >::data | ( | ) | [inline] |
dtype const* pele::Array< dtype >::data | ( | ) | const [inline] |
bool pele::Array< dtype >::empty | ( | ) | const [inline] |
iterator pele::Array< dtype >::end | ( | ) | [inline] |
const_iterator pele::Array< dtype >::end | ( | ) | const [inline] |
void pele::Array< dtype >::free | ( | ) | [inline] |
dtype pele::Array< dtype >::get_max | ( | ) | const [inline] |
dtype pele::Array< dtype >::get_min | ( | ) | const [inline] |
bool pele::Array< dtype >::operator!= | ( | Array< dtype > const | rhs | ) | const [inline] |
Array<dtype>& pele::Array< dtype >::operator*= | ( | const Array< dtype > & | rhs | ) | [inline] |
Array<dtype>& pele::Array< dtype >::operator*= | ( | const dtype & | rhs | ) | [inline] |
Array<dtype>& pele::Array< dtype >::operator+= | ( | const Array< dtype > & | rhs | ) | [inline] |
Array<dtype>& pele::Array< dtype >::operator+= | ( | const dtype & | rhs | ) | [inline] |
Array<dtype>& pele::Array< dtype >::operator-= | ( | const Array< dtype > & | rhs | ) | [inline] |
Array<dtype>& pele::Array< dtype >::operator-= | ( | const dtype & | rhs | ) | [inline] |
Array<dtype>& pele::Array< dtype >::operator/= | ( | const Array< dtype > & | rhs | ) | [inline] |
Array<dtype>& pele::Array< dtype >::operator/= | ( | const dtype & | rhs | ) | [inline] |
bool pele::Array< dtype >::operator== | ( | Array< dtype > const | rhs | ) | const [inline] |
dtype& pele::Array< dtype >::operator[] | ( | const size_t | i | ) | [inline] |
dtype const& pele::Array< dtype >::operator[] | ( | const size_t | i | ) | const [inline] |
dtype pele::Array< dtype >::prod | ( | ) | const [inline] |
returns the product of all elements (reduces the array) References: http://www.cplusplus.com/reference/functional/multiplies/ http://en.cppreference.com/w/cpp/algorithm/accumulate http://rosettacode.org/wiki/Sum_and_product_of_an_array
long int pele::Array< dtype >::reference_count | ( | ) | const [inline] |
size_t pele::Array< dtype >::size | ( | ) | const [inline] |
dtype pele::Array< dtype >::sum | ( | ) | const [inline] |
Array<dtype> pele::Array< dtype >::view | ( | size_t | ibegin, |
size_t | iend | ||
) | const [inline] |
void pele::Array< dtype >::wrap | ( | Array< dtype > | x | ) | [inline] |
wrap another array is implemented by shared_ptr parent class
Note, the input here is a const array, but this constructs a modifiable array. This is a loophole around the const declaration, but i'm not sure there is any way around it. The compiler complains if this is not here. e.g. for constructions like Array(x.copy())
This is commented because it just duplicates the default copy constructor
Array(Array<dtype> const & x) : _memory(x._memory) _data(x._data), _size(x._size) {}