ARTS 2.5.0 (git: 9ee3ac6c)
rational.h File Reference

Contains the rational class definition. More...

#include "array.h"
#include "bifstream.h"
#include "bofstream.h"
#include "math_funcs.h"
#include "matpack.h"
#include <ostream>

Go to the source code of this file.

Classes

class  Rational
 Implements rational numbers to work with other ARTS types. More...
 

Macros

#define RATIONAL_UNDEFINED   Rational(0, 0)
 

Typedefs

using ArrayOfRational = Array< Rational >
 

Functions

constexpr Index gcd (Index a, Index b) noexcept
 Returns the greatest common denominator of two numbers. More...
 
constexpr Rational reduce_by_gcd (const Rational a) noexcept
 Returns the rational reduced by the greates. More...
 
constexpr Rational numeric2rational (Numeric x, size_t maxdec=4) noexcept
 Rational from Numeric. More...
 
constexpr Rational operator- (const Rational a) noexcept
 Negative. More...
 
constexpr Rational operator+ (const Rational a) noexcept
 Positive. More...
 
constexpr Rational operator+ (const Rational a, const Rational b) noexcept
 Addition. More...
 
constexpr Rational operator+ (const Rational a, Index b) noexcept
 Addition. More...
 
constexpr Rational operator+ (const Rational a, int b) noexcept
 Addition. More...
 
constexpr Rational operator+ (Index b, const Rational a) noexcept
 Addition. More...
 
constexpr Rational operator+ (int b, const Rational a) noexcept
 Addition. More...
 
constexpr Rational operator- (const Rational a, const Rational b) noexcept
 Subtraction. More...
 
constexpr Rational operator- (const Rational a, Index b) noexcept
 Subtraction. More...
 
constexpr Rational operator- (const Rational a, int b) noexcept
 Subtraction. More...
 
constexpr Rational operator- (Index b, const Rational a) noexcept
 Subtraction. More...
 
constexpr Rational operator- (int b, const Rational a) noexcept
 Subtraction. More...
 
constexpr Rational operator/ (const Rational a, const Rational b) noexcept
 Division. More...
 
constexpr Rational operator/ (const Rational a, Index b) noexcept
 Division. More...
 
constexpr Rational operator/ (const Rational a, int b) noexcept
 Division. More...
 
constexpr Rational operator/ (Index b, const Rational a) noexcept
 Division. More...
 
constexpr Rational operator/ (int b, const Rational a) noexcept
 Division. More...
 
constexpr Rational operator* (const Rational a, const Rational b) noexcept
 Multiplication. More...
 
constexpr Rational operator* (const Rational a, Index b) noexcept
 Multiplication. More...
 
constexpr Rational operator* (const Rational a, int b) noexcept
 Multiplication. More...
 
constexpr Rational operator* (Index b, const Rational a) noexcept
 Multiplication. More...
 
constexpr Rational operator* (int b, const Rational a) noexcept
 Multiplication. More...
 
constexpr Rational operator% (const Rational a, const Rational b) noexcept
 Remainder. More...
 
constexpr Rational operator% (const Rational a, Index b) noexcept
 Remainder. More...
 
constexpr Rational operator% (const Rational a, int b) noexcept
 Remainder. More...
 
constexpr Rational operator% (Index b, const Rational a) noexcept
 Remainder. More...
 
constexpr Rational operator% (int b, const Rational a) noexcept
 Remainder. More...
 
constexpr bool operator== (const Rational a, const Rational b) noexcept
 Equality. More...
 
constexpr bool operator!= (const Rational a, const Rational b) noexcept
 Inequality. More...
 
constexpr bool operator< (const Rational a, const Rational b) noexcept
 Less than. More...
 
constexpr bool operator> (const Rational a, const Rational b) noexcept
 More than. More...
 
constexpr bool operator<= (const Rational a, const Rational b) noexcept
 Less than or equal to. More...
 
constexpr bool operator>= (const Rational a, const Rational b) noexcept
 More than or equal to. More...
 
constexpr bool operator! (const Rational a) noexcept
 Not. More...
 
Numeric sqrt (const Rational r)
 Square root. More...
 
Numeric pow (const Rational base, Numeric exp)
 Power of. More...
 
Numeric pow (Numeric base, const Rational exp)
 Power of. More...
 
Numeric pow (const Rational base, const Rational exp)
 Power of. More...
 
std::ostream & operator<< (std::ostream &os, const Rational &a)
 Output operator. More...
 
std::istream & operator>> (std::istream &is, Rational &a)
 Input operator. More...
 
constexpr bool operator< (const Index a, const Rational b) noexcept
 less More...
 
constexpr bool operator< (const int a, const Rational b) noexcept
 less More...
 
constexpr bool operator< (const Rational a, const Index b) noexcept
 less More...
 
constexpr bool operator< (const Rational a, const int b) noexcept
 less More...
 
constexpr bool operator> (const Index a, const Rational b) noexcept
 more More...
 
constexpr bool operator> (const int a, const Rational b) noexcept
 more More...
 
constexpr bool operator> (const Rational a, const Index b) noexcept
 more More...
 
constexpr bool operator> (const Rational a, const int b) noexcept
 more More...
 
constexpr bool operator== (const Rational a, const Index b) noexcept
 equal More...
 
constexpr bool operator== (const Rational a, const int b) noexcept
 equal More...
 
constexpr bool operator!= (const Rational a, const Index b) noexcept
 not equal More...
 
constexpr bool operator!= (const Rational a, const int b) noexcept
 not equal More...
 
constexpr Rational abs (const Rational a) noexcept
 Absolute. More...
 
constexpr Rational max (const Rational a, const Rational b) noexcept
 Maximum. More...
 
constexpr Rational min (const Rational a, const Rational b) noexcept
 Minimum. More...
 
constexpr Rational operator""_2 (unsigned long long int n) noexcept
 Returns common operator n/2. More...
 
constexpr bool iseven (const Rational r) noexcept
 Returns true if even integer. More...
 

Detailed Description

Contains the rational class definition.

Author
Richard Larsson
Date
2012-10-31

Definition in file rational.h.

Macro Definition Documentation

◆ RATIONAL_UNDEFINED

#define RATIONAL_UNDEFINED   Rational(0, 0)

Definition at line 391 of file rational.h.

Typedef Documentation

◆ ArrayOfRational

Definition at line 926 of file rational.h.

Function Documentation

◆ abs()

constexpr Rational abs ( const Rational  a)
constexprnoexcept

Absolute.

Parameters
[in]aAny Rational
Returns
constexpr Rational Absolute value of the Rational

Definition at line 902 of file rational.h.

References a.

◆ gcd()

constexpr Index gcd ( Index  a,
Index  b 
)
constexprnoexcept

Returns the greatest common denominator of two numbers.

Parameters
[in]anumber a
[in]bnumber b
Returns
num such that Rational(a/num, b/num) is the same as Rational(a, b)

Definition at line 44 of file rational.h.

References a, b, and gcd().

Referenced by gcd(), Rational::Rational(), and reduce_by_gcd().

◆ iseven()

constexpr bool iseven ( const Rational  r)
constexprnoexcept

Returns true if even integer.

Parameters
[in]rAny rational
Returns
true if r is even, otherwise false

Definition at line 942 of file rational.h.

Referenced by Absorption::LineMixing::Makarov2020etal::reduced_dipole(), and Absorption::reduced_magnetic_quadrapole().

◆ max()

constexpr Rational max ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Maximum.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
constexpr Rational Largest of a and b

Definition at line 912 of file rational.h.

References a, and b.

◆ min()

constexpr Rational min ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Minimum.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
constexpr Rational Smallest of a and b

Definition at line 922 of file rational.h.

References a, and b.

◆ numeric2rational()

constexpr Rational numeric2rational ( Numeric  x,
size_t  maxdec = 4 
)
constexprnoexcept

Rational from Numeric.

Performs basic rounding

Parameters
[in]xNumeric value
[in]maxdecMaximum number of decimals

Definition at line 361 of file rational.h.

Referenced by Rational::Rational(), and test_numeric2rational().

◆ operator!()

constexpr bool operator! ( const Rational  a)
constexprnoexcept

Not.

Parameters
[in]aAny Rational
Returns
true If a.Nom() and a.isDefined()
false Otherwise

Definition at line 732 of file rational.h.

References a.

◆ operator!=() [1/3]

constexpr bool operator!= ( const Rational  a,
const Index  b 
)
constexprnoexcept

not equal

Parameters
[in]aAny Rational
[in]bAny Index
Returns
True if a is not equal to b

Definition at line 883 of file rational.h.

References a, and b.

◆ operator!=() [2/3]

constexpr bool operator!= ( const Rational  a,
const int  b 
)
constexprnoexcept

not equal

Parameters
[in]aAny Rational
[in]bAny Index
Returns
True if a is not equal to b

Definition at line 893 of file rational.h.

References a, and b.

◆ operator!=() [3/3]

constexpr bool operator!= ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Inequality.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
true If not equal
false Otherwise

Definition at line 679 of file rational.h.

References a, and b.

◆ operator""_2()

constexpr Rational operator""_2 ( unsigned long long int  n)
constexprnoexcept

Returns common operator n/2.

Parameters
[in]nAny positive integer
Returns
Rational(n, 2)

Definition at line 933 of file rational.h.

◆ operator%() [1/5]

constexpr Rational operator% ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Remainder.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
constexpr Rational a % b

Definition at line 613 of file rational.h.

References a, and b.

◆ operator%() [2/5]

constexpr Rational operator% ( const Rational  a,
Index  b 
)
constexprnoexcept

Remainder.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a % b

Definition at line 626 of file rational.h.

References a, and b.

◆ operator%() [3/5]

constexpr Rational operator% ( const Rational  a,
int  b 
)
constexprnoexcept

Remainder.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a % b

Definition at line 636 of file rational.h.

References a, and b.

◆ operator%() [4/5]

constexpr Rational operator% ( Index  b,
const Rational  a 
)
constexprnoexcept

Remainder.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational b % a

Definition at line 646 of file rational.h.

References a, and b.

◆ operator%() [5/5]

constexpr Rational operator% ( int  b,
const Rational  a 
)
constexprnoexcept

Remainder.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational b % a

Definition at line 656 of file rational.h.

References a, and b.

◆ operator*() [1/5]

constexpr Rational operator* ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Multiplication.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
constexpr Rational a * b

Definition at line 567 of file rational.h.

References a, and b.

Referenced by operator*().

◆ operator*() [2/5]

constexpr Rational operator* ( const Rational  a,
Index  b 
)
constexprnoexcept

Multiplication.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a * b

Definition at line 577 of file rational.h.

References a, and b.

◆ operator*() [3/5]

constexpr Rational operator* ( const Rational  a,
int  b 
)
constexprnoexcept

Multiplication.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a * b

Definition at line 587 of file rational.h.

References a, and b.

◆ operator*() [4/5]

constexpr Rational operator* ( Index  b,
const Rational  a 
)
constexprnoexcept

Multiplication.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational a * b

Definition at line 597 of file rational.h.

References a, b, and operator*().

◆ operator*() [5/5]

constexpr Rational operator* ( int  b,
const Rational  a 
)
constexprnoexcept

Multiplication.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational a * b

Definition at line 605 of file rational.h.

References a, b, and operator*().

◆ operator+() [1/6]

constexpr Rational operator+ ( const Rational  a)
constexprnoexcept

Positive.

Parameters
[in]aAny Rational
Returns
constexpr Rational a

Definition at line 407 of file rational.h.

References a.

Referenced by operator+().

◆ operator+() [2/6]

constexpr Rational operator+ ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Addition.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
constexpr Rational a + b

Definition at line 415 of file rational.h.

References a, and b.

◆ operator+() [3/6]

constexpr Rational operator+ ( const Rational  a,
Index  b 
)
constexprnoexcept

Addition.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a + b

Definition at line 428 of file rational.h.

References a, and b.

◆ operator+() [4/6]

constexpr Rational operator+ ( const Rational  a,
int  b 
)
constexprnoexcept

Addition.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a + b

Definition at line 438 of file rational.h.

References a, and b.

◆ operator+() [5/6]

constexpr Rational operator+ ( Index  b,
const Rational  a 
)
constexprnoexcept

Addition.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational a + b

Definition at line 448 of file rational.h.

References a, b, and operator+().

◆ operator+() [6/6]

constexpr Rational operator+ ( int  b,
const Rational  a 
)
constexprnoexcept

Addition.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational a + b

Definition at line 456 of file rational.h.

References a, b, and operator+().

◆ operator-() [1/6]

constexpr Rational operator- ( const Rational  a)
constexprnoexcept

Negative.

Parameters
[in]aAny Rational
Returns
constexpr Rational Negative a

Definition at line 398 of file rational.h.

References a.

◆ operator-() [2/6]

constexpr Rational operator- ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Subtraction.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
constexpr Rational a - b

Definition at line 464 of file rational.h.

References a, and b.

◆ operator-() [3/6]

constexpr Rational operator- ( const Rational  a,
Index  b 
)
constexprnoexcept

Subtraction.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a - b

Definition at line 477 of file rational.h.

References a, and b.

◆ operator-() [4/6]

constexpr Rational operator- ( const Rational  a,
int  b 
)
constexprnoexcept

Subtraction.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a - b

Definition at line 487 of file rational.h.

References a, and b.

◆ operator-() [5/6]

constexpr Rational operator- ( Index  b,
const Rational  a 
)
constexprnoexcept

Subtraction.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational b - a

Definition at line 497 of file rational.h.

References a, and b.

◆ operator-() [6/6]

constexpr Rational operator- ( int  b,
const Rational  a 
)
constexprnoexcept

Subtraction.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational b - a

Definition at line 507 of file rational.h.

References a, and b.

◆ operator/() [1/5]

constexpr Rational operator/ ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Division.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
constexpr Rational a / b

Definition at line 517 of file rational.h.

References a, and b.

◆ operator/() [2/5]

constexpr Rational operator/ ( const Rational  a,
Index  b 
)
constexprnoexcept

Division.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a / b

Definition at line 527 of file rational.h.

References a, and b.

◆ operator/() [3/5]

constexpr Rational operator/ ( const Rational  a,
int  b 
)
constexprnoexcept

Division.

Parameters
[in]aAny Rational
[in]bAny Index
Returns
constexpr Rational a / b

Definition at line 537 of file rational.h.

References a, and b.

◆ operator/() [4/5]

constexpr Rational operator/ ( Index  b,
const Rational  a 
)
constexprnoexcept

Division.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational b / a

Definition at line 547 of file rational.h.

References a, and b.

◆ operator/() [5/5]

constexpr Rational operator/ ( int  b,
const Rational  a 
)
constexprnoexcept

Division.

Parameters
[in]bAny Index
[in]aAny Rational
Returns
constexpr Rational b / a

Definition at line 557 of file rational.h.

References a, and b.

◆ operator<() [1/5]

constexpr bool operator< ( const Index  a,
const Rational  b 
)
constexprnoexcept

less

Parameters
[in]aAny Index
[in]bAny Rational
Returns
True if a is less than b

Definition at line 783 of file rational.h.

References a, and b.

◆ operator<() [2/5]

constexpr bool operator< ( const int  a,
const Rational  b 
)
constexprnoexcept

less

Parameters
[in]aAny Index
[in]bAny Rational
Returns
True if a is less than b

Definition at line 793 of file rational.h.

References a, and b.

◆ operator<() [3/5]

constexpr bool operator< ( const Rational  a,
const Index  b 
)
constexprnoexcept

less

Parameters
[in]aAny Rational
[in]bAny Index
Returns
True if a is less than b

Definition at line 803 of file rational.h.

References a, and b.

◆ operator<() [4/5]

constexpr bool operator< ( const Rational  a,
const int  b 
)
constexprnoexcept

less

Parameters
[in]aAny Rational
[in]bAny Index
Returns
True if a is less than b

Definition at line 813 of file rational.h.

References a, and b.

◆ operator<() [5/5]

constexpr bool operator< ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Less than.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
true If a < b
false Otherwise

Definition at line 690 of file rational.h.

References a, and b.

Referenced by operator>(), and operator>=().

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const Rational a 
)

Output operator.

Definition at line 33 of file rational.cc.

References a, Rational::Denom(), Rational::fixSign(), Rational::Nom(), and reduce_by_gcd().

◆ operator<=()

constexpr bool operator<= ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Less than or equal to.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
true If a <= b
false Otherwise

Definition at line 711 of file rational.h.

References a, b, and operator>().

◆ operator==() [1/3]

constexpr bool operator== ( const Rational  a,
const Index  b 
)
constexprnoexcept

equal

Parameters
[in]aAny Rational
[in]bAny Index
Returns
True if a is equal to b

Definition at line 863 of file rational.h.

References a, and b.

◆ operator==() [2/3]

constexpr bool operator== ( const Rational  a,
const int  b 
)
constexprnoexcept

equal

Parameters
[in]aAny Rational
[in]bAny Index
Returns
True if a is equal to b

Definition at line 873 of file rational.h.

References a, and b.

◆ operator==() [3/3]

constexpr bool operator== ( const Rational  a,
const Rational  b 
)
constexprnoexcept

Equality.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
true If equal
false Otherwise

Definition at line 667 of file rational.h.

References a, and b.

◆ operator>() [1/5]

constexpr bool operator> ( const Index  a,
const Rational  b 
)
constexprnoexcept

more

Parameters
[in]aAny Index
[in]bAny Rational
Returns
True if a is more than b

Definition at line 823 of file rational.h.

References a, and b.

◆ operator>() [2/5]

constexpr bool operator> ( const int  a,
const Rational  b 
)
constexprnoexcept

more

Parameters
[in]aAny Index
[in]bAny Rational
Returns
True if a is more than b

Definition at line 833 of file rational.h.

References a, and b.

◆ operator>() [3/5]

constexpr bool operator> ( const Rational  a,
const Index  b 
)
constexprnoexcept

more

Parameters
[in]aAny Rational
[in]bAny Index
Returns
True if a is more than b

Definition at line 843 of file rational.h.

References a, and b.

◆ operator>() [4/5]

constexpr bool operator> ( const Rational  a,
const int  b 
)
constexprnoexcept

more

Parameters
[in]aAny Rational
[in]bAny Index
Returns
True if a is more than b

Definition at line 853 of file rational.h.

References a, and b.

◆ operator>() [5/5]

constexpr bool operator> ( const Rational  a,
const Rational  b 
)
constexprnoexcept

More than.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
true If a > b
false Otherwise

Definition at line 702 of file rational.h.

References a, b, and operator<().

Referenced by operator<=().

◆ operator>=()

constexpr bool operator>= ( const Rational  a,
const Rational  b 
)
constexprnoexcept

More than or equal to.

Parameters
[in]aAny Rational
[in]bAny Rational
Returns
true If a >= b
false Otherwise

Definition at line 722 of file rational.h.

References a, b, and operator<().

◆ operator>>()

std::istream & operator>> ( std::istream &  is,
Rational a 
)

◆ pow() [1/3]

Numeric pow ( const Rational  base,
const Rational  exp 
)
inline

Power of.

Parameters
[in]baseAny Rational
[in]expAny Rational
Returns
Numeric base to the power of exp

Definition at line 767 of file rational.h.

References pow(), and Rational::toNumeric().

◆ pow() [2/3]

Numeric pow ( const Rational  base,
Numeric  exp 
)
inline

Power of.

Parameters
[in]baseAny Rational
[in]expAny Numeric
Returns
Numeric base to the power of exp

Definition at line 747 of file rational.h.

References pow(), and Rational::toNumeric().

Referenced by abs_lookupSetup(), abs_lookupSetupBatch(), abs_lookupSetupWide(), antenna_responseGaussian(), antenna_responseVaryingGaussian(), BF86_CIA_N2(), cart2poslos(), CKD_mt_250_o2_vis(), CKD_mt_v1v0_o2(), lm_hitran_2017::compabs(), conti_n2__(), lm_hitran_2017::convtp(), CP98H2OAbsModel(), Minimize::T4::df(), Minimize::DPL::df(), diameter_maxFromDiameter_volume_equ(), diameter_volume_equFromDiameter_max(), doit_conv_flagLsq(), ELL07WaterDropletAbs(), TelsemAtlas::emis_interp(), fctl_(), g0Earth(), gaussian_response(), get_ppath_cloudvars(), Ho66_CO2_foreign_continuum(), Ho66_CO2_self_continuum(), binistream::ieee_double2float(), binistream::ieee_single2float(), iyIndependentBeamApproximation(), MaTipping_H2O_foreign_continuum(), matrix_exp(), mgd(), mgd_with_derivatives(), mod_gamma_dist(), MPM02H2OAbsModel(), MPM85O2AbsModel(), MPM87H2OAbsModel(), MPM87O2AbsModel(), MPM89H2OAbsModel(), MPM89O2AbsModel(), MPM92O2AbsModel(), MPM93_H2O_continuum(), MPM93_N2_continuum(), MPM93_O2_continuum(), MPM93H2OAbsModel(), MPM93IceCrystalAbs(), MPM93O2AbsModel(), MPM93RainExt(), MPM93WaterDropletAbs(), Minimize::T4::operator()(), Minimize::DPL::operator()(), Pardo_ATM_H2O_ForeignContinuum(), Pardo_ATM_N2_dry_continuum(), particle_bulkpropRadarOnionPeeling(), PFromZSimple(), polynomial_basis_func(), pow(), psd_cloudice_MH97(), psd_mgd_mass_and_something(), psd_rain_W16(), psdModifiedGammaMass(), PWR93O2AbsModel(), PWR98H2OAbsModel(), Absorption::ReadFromArtscat3Stream(), Absorption::ReadFromJplStream(), refellipsoidForAzimuth(), refellipsoidOrbitPlane(), Rosenkranz_CO2_foreign_continuum(), Rosenkranz_CO2_self_continuum(), Rosenkranz_N2_self_continuum(), Rosenkranz_O2_continuum(), rtmethods_jacobian_finalisation(), Legendre::schmidt(), Standard_H2O_foreign_continuum(), Standard_H2O_self_continuum(), Standard_N2_self_continuum(), Standard_O2_continuum(), surface_specular_R_and_b(), swv_mpmf87s93__(), transform_jacobian(), transform_x_back(), TRE05O2AbsModel(), yCalc(), and yRadar().

◆ pow() [3/3]

Numeric pow ( Numeric  base,
const Rational  exp 
)
inline

Power of.

Parameters
[in]baseAny Numeric
[in]expAny Rational
Returns
Numeric base to the power of exp

Definition at line 757 of file rational.h.

References pow(), and Rational::toNumeric().

◆ reduce_by_gcd()

constexpr Rational reduce_by_gcd ( const Rational  a)
constexprnoexcept

Returns the rational reduced by the greates.

Parameters
[in]aAny Rational
Returns
a / gcd(a)

Definition at line 347 of file rational.h.

References a, and gcd().

Referenced by operator<<(), and Rational::simplify_in_place().

◆ sqrt()

Numeric sqrt ( const Rational  r)
inline

Square root.

Parameters
[in]rAny Rational
Returns
Numeric Square root of the Rational

Definition at line 739 of file rational.h.

References sqrt(), and Rational::toNumeric().

Referenced by antenna_responseGaussian(), antenna_responseVaryingGaussian(), LineShape::SpeedDependentVoigt::calc(), cart2pol(), cart2poslos(), cart2sph(), cart2sph_plain(), cart2zaaa(), case_b_g_coefficient_o2(), cayley_hamilton_fitted_method_4x4_propmat_to_transmat__eigen(), cayley_hamilton_fitted_method_4x4_propmat_to_transmat__explicit(), lm_hitran_2017::compabs(), complex_n_ice_matzler06(), complex_n_water_liebe93(), compute_transmission_matrix(), compute_transmission_matrix_and_derivative(), compute_transmission_matrix_from_averaged_matrix_at_frequency(), lm_hitran_2017::convtp(), covmat_sxExtractSqrtDiagonal(), doit_conv_flagLsq(), Absorption::Lines::DopplerConstant(), dotprod_with_los(), MCAntenna::draw_los(), dtransmat3(), Absorption::LineMixing::Makarov2020etal::erot(), Zeeman::FromGrids(), gaussian_response(), gaussian_response_autogrid(), geompath_l_at_r(), geompath_r_at_l(), geompath_tanpos_3d(), Absorption::PredefinedModel::makarov2020_o2_lines_mpm(), MCGeneral(), LineShape::HartmannTran::operator()(), Absorption::LineMixing::PopulationAndDipole::PopulationAndDipole(), psd_cloudice_MH97(), r_crossing_3d(), ran_gaussian(), TelsemAtlas::read(), lm_hitran_2017::readlines(), Absorption::LineMixing::Makarov2020etal::reduced_dipole(), Absorption::reduced_magnetic_quadrapole(), refellipsoidForAzimuth(), refellipsoidOrbitPlane(), refr_index_airInfraredEarth(), relaxation_matrix_element(), Absorption::LineMixing::Makarov2020etal::relaxation_matrix_offdiagonal(), retrievalErrorsExtract(), Legendre::schmidt(), sphdist(), sqrt(), surf_radius_at_l(), test2(), transmat3(), unitl(), vector_angle(), and yCalc().