Definition in file vnl_bignum.cxx.
#include "vnl_bignum.h"
#include <vcl_cctype.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 to 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 at line 17 of file vnl_bignum.cxx. |
|
|
Definition at line 18 of file vnl_bignum.cxx. |
|
||||||||||||||||
|
add two non-infinite vnl_bignum values and save their sum.
Definition at line 925 of file vnl_bignum.cxx. |
|
|
convert hex character to integer hex value (ASCII or EBCDIC).
Definition at line 840 of file vnl_bignum.cxx. |
|
|
Subtract 1 to bnum (unsigned, non-infinite, non-zero).
Definition at line 1002 of file vnl_bignum.cxx. |
|
||||||||||||||||||||
|
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 1234 of file vnl_bignum.cxx. |
|
||||||||||||||||||||
|
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 1097 of file vnl_bignum.cxx. |
|
||||||||||||||||
|
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 1118 of file vnl_bignum.cxx. |
|
|
Add 1 to bnum (unsigned, non-infinite).
Definition at line 960 of file vnl_bignum.cxx. |
|
||||||||||||
|
left shift (arithmetic) non-infinite vnl_bignum by positive number.
Definition at line 1277 of file vnl_bignum.cxx. |
|
||||||||||||
|
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 1022 of file vnl_bignum.cxx. |
|
||||||||||||||||||||
|
multiply a non-infinite vnl_bignum by a "single digit".
Definition at line 1044 of file vnl_bignum.cxx. |
|
||||||||||||||||||||
|
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 1174 of file vnl_bignum.cxx. |
|
||||||||||||||||||||
|
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 1079 of file vnl_bignum.cxx. |
|
||||||||||||
|
Formatted output for bignum.
Definition at line 660 of file vnl_bignum.cxx. |
|
||||||||||||
|
Reads a vnl_bignum from a stream.
Definition at line 402 of file vnl_bignum.cxx. |
|
||||||||||||
|
right shift (arithmetic) non-infinite vnl_bignum by positive number.
Definition at line 1317 of file vnl_bignum.cxx. |
|
||||||||||||||||
|
subtract bmin from bmax (unsigned, non-infinite), result in diff.
Definition at line 980 of file vnl_bignum.cxx. |
|
||||||||||||
|
Convert the number from a decimal representation in a string.
Definition at line 708 of file vnl_bignum.cxx. |
|
||||||||||||
|
Convert the number to a decimal representation in a string.
Definition at line 685 of file vnl_bignum.cxx. |
1.4.4