glucat 0.13.0
|
A framed_multi<Scalar_T,LO,HI,Tune_P> is a framed approximation to a multivector. More...
#include <framed_multi.h>
Classes | |
class | hash_size_t |
class | var_term |
Variable term. More... |
Public Types | |
using | multivector_t = framed_multi |
using | framed_multi_t = multivector_t |
using | scalar_t = Scalar_T |
using | tune_p = Tune_P |
using | index_set_t = index_set<LO, HI> |
using | term_t = std::pair<const index_set_t, Scalar_T> |
using | vector_t = std::vector<Scalar_T> |
using | error_t = error<multivector_t> |
using | matrix_multi_t = matrix_multi<Scalar_T,LO,HI,Tune_P > |
Public Types inherited from glucat::clifford_algebra< double, index_set< DEFAULT_LO, DEFAULT_HI >, framed_multi< double, DEFAULT_LO, DEFAULT_HI, tuning<> > > | |
using | scalar_t |
using | index_set_t |
using | multivector_t |
using | pair_t |
using | vector_t |
Public Member Functions | |
~framed_multi () override=default | |
Destructor. | |
framed_multi () | |
Default constructor. | |
template<typename Other_Scalar_T> | |
framed_multi (const framed_multi< Other_Scalar_T, LO, HI, Tune_P > &val) | |
Construct a multivector from a multivector with a different scalar type. | |
template<typename Other_Scalar_T> | |
framed_multi (const framed_multi< Other_Scalar_T, LO, HI, Tune_P > &val, const index_set_t frm, const bool prechecked=false) | |
Construct a multivector, within a given frame, from a given multivector. | |
framed_multi (const framed_multi_t &val, const index_set_t frm, const bool prechecked=false) | |
Construct a multivector, within a given frame, from a given multivector. | |
framed_multi (const index_set_t ist, const Scalar_T &crd=Scalar_T(1)) | |
Construct a multivector from an index set and a scalar coordinate. | |
framed_multi (const index_set_t ist, const Scalar_T &crd, const index_set_t frm, const bool prechecked=false) | |
Construct a multivector, within a given frame, from an index set and a scalar coordinate. | |
framed_multi (const Scalar_T &scr, const index_set_t frm=index_set_t()) | |
Construct a multivector from a scalar (within a frame, if given) | |
framed_multi (const int scr, const index_set_t frm=index_set_t()) | |
Construct a multivector from an int (within a frame, if given) | |
framed_multi (const vector_t &vec, const index_set_t frm, const bool prechecked=false) | |
Construct a multivector, within a given frame, from a given vector. | |
framed_multi (const std::string &str) | |
Construct a multivector from a string: eg: "3+2{1,2}-6.1e-2{2,3}". | |
framed_multi (const std::string &str, const index_set_t frm, const bool prechecked=false) | |
Construct a multivector, within a given frame, from a string: eg: "3+2{1,2}-6.1e-2{2,3}". | |
framed_multi (const char *str) | |
Construct a multivector from a char*: eg: "3+2{1,2}-6.1e-2{2,3}". | |
framed_multi (const char *str, const index_set_t frm, const bool prechecked=false) | |
Construct a multivector, within a given frame, from a char*: eg: "3+2{1,2}-6.1e-2{2,3}". | |
template<typename Other_Scalar_T> | |
framed_multi (const matrix_multi< Other_Scalar_T, LO, HI, Tune_P > &val) | |
Construct a multivector from a matrix_multi_t. | |
template<typename Other_Scalar_T> | |
auto | fast_matrix_multi (const index_set_t frm) const -> const matrix_multi< Other_Scalar_T, LO, HI, Tune_P > |
Use generalized FFT to construct a matrix_multi_t. | |
auto | fast_framed_multi () const -> const framed_multi_t |
Use inverse generalized FFT to construct a framed_multi_t. | |
_GLUCAT_CLIFFORD_ALGEBRA_OPERATIONS auto | nbr_terms () const -> unsigned long |
Number of terms. | |
auto | operator+= (const term_t &term) -> multivector_t & |
Add a term, if non-zero. | |
Public Member Functions inherited from glucat::clifford_algebra< double, index_set< DEFAULT_LO, DEFAULT_HI >, framed_multi< double, DEFAULT_LO, DEFAULT_HI, tuning<> > > | |
virtual | ~clifford_algebra ()=default |
virtual auto | operator== (const multivector_t &val) const -> bool=0 |
Test for equality of multivectors. | |
virtual auto | operator+= (const multivector_t &rhs) -> multivector_t &=0 |
Geometric sum. | |
virtual auto | operator-= (const multivector_t &rhs) -> multivector_t &=0 |
Geometric difference. | |
virtual auto | operator- () const -> const multivector_t=0 |
Unary -. | |
virtual auto | operator*= (const double &scr) -> multivector_t &=0 |
Product of multivector and scalar. | |
virtual auto | operator%= (const multivector_t &rhs) -> multivector_t &=0 |
Contraction. | |
virtual auto | operator&= (const multivector_t &rhs) -> multivector_t &=0 |
Inner product. | |
virtual auto | operator^= (const multivector_t &rhs) -> multivector_t &=0 |
Outer product. | |
virtual auto | operator/= (const double &scr) -> multivector_t &=0 |
Quotient of multivector and scalar. | |
virtual auto | operator|= (const multivector_t &rhs) -> multivector_t &=0 |
Transformation via twisted adjoint action. | |
virtual auto | inv () const -> const multivector_t=0 |
Geometric multiplicative inverse. | |
virtual auto | pow (int m) const -> const multivector_t=0 |
*this to the m | |
virtual auto | outer_pow (int m) const -> const multivector_t=0 |
Outer product power. | |
virtual auto | frame () const -> const index_set_t=0 |
Subalgebra generated by all generators of terms of given multivector. | |
virtual auto | grade () const -> index_t=0 |
Maximum of the grades of each term. | |
virtual auto | operator[] (const index_set_t ist) const -> double=0 |
Subscripting: map from index set to scalar coordinate. | |
virtual auto | operator() (index_t grade) const -> const multivector_t=0 |
Pure grade-vector part. | |
virtual auto | scalar () const -> double=0 |
Scalar part. | |
virtual auto | pure () const -> const multivector_t=0 |
Pure part. | |
virtual auto | even () const -> const multivector_t=0 |
Even part of multivector, sum of even grade terms. | |
virtual auto | odd () const -> const multivector_t=0 |
Odd part of multivector, sum of odd grade terms. | |
virtual auto | vector_part () const -> const vector_t=0 |
Vector part of multivector, as a vector_t with respect to frame() | |
virtual auto | involute () const -> const multivector_t=0 |
Main involution, each {i} is replaced by -{i} in each term, eg. {1} -> -{1}. | |
virtual auto | reverse () const -> const multivector_t=0 |
Reversion, eg. {1}*{2} -> {2}*{1}. | |
virtual auto | conj () const -> const multivector_t=0 |
Conjugation, reverse o involute == involute o reverse. | |
virtual auto | quad () const -> double=0 |
Scalar_T quadratic form == (rev(x)*x)(0) | |
virtual auto | norm () const -> double=0 |
Scalar_T norm == sum of norm of coordinates. | |
virtual auto | max_abs () const -> double=0 |
Maximum of absolute values of components of multivector: multivector infinity norm. | |
virtual auto | truncated (const double &limit=default_truncation) const -> const multivector_t=0 |
Remove all terms with relative size smaller than limit. | |
virtual auto | isinf () const -> bool=0 |
Check if a multivector contains any infinite values. | |
virtual auto | isnan () const -> bool=0 |
Check if a multivector contains any IEEE NaN values. | |
virtual void | write (const std::string &msg="") const=0 |
Write formatted multivector to output. |
Static Public Member Functions | |
static auto | classname () -> const std::string |
Class name used in messages. | |
static auto | random (const index_set_t frm, Scalar_T fill=Scalar_T(1)) -> const multivector_t |
Random multivector within a frame. | |
Static Public Member Functions inherited from glucat::clifford_algebra< double, index_set< DEFAULT_LO, DEFAULT_HI >, framed_multi< double, DEFAULT_LO, DEFAULT_HI, tuning<> > > | |
static auto | classname () -> const std::string |
Private Types | |
using | var_term_t = class var_term |
using | matrix_t = typename matrix_multi_t::matrix_t |
using | sorted_map_t = std::map< index_set_t, Scalar_T, std::less<const index_set_t> > |
using | map_t = std::unordered_map<index_set_t, Scalar_T, index_set_hash<LO, HI>> |
using | framed_pair_t = std::pair<const multivector_t, const multivector_t> |
using | size_type = typename map_t::size_type |
using | iterator = typename map_t::iterator |
using | const_iterator = typename map_t::const_iterator |
Private Member Functions | |
framed_multi (const hash_size_t &hash_size) | |
Private constructor using hash_size. | |
auto | fold (const index_set_t frm) const -> multivector_t |
Subalgebra isomorphism: fold each term within the given frame. | |
auto | unfold (const index_set_t frm) const -> multivector_t |
Subalgebra isomorphism: unfold each term within the given frame. | |
auto | centre_pm4_qp4 (index_t &p, index_t &q) -> multivector_t & |
Subalgebra isomorphism: R_{p,q} to R_{p-4,q+4}. | |
auto | centre_pp4_qm4 (index_t &p, index_t &q) -> multivector_t & |
Subalgebra isomorphism: R_{p,q} to R_{p+4,q-4}. | |
auto | centre_qp1_pm1 (index_t &p, index_t &q) -> multivector_t & |
Subalgebra isomorphism: R_{p,q} to R_{q+1,p-1}. | |
auto | divide (const index_set_t ist) const -> const framed_pair_t |
Divide multivector into part divisible by index_set and remainder. | |
auto | fast (const index_t level, const bool odd) const -> const matrix_t |
Generalized FFT from multivector_t to matrix_t. |
Friends | |
template<typename Other_Scalar_T, const index_t Other_LO, const index_t Other_HI, typename Other_Tune_P> | |
class | matrix_multi |
template<typename Other_Scalar_T, const index_t Other_LO, const index_t Other_HI, typename Other_Tune_P> | |
class | framed_multi |
auto | operator* (const multivector_t &lhs, const multivector_t &rhs) -> const multivector_t |
auto | operator^ (const multivector_t &lhs, const multivector_t &rhs) -> const multivector_t |
auto | operator& (const multivector_t &lhs, const multivector_t &rhs) -> const multivector_t |
auto | operator% (const multivector_t &lhs, const multivector_t &rhs) -> const multivector_t |
auto | star (const multivector_t &lhs, const multivector_t &rhs) -> Scalar_T |
auto | operator/ (const multivector_t &lhs, const multivector_t &rhs) -> const multivector_t |
auto | operator| (const multivector_t &lhs, const multivector_t &rhs) -> const multivector_t |
auto | operator>> (std::istream &s, multivector_t &val) -> std::istream & |
auto | operator<< (std::ostream &os, const multivector_t &val) -> std::ostream & |
auto | operator<< (std::ostream &os, const term_t &term) -> std::ostream & |
auto | exp (const multivector_t &val) -> const multivector_t |
Additional Inherited Members | |
Static Public Attributes inherited from glucat::clifford_algebra< double, index_set< DEFAULT_LO, DEFAULT_HI >, framed_multi< double, DEFAULT_LO, DEFAULT_HI, tuning<> > > | |
static const index_t | v_lo |
static const index_t | v_hi |
static const double | default_truncation |
Default for truncation. |
A framed_multi<Scalar_T,LO,HI,Tune_P> is a framed approximation to a multivector.
Definition at line 126 of file framed_multi.h.
|
private |
Definition at line 167 of file framed_multi.h.
using glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::error_t = error<multivector_t> |
Definition at line 138 of file framed_multi.h.
using glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi_t = multivector_t |
Definition at line 132 of file framed_multi.h.
|
private |
Definition at line 164 of file framed_multi.h.
using glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::index_set_t = index_set<LO, HI> |
Definition at line 135 of file framed_multi.h.
|
private |
Definition at line 166 of file framed_multi.h.
|
private |
Definition at line 150 of file framed_multi.h.
using glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::matrix_multi_t = matrix_multi<Scalar_T,LO,HI,Tune_P > |
Definition at line 139 of file framed_multi.h.
|
private |
Definition at line 148 of file framed_multi.h.
using glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::multivector_t = framed_multi |
Definition at line 131 of file framed_multi.h.
using glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::scalar_t = Scalar_T |
Definition at line 133 of file framed_multi.h.
|
private |
Definition at line 165 of file framed_multi.h.
|
private |
Definition at line 149 of file framed_multi.h.
using glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::term_t = std::pair<const index_set_t, Scalar_T> |
Definition at line 136 of file framed_multi.h.
using glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::tune_p = Tune_P |
Definition at line 134 of file framed_multi.h.
|
private |
Definition at line 147 of file framed_multi.h.
using glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::vector_t = std::vector<Scalar_T> |
Definition at line 137 of file framed_multi.h.
|
overridedefault |
Destructor.
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | ) |
|
private |
Private constructor using hash_size.
Definition at line 66 of file framed_multi_imp.h.
References _GLUCAT_HASH_N.
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const framed_multi< Other_Scalar_T, LO, HI, Tune_P > & | val | ) |
Construct a multivector from a multivector with a different scalar type.
Definition at line 74 of file framed_multi_imp.h.
References _GLUCAT_HASH_N, framed_multi, and glucat::numeric_traits< Scalar_T >::to_scalar_t().
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const framed_multi< Other_Scalar_T, LO, HI, Tune_P > & | val, |
const index_set_t | frm, | ||
const bool | prechecked = false ) |
Construct a multivector, within a given frame, from a given multivector.
Definition at line 85 of file framed_multi_imp.h.
References _GLUCAT_HASH_N, glucat::clifford_algebra< Scalar_T, Index_Set_T, Multivector_T >::frame(), framed_multi, and glucat::numeric_traits< Scalar_T >::to_scalar_t().
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const framed_multi_t & | val, |
const index_set_t | frm, | ||
const bool | prechecked = false ) |
Construct a multivector, within a given frame, from a given multivector.
Definition at line 98 of file framed_multi_imp.h.
References _GLUCAT_HASH_N, and glucat::clifford_algebra< Scalar_T, Index_Set_T, Multivector_T >::frame().
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const index_set_t | ist, |
const Scalar_T & | crd = Scalar_T(1) ) |
Construct a multivector from an index set and a scalar coordinate.
Definition at line 111 of file framed_multi_imp.h.
References _GLUCAT_HASH_N.
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const index_set_t | ist, |
const Scalar_T & | crd, | ||
const index_set_t | frm, | ||
const bool | prechecked = false ) |
Construct a multivector, within a given frame, from an index set and a scalar coordinate.
Definition at line 121 of file framed_multi_imp.h.
References _GLUCAT_HASH_N.
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const Scalar_T & | scr, |
const index_set_t | frm = index_set_t() ) |
Construct a multivector from a scalar (within a frame, if given)
Definition at line 134 of file framed_multi_imp.h.
References _GLUCAT_HASH_N.
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const int | scr, |
const index_set_t | frm = index_set_t() ) |
Construct a multivector from an int (within a frame, if given)
Definition at line 144 of file framed_multi_imp.h.
References _GLUCAT_HASH_N.
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const vector_t & | vec, |
const index_set_t | frm, | ||
const bool | prechecked = false ) |
Construct a multivector, within a given frame, from a given vector.
Definition at line 154 of file framed_multi_imp.h.
References _GLUCAT_HASH_N, glucat::index_set< LO, HI >::count(), glucat::index_set< LO, HI >::max(), and glucat::index_set< LO, HI >::min().
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const std::string & | str | ) |
Construct a multivector from a string: eg: "3+2{1,2}-6.1e-2{2,3}".
Definition at line 176 of file framed_multi_imp.h.
References _GLUCAT_HASH_N.
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const std::string & | str, |
const index_set_t | frm, | ||
const bool | prechecked = false ) |
Construct a multivector, within a given frame, from a string: eg: "3+2{1,2}-6.1e-2{2,3}".
Definition at line 192 of file framed_multi_imp.h.
References _GLUCAT_HASH_N.
|
inline |
Construct a multivector from a char*: eg: "3+2{1,2}-6.1e-2{2,3}".
Definition at line 209 of file framed_multi.h.
|
inline |
Construct a multivector, within a given frame, from a char*: eg: "3+2{1,2}-6.1e-2{2,3}".
Definition at line 212 of file framed_multi.h.
glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi | ( | const matrix_multi< Other_Scalar_T, LO, HI, Tune_P > & | val | ) |
Construct a multivector from a matrix_multi_t.
Definition at line 205 of file framed_multi_imp.h.
References _GLUCAT_HASH_N, _GLUCAT_HASH_SIZE_T, glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::basis_element(), fast_framed_multi(), glucat::clifford_algebra< Scalar_T, Index_Set_T, Multivector_T >::frame(), glucat::matrix::inner(), glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::m_matrix, matrix_multi, glucat::matrix::nnz(), glucat::clifford_algebra< Scalar_T, Index_Set_T, Multivector_T >::norm(), and glucat::clifford_algebra< double, index_set< DEFAULT_LO, DEFAULT_HI >, framed_multi< double, DEFAULT_LO, DEFAULT_HI, tuning<> > >::truncated().
|
private |
Subalgebra isomorphism: R_{p,q} to R_{p-4,q+4}.
Definition at line 1464 of file framed_multi_imp.h.
Referenced by glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::fast_framed_multi().
|
private |
Subalgebra isomorphism: R_{p,q} to R_{p+4,q-4}.
Definition at line 1506 of file framed_multi_imp.h.
Referenced by glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::fast_framed_multi().
|
private |
Subalgebra isomorphism: R_{p,q} to R_{q+1,p-1}.
Definition at line 1548 of file framed_multi_imp.h.
Referenced by glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::fast_framed_multi().
|
static |
Class name used in messages.
Definition at line 50 of file framed_multi_imp.h.
|
private |
Divide multivector into part divisible by index_set and remainder.
Divide multivector into quotient with terms divisible by index set, and remainder.
Definition at line 1581 of file framed_multi_imp.h.
Referenced by fast().
|
private |
Generalized FFT from multivector_t to matrix_t.
Definition at line 1597 of file framed_multi_imp.h.
References divide(), glucat::matrix::kron(), glucat::clifford_algebra< double, index_set< DEFAULT_LO, DEFAULT_HI >, framed_multi< double, DEFAULT_LO, DEFAULT_HI, tuning<> > >::odd(), glucat::scalar(), and glucat::matrix::unit().
|
inline |
Use inverse generalized FFT to construct a framed_multi_t.
Definition at line 1695 of file framed_multi_imp.h.
Referenced by framed_multi().
auto glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::fast_matrix_multi | ( | const index_set_t | frm | ) | const -> const matrix_multi<Other_Scalar_T,LO,HI,Tune_P > |
Use generalized FFT to construct a matrix_multi_t.
Definition at line 1663 of file framed_multi_imp.h.
References fold(), matrix_multi, glucat::gen::offset_to_super, and glucat::pos_mod().
|
private |
Subalgebra isomorphism: fold each term within the given frame.
Definition at line 1429 of file framed_multi_imp.h.
Referenced by fast_matrix_multi().
auto glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::nbr_terms | ( | ) | const -> unsigned long |
Number of terms.
Definition at line 1351 of file framed_multi_imp.h.
|
inline |
Add a term, if non-zero.
Insert a term into a multivector, add terms with same index set.
Geometric sum.
Geometric sum of multivector and scalar.
Definition at line 295 of file framed_multi_imp.h.
|
static |
Random multivector within a frame.
Definition at line 1054 of file framed_multi_imp.h.
References framed_multi.
Referenced by glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::random().
|
private |
Subalgebra isomorphism: unfold each term within the given frame.
Definition at line 1446 of file framed_multi_imp.h.
Referenced by glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::fast_framed_multi().
|
friend |
|
friend |
Definition at line 143 of file framed_multi.h.
Referenced by framed_multi(), framed_multi(), framed_multi(), framed_multi(), and random().
|
friend |
Definition at line 141 of file framed_multi.h.
Referenced by fast_matrix_multi(), and framed_multi().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |