SheafSystem
0.0.0.0
|
The "type" of a tensor; specifies the degree and the co- or contra-variance for each index of a tensor. More...
#include <tensor_variance.h>
TENSOR_VARIANCE FACET | |
tensor_variance () | |
Default constructor. More... | |
tensor_variance (const tensor_variance &xother) | |
Copy constructor. More... | |
tensor_variance (int xp) | |
Creates an instance with degree = xp and all indices contravariant. More... | |
~tensor_variance () | |
Destructor; not virtual, this can not be a base class. More... | |
tensor_variance & | operator= (const tensor_variance &xother) |
Assignment operator. More... | |
bool | operator== (const tensor_variance &xother) const |
Equality comparison operator. More... | |
int | p () const |
The tensor degree. More... | |
bool | variance (int xi) const |
The variance of the xi-th index; covariant if true, contravariant if false. More... | |
void | put_variance (int xi, bool xvalue) |
Sets the variance of the xi-th index to xvalue. More... | |
void | put_variance (bool xvalue) |
Sets the variance of all indices to xvalue. More... | |
bool | is_covariant (int xi) const |
True if and only if the xi-th index is covariant; synonym for variance(xi). More... | |
bool | is_covariant () const |
True if and only if all indices are covariant. More... | |
bool | is_contravariant (int xi) const |
True if and only if the xi-th index is covariant; synonym for !variance(xi). More... | |
bool | is_contravariant () const |
True if and only if all indices are contravariant. More... | |
bool | is_mixed () const |
True if and only if there exists at least one index that is covariant and at least one that is contravariant. More... | |
bool | is_pure () const |
True if and only if all indices are covariant or all indices are contravariant. More... | |
void | purify () |
Sets all indices the same as index 0. More... | |
static int | capacity () |
The largest value of p this implementation will support. More... | |
The "type" of a tensor; specifies the degree and the co- or contra-variance for each index of a tensor.
A general tensor is defined as a multilinear map of one or more vector and/or covector variables to the reals. The specification of the number of variables and which are vectors and which are covectors is referred to as the type of the tensor, but there appear to be two approaches in the literature to how precisely the type must be specified. Bishop & Goldberg choose to always order the variables so the covectors come first, so the type is entirely specified by the number of covector variables (contravariant degree) and the number of vector variables (covariant degree). But if we have a metric handy and can raise and lower indices it's not entirely clear how the implied reordering of the variables works. Dodson & Poston argue that's its more convenient to not assume any particular order of the variables but then the type must define the co- or contra-variance for each variable in order.
This class follows the Dodson and Poston approach and specifies the variance for each index using a bit vector.
Definition at line 61 of file tensor_variance.h.
fiber_bundle::tensor_variance::tensor_variance | ( | ) |
Default constructor.
Definition at line 35 of file tensor_variance.cc.
Referenced by tensor_variance().
fiber_bundle::tensor_variance::tensor_variance | ( | const tensor_variance & | xother | ) |
fiber_bundle::tensor_variance::tensor_variance | ( | int | xp | ) |
Creates an instance with degree = xp and all indices contravariant.
Definition at line 69 of file tensor_variance.cc.
References ~tensor_variance().
fiber_bundle::tensor_variance::~tensor_variance | ( | ) |
Destructor; not virtual, this can not be a base class.
Definition at line 90 of file tensor_variance.cc.
References operator=().
Referenced by tensor_variance().
|
static |
The largest value of p this implementation will support.
Definition at line 148 of file tensor_variance.cc.
References p().
Referenced by operator==().
bool fiber_bundle::tensor_variance::is_contravariant | ( | int | xi | ) | const |
True if and only if the xi-th index is covariant; synonym for !variance(xi).
Definition at line 269 of file tensor_variance.cc.
References is_contravariant().
Referenced by fiber_bundle::hook(), fiber_bundle::raise(), fiber_bundle::star(), and fiber_bundle::wedge().
bool fiber_bundle::tensor_variance::is_contravariant | ( | ) | const |
True if and only if all indices are contravariant.
Definition at line 292 of file tensor_variance.cc.
References is_mixed().
Referenced by is_contravariant(), and is_covariant().
bool fiber_bundle::tensor_variance::is_covariant | ( | int | xi | ) | const |
True if and only if the xi-th index is covariant; synonym for variance(xi).
Definition at line 228 of file tensor_variance.cc.
References is_covariant().
Referenced by fiber_bundle::hook(), fiber_bundle::lower(), fiber_bundle::star(), fiber_bundle::tensor_product(), and fiber_bundle::wedge().
bool fiber_bundle::tensor_variance::is_covariant | ( | ) | const |
True if and only if all indices are covariant.
Definition at line 251 of file tensor_variance.cc.
References is_contravariant().
Referenced by is_covariant(), and put_variance().
bool fiber_bundle::tensor_variance::is_mixed | ( | ) | const |
True if and only if there exists at least one index that is covariant and at least one that is contravariant.
Definition at line 312 of file tensor_variance.cc.
References is_pure().
Referenced by fiber_bundle::sec_tp_algebra::alt(), fiber_bundle::tp_algebra::alt(), is_contravariant(), fiber_bundle::sec_tp_algebra::sym(), and fiber_bundle::tp_algebra::sym().
bool fiber_bundle::tensor_variance::is_pure | ( | ) | const |
True if and only if all indices are covariant or all indices are contravariant.
Definition at line 340 of file tensor_variance.cc.
References purify().
Referenced by is_mixed(), fiber_bundle::sec_stp_space::round_variance(), fiber_bundle::stp_space::round_variance(), fiber_bundle::sec_atp_space::round_variance(), and fiber_bundle::atp_space::round_variance().
fiber_bundle::tensor_variance & fiber_bundle::tensor_variance::operator= | ( | const tensor_variance & | xother | ) |
Assignment operator.
Definition at line 108 of file tensor_variance.cc.
References operator==().
Referenced by ~tensor_variance().
bool fiber_bundle::tensor_variance::operator== | ( | const tensor_variance & | xother | ) | const |
Equality comparison operator.
Definition at line 129 of file tensor_variance.cc.
References capacity().
Referenced by operator=().
int fiber_bundle::tensor_variance::p | ( | ) | const |
The tensor degree.
Definition at line 155 of file tensor_variance.cc.
References variance().
Referenced by capacity(), fiber_bundle::contract(), fiber_bundle::hook(), fiber_bundle::lower(), fiber_bundle::sec_tp_space::put_variance(), fiber_bundle::tp_space::put_variance(), fiber_bundle::raise(), fiber_bundle::sec_stp_space::round_variance(), fiber_bundle::stp_space::round_variance(), fiber_bundle::sec_atp_space::round_variance(), fiber_bundle::atp_space::round_variance(), fiber_bundle::star(), fiber_bundle::tensor_product(), and fiber_bundle::wedge().
void fiber_bundle::tensor_variance::purify | ( | ) |
Sets all indices the same as index 0.
Definition at line 347 of file tensor_variance.cc.
References fiber_bundle::contract().
Referenced by is_pure(), fiber_bundle::sec_stp_space::round_variance(), fiber_bundle::stp_space::round_variance(), fiber_bundle::sec_atp_space::round_variance(), and fiber_bundle::atp_space::round_variance().
void fiber_bundle::tensor_variance::put_variance | ( | int | xi, |
bool | xvalue | ||
) |
Sets the variance of the xi-th index to xvalue.
Definition at line 184 of file tensor_variance.cc.
Referenced by fiber_bundle::contract(), fiber_bundle::hook(), fiber_bundle::lower(), fiber_bundle::raise(), fiber_bundle::star(), fiber_bundle::tensor_product(), variance(), fiber_bundle::sec_tp_space::variance(), fiber_bundle::tp_space::variance(), and fiber_bundle::wedge().
void fiber_bundle::tensor_variance::put_variance | ( | bool | xvalue | ) |
Sets the variance of all indices to xvalue.
Definition at line 205 of file tensor_variance.cc.
References is_covariant().
bool fiber_bundle::tensor_variance::variance | ( | int | xi | ) | const |
The variance of the xi-th index; covariant if true, contravariant if false.
Definition at line 162 of file tensor_variance.cc.
References put_variance().
Referenced by fiber_bundle::contract(), p(), fiber_bundle::sec_tp_space::put_variance(), fiber_bundle::tp_space::put_variance(), fiber_bundle::sec_stp_space::round_variance(), fiber_bundle::stp_space::round_variance(), fiber_bundle::sec_atp_space::round_variance(), fiber_bundle::atp_space::round_variance(), fiber_bundle::tensor_product(), fiber_bundle::sec_tp::variance(), and fiber_bundle::tp::variance().