Notation Standards¶
The following table provides a standard for the notation in the mathematical documentation and in the code.
Object |
Math |
Code |
---|---|---|
Graph |
\(G,\, H,\, G_1,\, H_1\) |
|
Framework |
\(F\) |
|
dimension |
\(d\) |
|
Realization |
\(p\) |
|
Point |
\((x_1,\dots,x_d)\in \RR^d\) |
|
Vertex Set |
\(V\), \(V(G)\) |
|
Edge Set |
\(E\), \(E(G)\) |
|
Vertex |
\(u,\, v, \, w,\, u_1,\, v_1,\, w_1\) |
|
Edge |
\(e\), \(e_1\), \(uv\) |
|
#V |
\(n\) or \(|V|\) |
|
#E |
\(m\) or \(|E|\) |
|
Rigidity Matrix |
\(R(G,p)\) |
|
Infinitesimal flex |
\(q\) |
|
Equilibrium stress |
\(\omega\) |
|
Stress Matrix |
\(\Omega\) |
|
Motion |
\(\alpha:[0,1]\rightarrow (\RR^d)^n\) |
|
\(d\)-rigidity matroid |
\(\mathcal{R}_d\) |
N/A |
Symbolic |
N/A |
|
Tolerance |
N/A |
|
Iterator Variables are supposed to be denoted in the following order (with descending callback depth):
i
j
k
(ifk
is not defined differently in the method)L
ii
…
If single-letter variables are part of the input parameters, that should be reflected in the method name.
Examples of this are Graph.is_kl_sparse()
or Graph.is_k_redundantly_rigid()
.
Otherwise, single-letter variables should be avoided whenever possible and descriptive variable names should be used instead.
According to PEP8, the letters l
(lower-case ell), O
(upper-case oh) and I
(upper-case eye)
should generally be avoided due to their similarity to other characters.