1#ifndef MPQC_RANGE_TIE_HPP
2#define MPQC_RANGE_TIE_HPP
4#include <boost/array.hpp>
5#include <boost/tuple/tuple.hpp>
6#include <boost/tuple/tuple_io.hpp>
8#include "mpqc/range.hpp"
16 static const int N = boost::tuples::length<Tuple>::value;
17 tie(
const Tuple &s) : Tuple(s) {}
19 operator boost::array<range,N>()
const {
20 boost::array<range,N> a;
25 operator std::vector<range>()
const {
26 boost::array<range,N> a = *
this;
27 return std::vector<range>(a.begin(), a.end());
32 template<
class V,
int I>
33 void cast(V &v, int_<I>)
const {
34 v[I-1] =
range_cast(boost::tuples::get<I-1>(*
this));
39 void cast(V &v, int_<0>)
const {}
43 std::ostream&
operator<<(std::ostream& os,
const range::tie<Tuple> &tie) {
44 os << (
const Tuple&)tie;
56 range::tie<T> range_tie(
const T &t) {
57 return range::tie<T>(t);
void operator<<(Array< T > A, const V &v)
Write to Array from a generic vector V.
Definition array.hpp:191
range range_cast(const range &r)
Cast range to range, return argument unchanged.
Definition range.hpp:123
Contains new MPQC code since version 3.
Definition integralenginepool.hpp:37
boost::tuple tie wrapper
Definition tie.hpp:15