20 #ifndef TILEDARRAY_SIZE_ARRAY_H__INCLUDED 21 #define TILEDARRAY_SIZE_ARRAY_H__INCLUDED 63 first_(first), last_(last)
67 first_(first), last_(first + n)
90 std::copy(std::begin(other), std::end(other), first_);
95 operator std::vector<U> ()
const {
96 return std::vector<U>(first_, last_);
99 template <
typename U, std::
size_t N>
100 operator std::array<U, N> ()
const {
102 std::array<U, N> temp;
161 bool empty()
const {
return first_ == NULL; }
179 template <
typename U>
181 if(first_ == other.
data())
184 const std::size_t n =
size();
185 if(n != other.
size())
188 for(std::size_t i = 0; i < n; ++i)
189 if(first_[i] != other[i])
195 template <
typename U>
197 if(first_ == other.
data())
200 const std::size_t n =
size();
201 if(n != other.
size())
204 for(std::size_t i = 0; i < n; ++i)
205 if(first_[i] == other[i])
221 template <
typename Arg,
typename Op>
222 void binary(
const Arg*
const arg,
const Op& op) {
237 template <
typename Left,
typename Right,
typename Op>
238 void binary(
const Left*
const left,
const Right*
const right,
const Op& op) {
248 template <
typename Op>
262 template <
typename Arg,
typename Op>
263 void unary(
const Arg*
const arg,
const Op& op) {
282 template <
typename Arg,
typename Result,
typename ReduceOp,
typename JoinOp>
283 Result
reduce(
const Arg*
const arg, Result result,
const ReduceOp&
reduce_op,
const JoinOp& join_op)
const {
301 template <
typename Result,
typename ReduceOp,
typename JoinOp>
302 Result
reduce(Result result,
const ReduceOp&
reduce_op,
const JoinOp& join_op)
const {
318 template <
typename Left,
typename Right,
typename Op>
332 template <
typename Arg,
typename Op>
349 template <
typename Left,
typename Right,
typename Op>
363 template <
typename Arg,
typename Op>
380 template <
typename Left,
typename Right,
typename Op>
382 const Right*
const right,
const Op& op)
400 template <
typename Left,
typename Right,
typename Op>
402 const Right*
const right,
const Op& op)
422 template <
typename Left,
typename Right,
typename Base,
typename Op>
424 const Right*
const right,
const Base*
const base,
const Op& op)
436 template <
typename T>
438 std::vector<T> result(orig.
size());
443 template <
typename T>
444 inline std::ostream& operator<<(std::ostream& os, const SizeArray<T>& size_array) {
452 #endif // TILEDARRAY_SIZE_ARRAY_H__INCLUDED
const_reference back() const
void row_reduce(const std::size_t m, const std::size_t n, const Left *MADNESS_RESTRICT const left, const Right *MADNESS_RESTRICT const right, Result *MADNESS_RESTRICT const result, const Op &op)
Reduce the rows of a matrix.
std::enable_if<!(std::is_same< Arg, Result >::value &&std::is_scalar< Arg >::value)>::type copy_vector(const std::size_t n, const Arg *const arg, Result *const result)
SizeArray< T > & operator=(const SizeArray< T > &other)
size_type max_size() const
const_iterator begin() const
void outer_fill(const size_type m, const size_type n, const Left *const left, const Right *const right, const Op &op)
Outer fill operation.
void permute_array(const Perm &perm, const Arg &arg, Result &result)
Create a permuted copy of an array.
std::reverse_iterator< iterator > reverse_iterator
void col_reduce(const size_type m, const Left *const left, const Right *right, const Op &op)
Column reduce operation.
std::ptrdiff_t difference_type
const_reference at(size_type i) const
const_pointer data() const
reference operator[](size_type i)
void col_reduce(const size_type m, const Arg *const arg, const Op &op)
Columns reduce operation.
reverse_iterator rbegin()
void row_reduce(const size_type n, const Left *const left, const Right *right, const Op &op)
Row reduce operation.
void outer(const std::size_t m, const std::size_t n, const X *const x, const Y *const y, A *a, const Op &op)
Compute the outer of x and y to modify a.
void fill_vector(const std::size_t n, const Arg &arg, Result *const result)
void assign(const_reference value)
Result reduce(Result result, const ReduceOp &reduce_op, const JoinOp &join_op) const
Unary reduction operation.
void outer_fill(const size_type m, const size_type n, const Left *const left, const Right *const right, const Base *const base, const Op &op)
Outer operation.
const T & const_reference
void row_reduce(const size_type n, const Arg *const arg, const Op &op)
Row reduce operation.
void outer_fill(const std::size_t m, const std::size_t n, const X *const x, const Y *const y, A *a, const Op &op)
Compute and store outer of x and y in a.
void vector_op(Op &&op, const std::size_t n, Result *const result, const Args *const ... args)
void print_array(std::ostream &out, const A &a, const std::size_t n)
Print the content of an array like object.
SizeArray(pointer const first, const size_type n)
void binary(const Left *const left, const Right *const right, const Op &op)
Binary vector operation.
void reduce_op(ReduceOp &&reduce_op, JoinOp &&join_op, const Result &identity, const std::size_t n, Result &result, const Args *const ... args)
reference at(size_type i)
void unary(const Arg *const arg, const Op &op)
Unary vector operation.
SizeArray< T > & operator=(const U &other)
DistArray< Tile, Policy > copy(const DistArray< Tile, Policy > &a)
const_iterator end() const
void binary(const Arg *const arg, const Op &op)
Binary vector operation.
std::vector< T > operator*(const Permutation &perm, const SizeArray< T > &orig)
std::reverse_iterator< const_iterator > const_reverse_iterator
Permutation of a sequence of objects indexed by base-0 indices.
Result reduce(const Arg *const arg, Result result, const ReduceOp &reduce_op, const JoinOp &join_op) const
Binary reduction operation.
bool operator!=(const SizeArray< U > &other) const
const_reference operator[](size_type i) const
void swap(SizeArray< T > &other)
const_reverse_iterator rbegin() const
void unary(const Op &op)
Unary vector operation.
const_reverse_iterator rend() const
void outer(const size_type m, const size_type n, const Left *const left, const Right *const right, const Op &op)
Outer operation.
bool operator==(const SizeArray< U > &other) const
void col_reduce(const std::size_t m, const std::size_t n, const Left *MADNESS_RESTRICT const left, const Right *MADNESS_RESTRICT const right, Result *MADNESS_RESTRICT const result, const Op &op)
Reduce the columns of a matrix.
const_reference front() const
SizeArray(pointer const first, pointer const last)