#include "vnl_bignum.h"#include <vcl_cstdlib.h>#include <vcl_cstring.h>#include <vcl_cmath.h>#include <vcl_algorithm.h>#include <vcl_vector.h>#include <vcl_cassert.h>#include <vcl_iostream.h>#include <vcl_limits.h>#include <vnl/vnl_math.h>Go to the source code of this file.
Typedefs | |
| typedef unsigned short | Counter |
| typedef unsigned short | Data |
Functions | |
| vcl_istream & | operator>> (vcl_istream &is, vnl_bignum &x) |
| Reads a vnl_bignum from a stream. | |
| vcl_ostream & | operator<< (vcl_ostream &os, const vnl_bignum &b) |
| Formatted output for bignum. | |
| vcl_string & | vnl_bignum_to_string (vcl_string &s, const vnl_bignum &b) |
| Convert the number to a decimal representation in a string. | |
| vnl_bignum & | vnl_bignum_from_string (vnl_bignum &b, const vcl_string &s) |
| Convert the number from a decimal representation in a string. | |
| unsigned int | ctox (int c) |
| convert hex character to integer hex value (ASCII or EBCDIC). | |
| void | add (const vnl_bignum &b1, const vnl_bignum &b2, vnl_bignum &sum) |
| add two non-infinite vnl_bignum values and save their sum. | |
| void | increment (vnl_bignum &bnum) |
| Add 1 to bnum (unsigned, non-infinite). | |
| void | subtract (const vnl_bignum &bmax, const vnl_bignum &bmin, vnl_bignum &diff) |
| subtract bmin from bmax (unsigned, non-infinite), result in diff. | |
| void | decrement (vnl_bignum &bnum) |
| Subtract 1 from bnum (unsigned, non-infinite, non-zero). | |
| int | magnitude_cmp (const vnl_bignum &b1, const vnl_bignum &b2) |
| compare absolute values of two vnl_bignums. | |
| void | multiply_aux (const vnl_bignum &b, Data d, vnl_bignum &prod, Counter i) |
| multiply a non-infinite vnl_bignum by a "single digit". | |
| Data | normalize (const vnl_bignum &b1, const vnl_bignum &b2, vnl_bignum &u, vnl_bignum &v) |
| normalize two vnl_bignums. | |
| void | divide_aux (const vnl_bignum &b1, Data d, vnl_bignum &q, Data &r) |
| divide a vnl_bignum by a "single digit". | |
| Data | estimate_q_hat (const vnl_bignum &u, const vnl_bignum &v, Counter j) |
| estimate next dividend. | |
| Data | multiply_subtract (vnl_bignum &u, const vnl_bignum &v, Data q_hat, Counter j) |
| calculate u - v*q_hat. | |
| void | divide (const vnl_bignum &b1, const vnl_bignum &b2, vnl_bignum &q, vnl_bignum &r) |
| divide b2 into b1, getting quotient q and remainder r. | |
| vnl_bignum | left_shift (const vnl_bignum &b1, int l) |
| left shift (arithmetic) non-infinite vnl_bignum by positive number. | |
| vnl_bignum | right_shift (const vnl_bignum &b1, int l) |
| right shift (arithmetic) non-infinite vnl_bignum by positive number. | |
Definition in file vnl_bignum.cxx.
| typedef unsigned short Counter |
Definition at line 16 of file vnl_bignum.cxx.
| typedef unsigned short Data |
Definition at line 17 of file vnl_bignum.cxx.
| void add | ( | const vnl_bignum & | b1, |
| const vnl_bignum & | b2, | ||
| vnl_bignum & | sum | ||
| ) |
add two non-infinite vnl_bignum values and save their sum.
Definition at line 924 of file vnl_bignum.cxx.
| unsigned int ctox | ( | int | c | ) |
convert hex character to integer hex value (ASCII or EBCDIC).
Definition at line 842 of file vnl_bignum.cxx.
| void decrement | ( | vnl_bignum & | bnum | ) |
Subtract 1 from bnum (unsigned, non-infinite, non-zero).
Definition at line 1000 of file vnl_bignum.cxx.
| void divide | ( | const vnl_bignum & | b1, |
| const vnl_bignum & | b2, | ||
| vnl_bignum & | q, | ||
| vnl_bignum & | r | ||
| ) |
divide b2 into b1, getting quotient q and remainder r.
(Refer to Knuth, V.2, Section 4.3.1, Algorithm D for details. This function implements Algorithm D.)
Definition at line 1218 of file vnl_bignum.cxx.
| void divide_aux | ( | const vnl_bignum & | b1, |
| Data | d, | ||
| vnl_bignum & | q, | ||
| Data & | r | ||
| ) |
divide a vnl_bignum by a "single digit".
(Refer to Knuth, V.2, Section 4.3.2, exercise 16 for details. A digit here is one data element in the radix 2**2.)
Definition at line 1093 of file vnl_bignum.cxx.
| Data estimate_q_hat | ( | const vnl_bignum & | u, |
| const vnl_bignum & | v, | ||
| Counter | j | ||
| ) |
estimate next dividend.
(Refer to Knuth, V.2, Section 4.3.1, Algorithm D for details. This function estimates how many times v goes into u, starting at u's jth digit. A digit here is actually a data element, thought of as being in the radix 2**2.)
Definition at line 1113 of file vnl_bignum.cxx.
| void increment | ( | vnl_bignum & | bnum | ) |
Add 1 to bnum (unsigned, non-infinite).
Definition at line 959 of file vnl_bignum.cxx.
| vnl_bignum left_shift | ( | const vnl_bignum & | b1, |
| int | l | ||
| ) |
left shift (arithmetic) non-infinite vnl_bignum by positive number.
Definition at line 1277 of file vnl_bignum.cxx.
| int magnitude_cmp | ( | const vnl_bignum & | b1, |
| const vnl_bignum & | b2 | ||
| ) |
compare absolute values of two vnl_bignums.
Outputs: result of comparison: -1 if abs(b1) < abs(b2) 0 if abs(b1) == abs(b2) +1 if abs(b1) > abs(b2)
Definition at line 1019 of file vnl_bignum.cxx.
| void multiply_aux | ( | const vnl_bignum & | b, |
| Data | d, | ||
| vnl_bignum & | prod, | ||
| Counter | i | ||
| ) |
multiply a non-infinite vnl_bignum by a "single digit".
Definition at line 1040 of file vnl_bignum.cxx.
| Data multiply_subtract | ( | vnl_bignum & | u, |
| const vnl_bignum & | v, | ||
| Data | q_hat, | ||
| Counter | j | ||
| ) |
calculate u - v*q_hat.
(Refer to Knuth, V. 2, Section 4.3.1, Algorithm D for details. A digit here is a data element, thought of as being in the radix 2**2.)
Definition at line 1160 of file vnl_bignum.cxx.
| Data normalize | ( | const vnl_bignum & | b1, |
| const vnl_bignum & | b2, | ||
| vnl_bignum & | u, | ||
| vnl_bignum & | v | ||
| ) |
normalize two vnl_bignums.
(Refer to Knuth, V.2, Section 4.3.1, Algorithm D for details. A digit here is one data element in the radix 2**2.)
Definition at line 1076 of file vnl_bignum.cxx.
| vcl_ostream & operator<< | ( | vcl_ostream & | os, |
| const vnl_bignum & | b | ||
| ) |
| vcl_istream & operator>> | ( | vcl_istream & | is, |
| vnl_bignum & | x | ||
| ) |
| vnl_bignum right_shift | ( | const vnl_bignum & | b1, |
| int | l | ||
| ) |
right shift (arithmetic) non-infinite vnl_bignum by positive number.
Definition at line 1315 of file vnl_bignum.cxx.
| void subtract | ( | const vnl_bignum & | bmax, |
| const vnl_bignum & | bmin, | ||
| vnl_bignum & | diff | ||
| ) |
subtract bmin from bmax (unsigned, non-infinite), result in diff.
Definition at line 978 of file vnl_bignum.cxx.
| vnl_bignum & vnl_bignum_from_string | ( | vnl_bignum & | b, |
| const vcl_string & | s | ||
| ) |
Convert the number from a decimal representation in a string.
Definition at line 707 of file vnl_bignum.cxx.
| vcl_string & vnl_bignum_to_string | ( | vcl_string & | s, |
| const vnl_bignum & | b | ||
| ) |
Convert the number to a decimal representation in a string.
Definition at line 683 of file vnl_bignum.cxx.
1.7.5.1