Note: this is documentation for an old release. View the latest documentation at
docs.fenicsproject.org/basix/v0.9.0/cpp/indexing_8h_source.html
Home
FEniCS 2024
Download
Documentation
Community
Citing
Donate
Basix 0.8.0
Home
Installation
Demos
C++ docs
Python docs
Loading...
Searching...
No Matches
cpp
basix
indexing.h
1
// Copyright (c) 2020 Chris Richardson
2
// FEniCS Project
3
// SPDX-License-Identifier: MIT
4
5
#pragma once
6
8
namespace
basix::indexing
9
{
13
constexpr
int
idx
(
int
p) {
return
p; }
14
22
constexpr
int
idx
(
int
p,
int
q) {
return
(p + q + 1) * (p + q) / 2 + q; }
23
30
constexpr
int
idx
(
int
p,
int
q,
int
r)
31
{
32
return
(p + q + r) * (p + q + r + 1) * (p + q + r + 2) / 6
33
+ (q + r) * (q + r + 1) / 2 + r;
34
}
35
}
// namespace basix::indexing
basix::indexing
Indexing.
Definition:
indexing.h:9
basix::indexing::idx
constexpr int idx(int p)
Compute trivial indexing in a 1D array (for completeness).
Definition:
indexing.h:13