Synopsis

| Home | Libraries | People | FAQ | More

### Synopsis

    namespace boost{ namespace math{

    template<typename T> class octonion;
    template<>           class octonion<float>;
    template<>           class octonion<double>;
    template<>           class octonion<long double>;

    // 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);

    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);

    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);

    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);

    template<typename T> octonion<T> operator + (octonion<T> const & o);
    template<typename T> octonion<T> operator - (octonion<T> const & o);

    template<typename T> bool operator == (T const & lhs, octonion<T> const & rhs);
    template<typename T> bool operator == (octonion<T> const & lhs, T const & rhs);
    template<typename T> bool operator == (::std::complex<T> const & lhs, octonion<T> const & rhs);
    template<typename T> bool operator == (octonion<T> const & lhs, ::std::complex<T> const & rhs);
    template<typename T> bool operator == (::boost::math::quaternion<T> const & lhs, octonion<T> const & rhs);
    template<typename T> bool operator == (octonion<T> const & lhs, ::boost::math::quaternion<T> const & rhs);
    template<typename T> bool operator == (octonion<T> const & lhs, octonion<T> const & rhs);

    template<typename T> bool operator != (T const & lhs, octonion<T> const & rhs);
    template<typename T> bool operator != (octonion<T> const & lhs, T const & rhs);
    template<typename T> bool operator != (::std::complex<T> const & lhs, octonion<T> const & rhs);
    template<typename T> bool operator != (octonion<T> const & lhs, ::std::complex<T> const & rhs);
    template<typename T> bool operator != (::boost::math::quaternion<T> const & lhs, octonion<T> const & rhs);
    template<typename T> bool operator != (octonion<T> const & lhs, ::boost::math::quaternion<T> const & rhs);
    template<typename T> bool operator != (octonion<T> const & lhs, octonion<T> const & rhs);

    template<typename T, typename charT, class traits>
    ::std::basic_istream<charT,traits> & operator >> (::std::basic_istream<charT,traits> & is, octonion<T> & o);

    template<typename T, typename charT, class traits>
    ::std::basic_ostream<charT,traits> & operator << (::std::basic_ostream<charT,traits> & os, octonion<T> const & o);

    // values

    template<typename T> T           real(octonion<T> const & o);
    template<typename T> octonion<T> unreal(octonion<T> const & o);

    template<typename T> T           sup(octonion<T> const & o);
    template<typename T> T           l1(octonion<T>const & o);
    template<typename T> T           abs(octonion<T> const & o);
    template<typename T> T           norm(octonion<T>const  & o);
    template<typename T> octonion<T> conj(octonion<T> const & o);

    template<typename T> octonion<T> spherical(T const & rho, T const & theta, T const & phi1, T const & phi2, T const & phi3, T const & phi4, T const & phi5, T const & phi6);
    template<typename T> octonion<T> multipolar(T const & rho1, T const & theta1, T const & rho2, T const & theta2, T const & rho3, T const & theta3, T const & rho4, T const & theta4);
    template<typename T> octonion<T> cylindrical(T const & r, T const & angle, T const & h1, T const & h2, T const & h3, T const & h4, T const & h5, T const & h6);

    // transcendentals

    template<typename T> octonion<T> exp(octonion<T> const & o);
    template<typename T> octonion<T> cos(octonion<T> const & o);
    template<typename T> octonion<T> sin(octonion<T> const & o);
    template<typename T> octonion<T> tan(octonion<T> const & o);
    template<typename T> octonion<T> cosh(octonion<T> const & o);
    template<typename T> octonion<T> sinh(octonion<T> const & o);
    template<typename T> octonion<T> tanh(octonion<T> const & o);

    template<typename T> octonion<T> pow(octonion<T> const & o, int n);

    }  } // namespaces