ARTS 2.5.4 (git: 31ce4f0e)
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 <numeric>
#include <ostream>

Go to the source code of this file.

Classes

struct  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 Rational reduce_by_gcd (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...
 
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...
 
constexpr Numeric operator* (Rational y, Numeric x) noexcept
 Multiplication with numeric. More...
 
constexpr Numeric operator* (Numeric x, Rational y) noexcept
 
constexpr Numeric operator/ (Rational y, Numeric x) noexcept
 Division with numeric. More...
 
constexpr Numeric operator/ (Numeric x, Rational y) noexcept
 
constexpr Numeric operator+ (Rational y, Numeric x) noexcept
 Addition with numeric. More...
 
constexpr Numeric operator+ (Numeric x, Rational y) noexcept
 
constexpr Numeric operator- (Rational y, Numeric x) noexcept
 Subtraction with numeric. More...
 
constexpr Numeric operator- (Numeric x, Rational y) noexcept
 

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 357 of file rational.h.

Typedef Documentation

◆ ArrayOfRational

Definition at line 886 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 862 of file rational.h.

References a.

◆ iseven()

◆ 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 872 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 882 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 329 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.numer and a.isDefined()
false Otherwise

Definition at line 698 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 843 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 853 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 645 of file rational.h.

References a, and b.

Referenced by Species::ENUMCLASS().

◆ 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 893 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 579 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 592 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 602 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 612 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 622 of file rational.h.

References a, and b.

◆ operator*() [1/7]

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 533 of file rational.h.

References a, and b.

Referenced by operator*().

◆ operator*() [2/7]

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 543 of file rational.h.

References a, and b.

◆ operator*() [3/7]

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 553 of file rational.h.

References a, and b.

◆ operator*() [4/7]

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 563 of file rational.h.

References a, b, and operator*().

◆ operator*() [5/7]

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 571 of file rational.h.

References a, b, and operator*().

◆ operator*() [6/7]

constexpr Numeric operator* ( Numeric  x,
Rational  y 
)
constexprnoexcept

Definition at line 908 of file rational.h.

References Rational::toNumeric().

◆ operator*() [7/7]

constexpr Numeric operator* ( Rational  y,
Numeric  x 
)
constexprnoexcept

Multiplication with numeric.

Definition at line 907 of file rational.h.

References Rational::toNumeric().

◆ operator+() [1/8]

constexpr Rational operator+ ( const Rational  a)
constexprnoexcept

Positive.

Parameters
[in]aAny Rational
Returns
constexpr Rational a

Definition at line 373 of file rational.h.

References a.

Referenced by operator+().

◆ operator+() [2/8]

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 381 of file rational.h.

References a, and b.

◆ operator+() [3/8]

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 394 of file rational.h.

References a, and b.

◆ operator+() [4/8]

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 404 of file rational.h.

References a, and b.

◆ operator+() [5/8]

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 414 of file rational.h.

References a, b, and operator+().

◆ operator+() [6/8]

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 422 of file rational.h.

References a, b, and operator+().

◆ operator+() [7/8]

constexpr Numeric operator+ ( Numeric  x,
Rational  y 
)
constexprnoexcept

Definition at line 916 of file rational.h.

References Rational::toNumeric().

◆ operator+() [8/8]

constexpr Numeric operator+ ( Rational  y,
Numeric  x 
)
constexprnoexcept

Addition with numeric.

Definition at line 915 of file rational.h.

References Rational::toNumeric().

◆ operator-() [1/8]

constexpr Rational operator- ( const Rational  a)
constexprnoexcept

Negative.

Parameters
[in]aAny Rational
Returns
constexpr Rational Negative a

Definition at line 364 of file rational.h.

References a.

◆ operator-() [2/8]

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 430 of file rational.h.

References a, and b.

◆ operator-() [3/8]

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 443 of file rational.h.

References a, and b.

◆ operator-() [4/8]

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 453 of file rational.h.

References a, and b.

◆ operator-() [5/8]

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 463 of file rational.h.

References a, and b.

◆ operator-() [6/8]

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 473 of file rational.h.

References a, and b.

◆ operator-() [7/8]

constexpr Numeric operator- ( Numeric  x,
Rational  y 
)
constexprnoexcept

Definition at line 920 of file rational.h.

References Rational::toNumeric().

◆ operator-() [8/8]

constexpr Numeric operator- ( Rational  y,
Numeric  x 
)
constexprnoexcept

Subtraction with numeric.

Definition at line 919 of file rational.h.

References Rational::toNumeric().

◆ operator/() [1/7]

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 483 of file rational.h.

References a, and b.

◆ operator/() [2/7]

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 493 of file rational.h.

References a, and b.

◆ operator/() [3/7]

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 503 of file rational.h.

References a, and b.

◆ operator/() [4/7]

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 513 of file rational.h.

References a, and b.

◆ operator/() [5/7]

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 523 of file rational.h.

References a, and b.

◆ operator/() [6/7]

constexpr Numeric operator/ ( Numeric  x,
Rational  y 
)
constexprnoexcept

Definition at line 912 of file rational.h.

References Rational::toNumeric().

◆ operator/() [7/7]

constexpr Numeric operator/ ( Rational  y,
Numeric  x 
)
constexprnoexcept

Division with numeric.

Definition at line 911 of file rational.h.

References Rational::toNumeric().

◆ 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 743 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 753 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 763 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 773 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 656 of file rational.h.

References a, and b.

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

◆ 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 677 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 823 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 833 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 633 of file rational.h.

References a, and b.

Referenced by Species::ENUMCLASS(), and Quantum::Number::Value::good().

◆ 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 783 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 793 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 803 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 813 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 668 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 688 of file rational.h.

References a, b, and operator<().

◆ 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 733 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 713 of file rational.h.

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

Referenced by antenna_responseGaussian(), antenna_responseVaryingGaussian(), BF86_CIA_N2(), bound32_(), bound54_(), cart2poslos(), CKD_222_self_h2o(), CKD_242_self_h2o(), CKD_mt_100_self_h2o(), CKD_mt_250_CIAfun_n2(), CKD_mt_250_CIArot_n2(), CKD_mt_250_co2(), CKD_mt_250_foreign_h2o(), CKD_mt_250_o2_vis(), CKD_mt_250_self_h2o(), CKD_mt_320_foreign_h2o(), CKD_mt_320_self_h2o(), CKD_mt_CIArot_n2(), CKD_mt_v1v0_o2(), lm_hitran_2017::compabs(), conti_n2__(), lm_hitran_2017::convtp(), CP98H2OAbsModel(), delanoe_shape_with_derivative(), Minimize::T4::df(), Minimize::DPL::df(), diameter_maxFromDiameter_volume_equ(), diameter_volume_equFromDiameter_max(), dm_from_iwc_n0(), doit_conv_flagLsq(), ELL07WaterDropletAbs(), TelsemAtlas::emis_interp(), fctl_(), g0Earth(), gaussian_response(), get_ppath_cloudvars(), Ho66_CO2_foreign_continuum(), Ho66_CO2_self_continuum(), IntersectionGeometricalWithAltitude(), 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(), n0_from_iwc_dm(), 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_mgd_smm_common(), psd_MY05(), psd_rain_W16(), psd_SB06(), psd_snow_F07(), 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(), Legendre::schmidt_fieldcalc(), Standard_H2O_foreign_continuum(), Standard_H2O_self_continuum(), Standard_N2_self_continuum(), Standard_O2_continuum(), surface_specular_R_and_b(), surfaceMapToLinearPolarisation(), swv24_(), swv_mpmf87s93__(), test01(), 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 723 of file rational.h.

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

◆ reduce_by_gcd()

constexpr Rational reduce_by_gcd ( Rational  a)
constexprnoexcept

Returns the rational reduced by the greates.

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

Definition at line 315 of file rational.h.

References a.

Referenced by Rational::simplify_in_place(), Quantum::Number::Value::Value(), and Quantum::Number::value_holder().

◆ sqrt()

Numeric sqrt ( const Rational  r)
inline

Square root.

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

Definition at line 705 of file rational.h.

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

Referenced by antenna_responseGaussian(), antenna_responseVaryingGaussian(), bgama_(), LineShape::SpeedDependentVoigt::calc(), LineShape::HartmannTran::calc(), cart2geodetic(), cart2pol(), cart2poslos(), cart2sph(), cart2sph_plain(), cart2zaaa(), case_b_g_coefficient_o2(), 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(), dwigner3j(), Absorption::LineMixing::Makarov2020etal::erot(), Zeeman::FromGrids(), gaussian_response(), gaussian_response_autogrid(), geodetic2cart(), geodeticposlos2cart(), geompath_l_at_r(), geompath_r_at_l(), geompath_tanpos_3d(), get_star_radiation(), lm_hitran_2017::hitran_lm_eigenvalue_approximation(), LineShape::SpeedDependentVoigt::init(), LineShape::HartmannTran::init(), IntersectionGeometricalWithAltitude(), line_circle_intersect(), line_refellipsoid_intersect(), line_sphere_intersect(), MCGeneral(), MCRadar(), LineShape::HartmannTran::operator()(), Absorption::LineMixing::PopulationAndDipole::PopulationAndDipole(), ppathFixedLstep(), psd_cloudice_MH97(), r_crossing_3d(), IGRF::radius(), ran_gaussian(), TelsemAtlas::read(), lm_hitran_2017::readlines(), Absorption::LineMixing::Makarov2020etal::reduced_dipole(), Absorption::reduced_magnetic_quadrapole(), Absorption::reduced_rovibrational_dipole(), refell2r(), refellipsoidForAzimuth(), refellipsoidOrbitPlane(), refr_index_airFreeElectrons(), refr_index_airInfraredEarth(), refractive_index_water_and_steam_VisNIR(), relaxation_matrix_element(), Absorption::LineMixing::Makarov2020etal::relaxation_matrix_offdiagonal(), Absorption::LineMixing::LinearRovibErrorCorrectedSudden::relaxation_matrix_offdiagonal(), retrievalErrorsExtract(), rotationmat3D(), Legendre::schmidt(), sphdist(), sqrt(), surf_radius_at_l(), test2(), test31(), test_oem_gauss_newton(), test_oem_levenberg_marquardt(), test_oem_linear(), Legendre::to_geodetic(), transmat3(), unitl(), vector_angle(), and yCalc().