26 #ifndef TILEDARRAY_IRREP_H__INCLUDED
27 #define TILEDARRAY_IRREP_H__INCLUDED
78 std::unique_ptr<unsigned int[]>
90 : data_(std::make_unique<unsigned int[]>(other.degree_ << 1)),
91 degree_(other.degree_) {
92 std::copy_n(other.data_.get(), other.degree_ << 1, data_.get());
96 Irrep(
const std::initializer_list<unsigned int>& mu,
97 const std::initializer_list<unsigned int>& M)
98 : data_(std::make_unique<unsigned int[]>(M.size() << 1u)),
105 std::fill(std::copy(mu.begin(), mu.end(), data_.get()),
106 data_.get() + degree_, 0u);
107 std::copy(M.begin(), M.end(), data_.get() + degree_);
111 const unsigned int* MADNESS_RESTRICT
const M = data_.get() + degree_;
112 const unsigned int* MADNESS_RESTRICT
const mu = data_.get();
113 unsigned int M_max = 0u;
114 unsigned int mu_sum = 0u;
115 for (
unsigned int i = 0u; i < degree_; ++i) {
117 if (i > 0u)
TA_ASSERT(mu[i] <= mu[i - 1u]);
123 TA_ASSERT(std::count(M, M + degree_, i + 1u) == mu[i]);
137 if (degree_ != other.degree_) {
138 data_ = std::make_unique<unsigned int[]>(other.degree_ << 1);
139 degree_ = other.degree_;
141 std::copy_n(other.data_.get(), other.degree_ << 1, data_.get());
149 unsigned int degree()
const {
return degree_; }
155 const unsigned int*
data()
const {
return data_.get(); }
161 #endif // TILEDARRAY_IRREP_H__INCLUDED