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 Installation C++ docs Python docs
indexing.h
1 // Copyright (c) 2020 Chris Richardson
2 // FEniCS Project
3 // SPDX-License-Identifier: MIT
4 
5 #pragma once
6 
7 namespace basix
8 {
12 constexpr int idx(int p) { return p; }
13 
21 constexpr int idx(int p, int q) { return (p + q + 1) * (p + q) / 2 + q; }
22 
28 constexpr int idx(int p, int q, int r)
29 {
30  return (p + q + r) * (p + q + r + 1) * (p + q + r + 2) / 6
31  + (q + r) * (q + r + 1) / 2 + r;
32 }
33 } // namespace basix
basix::idx
constexpr int idx(int p)
Definition: indexing.h:12
basix
Placeholder.
Definition: brezzi-douglas-marini.h:9