📄 math-octonion.qbk
字号:
Like complex number, octonions do have a meaningful notion of "real part", but unlike them there is no meaningful notion of "imaginary part". Instead there is an "unreal part" which itself is a octonion, and usually nothing simpler (as opposed to the complex number case). These are returned by the first two functions.[h4 Individual Real Components] T R_component_1() const; T R_component_2() const; T R_component_3() const; T R_component_4() const; T R_component_5() const; T R_component_6() const; T R_component_7() const; T R_component_8() const;A octonion having eight real components, these are returned by these eight functions. Hence real and R_component_1 return the same value.[h4 Individual Complex Components] ::std::complex<T> C_component_1() const; ::std::complex<T> C_component_2() const; ::std::complex<T> C_component_3() const; ::std::complex<T> C_component_4() const;A octonion likewise has four complex components. Actually, octonions are indeed a (left) vector field over the complexes, but beware, as for any octonion __oct_formula we also have __oct_complex_formula (note the [*minus] sign in the last factor). What the C_component_n functions return, however, are the complexes which could be used to build the octonion using the constructor, and [*not] the components of the octonion on the basis ['[^(1, j, e', j')]].[h4 Individual Quaternion Components] ::boost::math::quaternion<T> H_component_1() const; ::boost::math::quaternion<T> H_component_2() const;Likewise, for any octonion __oct_formula we also have __oct_quat_formula, though there is no meaningful vector-space-like structure based on the quaternions. What the H_component_n functions return are the quaternions which could be used to build the octonion using the constructor.[h3 Octonion Member Operators][h4 Assignment Operators] octonion<T> & operator = (octonion<T> const & a_affecter); template<typename X> octonion<T> & operator = (octonion<X> const & a_affecter); octonion<T> & operator = (T const & a_affecter); octonion<T> & operator = (::std::complex<T> const & a_affecter); octonion<T> & operator = (::boost::math::quaternion<T> const & a_affecter);These perform the expected assignment, with type modification if necessary (for instance, assigning from a base type will set the real part to that value, and all other components to zero). For the unspecialized form, the base type's assignment operators must not throw.[h4 Other Member Operators] octonion<T> & operator += (T const & rhs) octonion<T> & operator += (::std::complex<T> const & rhs); octonion<T> & operator += (::boost::math::quaternion<T> const & rhs); template<typename X> octonion<T> & operator += (octonion<X> const & rhs);These perform the mathematical operation `(*this)+rhs` and store the result in `*this`. The unspecialized form has exception guards, which the specialized forms do not, so as to insure exception safety. For the unspecialized form, the base type's assignment operators must not throw. octonion<T> & operator -= (T const & rhs) octonion<T> & operator -= (::std::complex<T> const & rhs); octonion<T> & operator -= (::boost::math::quaternion<T> const & rhs); template<typename X> octonion<T> & operator -= (octonion<X> const & rhs);These perform the mathematical operation `(*this)-rhs` and store the result in `*this`. The unspecialized form has exception guards, which the specialized forms do not, so as to insure exception safety. For the unspecialized form, the base type's assignment operators must not throw. octonion<T> & operator *= (T const & rhs) octonion<T> & operator *= (::std::complex<T> const & rhs); octonion<T> & operator *= (::boost::math::quaternion<T> const & rhs); template<typename X> octonion<T> & operator *= (octonion<X> const & rhs);These perform the mathematical operation `(*this)*rhs` in this order (order is important as multiplication is not commutative for octonions) and store the result in `*this`. The unspecialized form has exception guards, which the specialized forms do not, so as to insure exception safety. For the unspecialized form, the base type's assignment operators must not throw. Also, for clarity's sake, you should always group the factors in a multiplication by groups of two, as the multiplication is not even associative on the octonions (though there are of course cases where this does not matter, it usually does). octonion<T> & operator /= (T const & rhs) octonion<T> & operator /= (::std::complex<T> const & rhs); octonion<T> & operator /= (::boost::math::quaternion<T> const & rhs); template<typename X> octonion<T> & operator /= (octonion<X> const & rhs);These perform the mathematical operation `(*this)*inverse_of(rhs)` in this order (order is important as multiplication is not commutative for octonions) and store the result in `*this`. The unspecialized form has exception guards, which the specialized forms do not, so as to insure exception safety. For the unspecialized form, the base type's assignment operators must not throw. As for the multiplication, remember to group any two factors using parenthesis.[endsect][section:non_mem Octonion Non-Member Operators][h4 Unary Plus and Minus Operators] template<typename T> octonion<T> operator + (octonion<T> const & o);This unary operator simply returns o. template<typename T> octonion<T> operator - (octonion<T> const & o);This unary operator returns the opposite of o.[h4 Binary Addition Operators] template<typename T> octonion<T> operator + (T const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator + (octonion<T> const & lhs, T const & rhs); template<typename T> octonion<T> operator + (::std::complex<T> const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator + (octonion<T> const & lhs, ::std::complex<T> const & rhs); template<typename T> octonion<T> operator + (::boost::math::quaternion<T> const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator + (octonion<T> const & lhs, ::boost::math::quaternion<T> const & rhs); template<typename T> octonion<T> operator + (octonion<T> const & lhs, octonion<T> const & rhs);These operators return `octonion<T>(lhs) += rhs`.[h4 Binary Subtraction Operators] template<typename T> octonion<T> operator - (T const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator - (octonion<T> const & lhs, T const & rhs); template<typename T> octonion<T> operator - (::std::complex<T> const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator - (octonion<T> const & lhs, ::std::complex<T> const & rhs); template<typename T> octonion<T> operator - (::boost::math::quaternion<T> const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator - (octonion<T> const & lhs, ::boost::math::quaternion<T> const & rhs); template<typename T> octonion<T> operator - (octonion<T> const & lhs, octonion<T> const & rhs);These operators return `octonion<T>(lhs) -= rhs`.[h4 Binary Multiplication Operators] template<typename T> octonion<T> operator * (T const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator * (octonion<T> const & lhs, T const & rhs); template<typename T> octonion<T> operator * (::std::complex<T> const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator * (octonion<T> const & lhs, ::std::complex<T> const & rhs); template<typename T> octonion<T> operator * (::boost::math::quaternion<T> const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator * (octonion<T> const & lhs, ::boost::math::quaternion<T> const & rhs); template<typename T> octonion<T> operator * (octonion<T> const & lhs, octonion<T> const & rhs);These operators return `octonion<T>(lhs) *= rhs`.[h4 Binary Division Operators] template<typename T> octonion<T> operator / (T const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator / (octonion<T> const & lhs, T const & rhs); template<typename T> octonion<T> operator / (::std::complex<T> const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator / (octonion<T> const & lhs, ::std::complex<T> const & rhs); template<typename T> octonion<T> operator / (::boost::math::quaternion<T> const & lhs, octonion<T> const & rhs); template<typename T> octonion<T> operator / (octonion<T> const & lhs, ::boost::math::quaternion<T> const & rhs); template<typename T> octonion<T> operator / (octonion<T> const & lhs, octonion<T> const & rhs);These operators return `octonion<T>(lhs) /= rhs`. It is of course still an error to divide by zero...[h4 Binary Equality Operators]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -