DDC 0.6.0
Loading...
Searching...
No Matches
trivial_space.hpp
1// Copyright (C) The DDC development team, see COPYRIGHT.md file
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#include "ddc/discrete_domain.hpp"
8#include "ddc/discrete_element.hpp"
9#include "ddc/discrete_vector.hpp"
10
11namespace ddc {
12
13/** Construct a bounded dimension without attributes.
14 *
15 * @param n number of elements
16 * @return a DiscreteDomain of size `n`
17 */
18template <class DDim>
19constexpr DiscreteDomain<DDim> init_trivial_bounded_space(DiscreteVector<DDim> const n) noexcept
20{
21 return DiscreteDomain<DDim>(create_reference_discrete_element<DDim>(), n);
22}
23
24/** Construct a half bounded dimension without attributes.
25 *
26 * @return the first DiscreteElement of the dimension
27 */
28template <class DDim>
29constexpr DiscreteElement<DDim> init_trivial_half_bounded_space() noexcept
30{
31 return create_reference_discrete_element<DDim>();
32}
33
34} // namespace ddc
friend class DiscreteDomain
KOKKOS_FUNCTION constexpr bool operator!=(DiscreteVector< OTags... > const &rhs) const noexcept
The top-level namespace of DDC.
constexpr DiscreteElement< DDim > init_trivial_half_bounded_space() noexcept
Construct a half bounded dimension without attributes.
constexpr DiscreteDomain< DDim > init_trivial_bounded_space(DiscreteVector< DDim > const n) noexcept
Construct a bounded dimension without attributes.