bertini.multiprec¶
Multiprecision types, and functions that operate on them.
Numeric types exposed are
complex_mp (Boost.Multiprecision mpc)
real_mp (Boost.Multiprecision mpfr)
int_mp (Boost.Multiprecision mpz)
rational_mp (Boost.Multiprecision.mpq)
This namespace also includes the mathematical operators, like cos, etc.
- bertini.multiprec.abs((int_mp)val) int_mp :¶
absolute value
- abs( (real_mp)val) -> real_mp :
absolute value
- abs( (rational_mp)val) -> rational_mp :
absolute value
- abs( (complex_mp)arg1) -> real_mp :
the magnitude of a complex number
- bertini.multiprec.acos((real_mp)val) real_mp :¶
arccosine
- acos( (complex_mp)val) -> complex_mp :
arccosine
- bertini.multiprec.acosh((real_mp)val) real_mp :¶
hyperbolic arccosine
- acosh( (complex_mp)val) -> complex_mp :
hyperbolic arccosine
- bertini.multiprec.arg((complex_mp)arg1) real_mp :¶
the argument, or the angle from 0. beware the branch cut.
- arg( (numpy.ndarray)val) -> numpy.ndarray :
the arguments (angles from 0) of an array of complex numbers, as an array of real_mp. beware the branch cut.
- bertini.multiprec.asin((real_mp)val) real_mp :¶
arcsine
- asin( (complex_mp)val) -> complex_mp :
arcsine
- bertini.multiprec.asinh((real_mp)val) real_mp :¶
hyperbolic arcsine
- asinh( (complex_mp)val) -> complex_mp :
hyperbolic arcsine
- bertini.multiprec.atan((real_mp)val) real_mp :¶
arctangent
- atan( (complex_mp)val) -> complex_mp :
arctangent
- bertini.multiprec.atanh((real_mp)val) real_mp :¶
hyperbolic arctangent
- atanh( (complex_mp)val) -> complex_mp :
hyperbolic arctangent
- class bertini.multiprec.complex_mp((object)arg1)¶
Bases:
generic,instance- __init__( (object)self, (float)real) -> None :
Construct variable-precision complex number from a double, with 0 imaginary part. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (real_mp)real) -> None :
Construct variable-precision complex number from a variable-precision float, with 0 imaginary part
- __init__( (object)self, (str)real) -> None :
Construct variable-precision complex number from a string, with 0 imaginary part
- __init__( (object)self, (real_mp)real, (real_mp)imag) -> None :
Construct variable-precision complex number from a pair of variable-precision floats
- __init__( (object)self, (float)real, (float)imag) -> None :
Construct variable-precision complex number from a pair of doubles. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (str)real, (real_mp)imag) -> None :
Construct variable-precision complex number from a string and a variable-precision float
- __init__( (object)self, (real_mp)real, (str)imag) -> None :
Construct variable-precision complex number from a variable-precision float and a string
- __init__( (object)self, (str)real, (str)imag) -> None :
Construct variable-precision complex number from a pair of strings. the best way to construct one and be sure you have padded with zeros to the end, in the current working precision
- __init__( (object)arg1, (complex)value) -> object :
Construct variable-precision complex number from a python complex. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (complex_mp)value) -> None :
Construct variable-precision complex number from another one
- __init__( (object)self, (int_mp)real) -> None :
Construct variable-precision complex number from an arbitrary-precision integer, with 0 imaginary part
- __init__( (object)self, (int_mp)real, (int_mp)imag) -> None :
Construct variable-precision complex number from a pair of arbitrary-precision integers
- __init__((object)arg1) None¶
- __init__( (object)self, (float)real) -> None :
Construct variable-precision complex number from a double, with 0 imaginary part. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (real_mp)real) -> None :
Construct variable-precision complex number from a variable-precision float, with 0 imaginary part
- __init__( (object)self, (str)real) -> None :
Construct variable-precision complex number from a string, with 0 imaginary part
- __init__( (object)self, (real_mp)real, (real_mp)imag) -> None :
Construct variable-precision complex number from a pair of variable-precision floats
- __init__( (object)self, (float)real, (float)imag) -> None :
Construct variable-precision complex number from a pair of doubles. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (str)real, (real_mp)imag) -> None :
Construct variable-precision complex number from a string and a variable-precision float
- __init__( (object)self, (real_mp)real, (str)imag) -> None :
Construct variable-precision complex number from a variable-precision float and a string
- __init__( (object)self, (str)real, (str)imag) -> None :
Construct variable-precision complex number from a pair of strings. the best way to construct one and be sure you have padded with zeros to the end, in the current working precision
- __init__( (object)arg1, (complex)value) -> object :
Construct variable-precision complex number from a python complex. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (complex_mp)value) -> None :
Construct variable-precision complex number from another one
- __init__( (object)self, (int_mp)real) -> None :
Construct variable-precision complex number from an arbitrary-precision integer, with 0 imaginary part
- __init__( (object)self, (int_mp)real, (int_mp)imag) -> None :
Construct variable-precision complex number from a pair of arbitrary-precision integers
- dtype = dtype(complex_mp)¶
- property imag¶
the imaginary part of the complex number
- property precision¶
get/set the precision of this variable-precision number, in digits. remember, the system knows not where your number came from, so upsampling will NOT add more correct digits.
- property real¶
the real part of the complex number
- bertini.multiprec.conj((complex_mp)arg1) complex_mp :¶
complex conjugate
- bertini.multiprec.cos((real_mp)val) real_mp :¶
cosine
- cos( (complex_mp)val) -> complex_mp :
cosine
- bertini.multiprec.cosh((real_mp)val) real_mp :¶
hyperbolic cosine
- cosh( (complex_mp)val) -> complex_mp :
hyperbolic cosine
- bertini.multiprec.default_align_bytes() int¶
- bertini.multiprec.default_precision() int :¶
get the default precision for variable-precision numbers. is digits, not bits.
- default_precision( (int)arg1) -> None :
set the default precision for variable-precision numbers. should be a positive number. is digits, not bits.
- bertini.multiprec.exp((real_mp)val) real_mp :¶
exponential, base e
- exp( (complex_mp)val) -> complex_mp :
exponential, base e
- bertini.multiprec.imag((complex_mp)val) real_mp :¶
get the imaginary part
- imag( (numpy.ndarray)val) -> numpy.ndarray :
get the imaginary parts of an array of complex numbers, as an array of real_mp
- class bertini.multiprec.int_mp((object)arg1) None :¶
Bases:
instanceDefault Construct an arbitrary-precision integer
- __init__( (object)self, (int)val) -> None :
Construct an arbitrary-precision integer from an integer.
- __init__( (object)self, (int_mp)val) -> None :
Construct an arbitrary-precision integer from another.
- __init__( (object)self, (str)val) -> None :
Construct an arbitrary-precision integer from a string of digits.
- __init__((object)arg1) None :¶
Default Construct an arbitrary-precision integer
- __init__( (object)self, (int)val) -> None :
Construct an arbitrary-precision integer from an integer.
- __init__( (object)self, (int_mp)val) -> None :
Construct an arbitrary-precision integer from another.
- __init__( (object)self, (str)val) -> None :
Construct an arbitrary-precision integer from a string of digits.
- bertini.multiprec.is_distinct_up_to((numpy.ndarray)p, (numpy.ndarray)q, (float)tol) bool :¶
True if points p and q differ by more than tol in the infinity norm (max_i abs(p_i - q_i)); False if they are the same to within tol. The tolerance-based point-equality test (issue #304). Accepts complex_mp or real_mp vectors; different-length points are distinct.
- is_distinct_up_to( (numpy.ndarray)p, (numpy.ndarray)q, (float)tol) -> bool :
True if real points p and q differ by more than tol in the infinity norm (issue #304).
- is_distinct_up_to( (numpy.ndarray)p, (numpy.ndarray)q, (float)tol) -> bool :
True if complex-double points p and q differ by more than tol in the infinity norm (issue #304).
- is_distinct_up_to( (numpy.ndarray)p, (numpy.ndarray)q, (float)tol) -> bool :
True if real-double points p and q differ by more than tol in the infinity norm (issue #304).
- bertini.multiprec.log((real_mp)val) real_mp :¶
natural log
- log( (complex_mp)val) -> complex_mp :
natural log
- bertini.multiprec.polar((real_mp)arg1, (real_mp)arg2) complex_mp :¶
construct from polar form
- bertini.multiprec.precision((numpy.ndarray)container) int :¶
The precision, in digits, of a vector of complex_mp.
- precision( (numpy.ndarray)container) -> int :
The precision, in digits, of a matrix of complex_mp.
- precision( (numpy.ndarray)container) -> int :
The precision, in digits, of a vector of real_mp.
- precision( (numpy.ndarray)container) -> int :
The precision, in digits, of a matrix of real_mp.
- precision( (numpy.ndarray)container, (int)digits) -> numpy.ndarray :
A copy of the complex_mp vector with every entry set to digits of precision.
- precision( (numpy.ndarray)container, (int)digits) -> numpy.ndarray :
A copy of the complex_mp matrix with every entry set to digits of precision.
- precision( (numpy.ndarray)container, (int)digits) -> numpy.ndarray :
A copy of the real_mp vector with every entry set to digits of precision.
- precision( (numpy.ndarray)container, (int)digits) -> numpy.ndarray :
A copy of the real_mp matrix with every entry set to digits of precision.
- class bertini.multiprec.rational_mp((object)arg1) None :¶
Bases:
instanceDefault Construct an arbitrary-precision rational number
- __init__( (object)self, (int)val) -> None :
Construct an arbitrary-precision rational number from an integer.
- __init__( (object)self, (int)numerator, (int)denominator) -> None :
Construct an arbitrary-precision rational number from a pair of integers.
- __init__( (object)self, (int_mp)val) -> None :
Construct an arbitrary-precision rational number from an arbitrary-precision integer.
- __init__( (object)self, (int_mp)numerator, (int_mp)denominator) -> None :
Construct an arbitrary-precision rational number from a pair of arbitrary-precision integers.
- __init__( (object)self, (str)val) -> None :
Construct an arbitrary-precision rational number from a string, e.g. ‘1/3’.
- __init__( (object)self, (rational_mp)val) -> None :
Construct an arbitrary-precision rational number from an arbitrary-precision integer.
- __init__((object)arg1) None :¶
Default Construct an arbitrary-precision rational number
- __init__( (object)self, (int)val) -> None :
Construct an arbitrary-precision rational number from an integer.
- __init__( (object)self, (int)numerator, (int)denominator) -> None :
Construct an arbitrary-precision rational number from a pair of integers.
- __init__( (object)self, (int_mp)val) -> None :
Construct an arbitrary-precision rational number from an arbitrary-precision integer.
- __init__( (object)self, (int_mp)numerator, (int_mp)denominator) -> None :
Construct an arbitrary-precision rational number from a pair of arbitrary-precision integers.
- __init__( (object)self, (str)val) -> None :
Construct an arbitrary-precision rational number from a string, e.g. ‘1/3’.
- __init__( (object)self, (rational_mp)val) -> None :
Construct an arbitrary-precision rational number from an arbitrary-precision integer.
- bertini.multiprec.real((complex_mp)val) real_mp :¶
get the real part
- real( (numpy.ndarray)val) -> numpy.ndarray :
get the real parts of an array of complex numbers, as an array of real_mp
- class bertini.multiprec.real_mp((object)arg1) None :¶
Bases:
generic,instanceDefault Construct a variable-precision float
- __init__( (object)self, (str)val) -> None :
Construct a variable-precision float from a string. The best way.
- __init__( (object)self, (int)val) -> None :
Construct a variable-precision float from a regular old integer.
- __init__( (object)self, (real_mp)val) -> None :
Construct a variable-precision float from another.
- __init__( (object)self, (int_mp)val) -> None :
Construct an variable-precision float from an arbitrary-precision integer.
- __init__((object)arg1) None :¶
Default Construct a variable-precision float
- __init__( (object)self, (str)val) -> None :
Construct a variable-precision float from a string. The best way.
- __init__( (object)self, (int)val) -> None :
Construct a variable-precision float from a regular old integer.
- __init__( (object)self, (real_mp)val) -> None :
Construct a variable-precision float from another.
- __init__( (object)self, (int_mp)val) -> None :
Construct an variable-precision float from an arbitrary-precision integer.
- dtype = dtype(real_mp)¶
- property precision¶
get/set the precision of this variable-precision number, in digits. remember, the system knows not where your number came from, so upsampling will NOT add more correct digits.
- bertini.multiprec.sin((real_mp)val) real_mp :¶
sine
- sin( (complex_mp)val) -> complex_mp :
sine
- bertini.multiprec.sinh((real_mp)val) real_mp :¶
hyperbolic sine
- sinh( (complex_mp)val) -> complex_mp :
hyperbolic sine
- bertini.multiprec.sqrt((real_mp)val) real_mp :¶
square root
- sqrt( (complex_mp)val) -> complex_mp :
square root
- bertini.multiprec.tan((real_mp)val) real_mp :¶
tangent
- tan( (complex_mp)val) -> complex_mp :
tangent
- bertini.multiprec.tanh((real_mp)val) real_mp :¶
hyperbolic tangent
- tanh( (complex_mp)val) -> complex_mp :
hyperbolic tangent