FreeTensor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
freetensor::Rational< T > Struct Template Reference

#include <rational.h>

Collaboration diagram for freetensor::Rational< T >:
Collaboration graph
[legend]

Public Member Functions

 Rational (T p=0, T q=1)
 
Rationaloperator+= (const Rational< T > &other)
 
Rationaloperator-= (const Rational< T > &other)
 
Rationaloperator*= (const Rational< T > &other)
 
Rationaloperator/= (const Rational< T > &other)
 
Rational operator- () const
 

Public Attributes

p_
 
q_
 

Friends

bool operator== (const Rational< T > &lhs, const Rational< T > &rhs)
 
Rational operator+ (const Rational< T > &lhs, const Rational< T > &rhs)
 
Rational operator- (const Rational< T > &lhs, const Rational< T > &rhs)
 
Rational operator* (const Rational< T > &lhs, const Rational< T > &rhs)
 
Rational operator/ (const Rational< T > &lhs, const Rational< T > &rhs)
 
std::ostream & operator<< (std::ostream &os, const Rational< T > &r)
 
auto operator<=> (const Rational< T > &lhs, const Rational< T > &rhs)
 

Constructor & Destructor Documentation

◆ Rational()

template<class T >
freetensor::Rational< T >::Rational ( p = 0,
q = 1 
)
inline

Member Function Documentation

◆ operator*=()

template<class T >
Rational & freetensor::Rational< T >::operator*= ( const Rational< T > &  other)
inline

◆ operator+=()

template<class T >
Rational & freetensor::Rational< T >::operator+= ( const Rational< T > &  other)
inline

◆ operator-()

template<class T >
Rational freetensor::Rational< T >::operator- ( ) const
inline

◆ operator-=()

template<class T >
Rational & freetensor::Rational< T >::operator-= ( const Rational< T > &  other)
inline

◆ operator/=()

template<class T >
Rational & freetensor::Rational< T >::operator/= ( const Rational< T > &  other)
inline

Friends And Related Function Documentation

◆ operator*

template<class T >
Rational operator* ( const Rational< T > &  lhs,
const Rational< T > &  rhs 
)
friend

◆ operator+

template<class T >
Rational operator+ ( const Rational< T > &  lhs,
const Rational< T > &  rhs 
)
friend

◆ operator-

template<class T >
Rational operator- ( const Rational< T > &  lhs,
const Rational< T > &  rhs 
)
friend

◆ operator/

template<class T >
Rational operator/ ( const Rational< T > &  lhs,
const Rational< T > &  rhs 
)
friend

◆ operator<<

template<class T >
std::ostream & operator<< ( std::ostream &  os,
const Rational< T > &  r 
)
friend

◆ operator<=>

template<class T >
auto operator<=> ( const Rational< T > &  lhs,
const Rational< T > &  rhs 
)
friend

◆ operator==

template<class T >
bool operator== ( const Rational< T > &  lhs,
const Rational< T > &  rhs 
)
friend

Member Data Documentation

◆ p_

template<class T >
T freetensor::Rational< T >::p_

◆ q_

template<class T >
T freetensor::Rational< T >::q_

The documentation for this struct was generated from the following file: