IntegerOps Class Reference

#include <integerOps.hpp>

Inheritance diagram for IntegerOps:

Inheritance graph
[legend]
Collaboration diagram for IntegerOps:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static int add_result_size_in_bytes (Integer &x, Integer &y)
static int sub_result_size_in_bytes (Integer &x, Integer &y)
static int mul_result_size_in_bytes (Integer &x, Integer &y)
static int quo_result_size_in_bytes (Integer &x, Integer &y)
static int rem_result_size_in_bytes (Integer &x, Integer &y)
static int div_result_size_in_bytes (Integer &x, Integer &y)
static int mod_result_size_in_bytes (Integer &x, Integer &y)
static int and_result_size_in_bytes (Integer &x, Integer &y)
static int or_result_size_in_bytes (Integer &x, Integer &y)
static int xor_result_size_in_bytes (Integer &x, Integer &y)
static int ash_result_size_in_bytes (Integer &x, int n)
static int copy_result_size_in_bytes (Integer &x)
static int int_to_Integer_result_size_in_bytes (int i)
static int double_to_Integer_result_size_in_bytes (double x)
static int string_to_Integer_result_size_in_bytes (char *s, int base)
static int Integer_to_string_result_size_in_bytes (Integer &x, int base)
static void add (Integer &x, Integer &y, Integer &z)
static void sub (Integer &x, Integer &y, Integer &z)
static void mul (Integer &x, Integer &y, Integer &z)
static void quo (Integer &x, Integer &y, Integer &z)
static void rem (Integer &x, Integer &y, Integer &z)
static void div (Integer &x, Integer &y, Integer &z)
static void mod (Integer &x, Integer &y, Integer &z)
static void and (Integer &x, Integer &y, Integer &z)
static void or (Integer &x, Integer &y, Integer &z)
static void xor (Integer &x, Integer &y, Integer &z)
static void ash (Integer &x, int n, Integer &z)
static int cmp (Integer &x, Integer &y)
static void abs (Integer &x)
static void neg (Integer &x)
static void copy (Integer &x, Integer &z)
static void int_to_Integer (int i, Integer &z)
static void double_to_Integer (double x, Integer &z)
static void string_to_Integer (char *s, int base, Integer &z)
static void Integer_to_string (Integer &x, int base, char *s)
static void self_test ()

Static Private Member Functions

static Digit as_Digit (char c)
static char as_char (int i)
static Digit xpy (Digit x, Digit y, Digit &carry)
static Digit xmy (Digit x, Digit y, Digit &carry)
static Digit axpy (Digit a, Digit x, Digit y, Digit &carry)
static Digit xdy (Digit x, Digit y, Digit &carry)
static Digit power (Digit x, int n)
static Digit max_power (Digit x)
static int unsigned_add_result_length (Integer &x, Integer &y)
static int unsigned_sub_result_length (Integer &x, Integer &y)
static int unsigned_mul_result_length (Integer &x, Integer &y)
static int unsigned_quo_result_length (Integer &x, Integer &y)
static int unsigned_rem_result_length (Integer &x, Integer &y)
static void unsigned_add (Integer &x, Integer &y, Integer &z)
static void unsigned_sub (Integer &x, Integer &y, Integer &z)
static void unsigned_mul (Integer &x, Integer &y, Integer &z)
static void unsigned_quo (Integer &x, Integer &y, Integer &z)
static void unsigned_rem (Integer &x, Integer &y, Integer &z)
static int unsigned_cmp (Integer &x, Integer &y)
static Digit scale (Digit *array, Digit factor, int length)
static Digitqr_decomposition (Integer &x, Integer &y)
static Digit last_digit (Integer &x, Digit b)
static void first_digit (Integer &x, Digit b, Digit c)

Detailed Description

Definition at line 79 of file integerOps.hpp.


Member Function Documentation

void IntegerOps::abs ( Integer x  )  [static]

Definition at line 854 of file integerOps.cpp.

References Integer::is_negative(), and neg().

Here is the call graph for this function:

void IntegerOps::add ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 730 of file integerOps.cpp.

References Integer::is_negative(), neg(), unsigned_add(), unsigned_cmp(), and unsigned_sub().

Referenced by axpy(), PRIM_DECL_2(), self_test(), and xpy().

Here is the call graph for this function:

int IntegerOps::add_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 590 of file integerOps.cpp.

References Integer::is_negative(), Integer::length_to_size_in_bytes(), unsigned_add_result_length(), unsigned_cmp(), and unsigned_sub_result_length().

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

void IntegerOps::and ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 796 of file integerOps.cpp.

References Integer::is_positive(), Integer::length(), min(), missing_code_for(), and Integer::set_length().

Here is the call graph for this function:

int IntegerOps::and_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 653 of file integerOps.cpp.

References Integer::is_positive(), Integer::length(), Integer::length_to_size_in_bytes(), min(), and missing_code_for().

Here is the call graph for this function:

char IntegerOps::as_char ( int  i  )  [inline, static, private]

Definition at line 255 of file integerOps.cpp.

References assert, and maxD.

Referenced by Integer_to_string().

Digit IntegerOps::as_Digit ( char  c  )  [inline, static, private]

Definition at line 246 of file integerOps.cpp.

References fatal.

Referenced by string_to_Integer().

void IntegerOps::ash ( Integer x,
int  n,
Integer z 
) [static]

Definition at line 840 of file integerOps.cpp.

References missing_code_for().

Here is the call graph for this function:

int IntegerOps::ash_result_size_in_bytes ( Integer x,
int  n 
) [static]

Definition at line 686 of file integerOps.cpp.

References missing_code_for().

Here is the call graph for this function:

Digit IntegerOps::axpy ( Digit  a,
Digit  x,
Digit  y,
Digit carry 
) [inline, static, private]

Definition at line 303 of file integerOps.cpp.

References add(), eax, edx, and mul().

Referenced by first_digit(), max_power(), scale(), and unsigned_mul().

Here is the call graph for this function:

int IntegerOps::cmp ( Integer x,
Integer y 
) [static]

Definition at line 845 of file integerOps.cpp.

References Integer::is_negative(), Integer::signum(), and unsigned_cmp().

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

void IntegerOps::copy ( Integer x,
Integer z 
) [static]

Definition at line 864 of file integerOps.cpp.

References Integer::_signed_length, and Integer::length().

Referenced by factorial(), Integer_to_string(), unfactorial(), and unsigned_rem().

Here is the call graph for this function:

int IntegerOps::copy_result_size_in_bytes ( Integer x  )  [static]

Definition at line 692 of file integerOps.cpp.

References Integer::size_in_bytes().

Here is the call graph for this function:

void IntegerOps::div ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 778 of file integerOps.cpp.

References Integer::is_negative(), Integer::is_positive(), missing_code_for(), and unsigned_quo().

Referenced by PRIM_DECL_2(), unfactorial(), and xdy().

Here is the call graph for this function:

int IntegerOps::div_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 631 of file integerOps.cpp.

References Integer::is_negative(), Integer::is_positive(), Integer::length_to_size_in_bytes(), missing_code_for(), and unsigned_quo_result_length().

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

void IntegerOps::double_to_Integer ( double  x,
Integer z 
) [static]

Definition at line 885 of file integerOps.cpp.

References double_length, exponent(), exponent_length, length_in_bits(), logB, mantissa_length, neg(), Integer::set_length(), shift_left(), shift_right(), and sign_length.

Referenced by convert_to_integer(), and PRIM_DECL_2().

Here is the call graph for this function:

int IntegerOps::double_to_Integer_result_size_in_bytes ( double  x  )  [static]

Definition at line 702 of file integerOps.cpp.

References exponent(), Integer::length_to_size_in_bytes(), and logB.

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

void IntegerOps::first_digit ( Integer x,
Digit  b,
Digit  c 
) [static, private]

Definition at line 579 of file integerOps.cpp.

References axpy(), Integer::length(), and Integer::set_length().

Referenced by string_to_Integer().

Here is the call graph for this function:

void IntegerOps::int_to_Integer ( int  i,
Integer z 
) [static]

Definition at line 871 of file integerOps.cpp.

References Integer::_first_digit, and Integer::set_length().

Referenced by convert_to_double(), factorial(), PRIM_DECL_2(), self_test(), string_to_Integer(), and unfactorial().

Here is the call graph for this function:

int IntegerOps::int_to_Integer_result_size_in_bytes ( int  i  )  [static]

Definition at line 697 of file integerOps.cpp.

References Integer::length_to_size_in_bytes().

Referenced by PRIM_DECL_2(), and self_test().

Here is the call graph for this function:

void IntegerOps::Integer_to_string ( Integer x,
int  base,
char *  s 
) [static]

Definition at line 940 of file integerOps.cpp.

References as_char(), assert, copy(), Integer::is_negative(), Integer::is_not_zero(), last_digit(), maxD, and Integer::size_in_bytes().

Referenced by PRIM_DECL_2(), and Integer::print().

Here is the call graph for this function:

int IntegerOps::Integer_to_string_result_size_in_bytes ( Integer x,
int  base 
) [static]

Definition at line 720 of file integerOps.cpp.

References Integer::length(), and missing_code_for().

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

Digit IntegerOps::last_digit ( Integer x,
Digit  b 
) [static, private]

Definition at line 569 of file integerOps.cpp.

References Integer::length(), Integer::set_length(), and xdy().

Referenced by Integer_to_string().

Here is the call graph for this function:

Digit IntegerOps::max_power ( Digit  x  )  [static, private]

Definition at line 363 of file integerOps.cpp.

References axpy().

Here is the call graph for this function:

void IntegerOps::mod ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 787 of file integerOps.cpp.

References Integer::is_negative(), Integer::is_positive(), missing_code_for(), and unsigned_rem().

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

int IntegerOps::mod_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 642 of file integerOps.cpp.

References Integer::is_negative(), Integer::is_positive(), Integer::length_to_size_in_bytes(), missing_code_for(), and unsigned_rem_result_length().

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

void IntegerOps::mul ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 754 of file integerOps.cpp.

References Integer::is_negative(), Integer::is_zero(), Integer::length(), neg(), Integer::set_length(), and unsigned_mul().

Referenced by axpy(), factorial(), PRIM_DECL_2(), self_test(), and unfactorial().

Here is the call graph for this function:

int IntegerOps::mul_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 616 of file integerOps.cpp.

References Integer::length_to_size_in_bytes(), and unsigned_mul_result_length().

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

void IntegerOps::neg ( Integer x  )  [static]

Definition at line 859 of file integerOps.cpp.

References Integer::_signed_length, and Integer::set_length().

Referenced by abs(), add(), double_to_Integer(), mul(), quo(), rem(), string_to_Integer(), and sub().

Here is the call graph for this function:

void IntegerOps::or ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 808 of file integerOps.cpp.

References Integer::is_positive(), Integer::length(), min(), missing_code_for(), and Integer::set_length().

Here is the call graph for this function:

int IntegerOps::or_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 664 of file integerOps.cpp.

References Integer::is_positive(), Integer::length(), Integer::length_to_size_in_bytes(), max(), and missing_code_for().

Here is the call graph for this function:

Digit IntegerOps::power ( Digit  x,
int  n 
) [static, private]

Definition at line 346 of file integerOps.cpp.

Digit * IntegerOps::qr_decomposition ( Integer x,
Integer y 
) [static, private]

Definition at line 439 of file integerOps.cpp.

References Integer::_first_digit, Integer::digits(), fatal, hlfB, Integer::length(), missing_code_for(), NEW_RESOURCE_ARRAY, oneB, scale(), and xdy().

Referenced by unsigned_quo(), and unsigned_rem().

Here is the call graph for this function:

void IntegerOps::quo ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 766 of file integerOps.cpp.

References Integer::is_negative(), neg(), and unsigned_quo().

Here is the call graph for this function:

int IntegerOps::quo_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 621 of file integerOps.cpp.

References Integer::length_to_size_in_bytes(), and unsigned_quo_result_length().

Here is the call graph for this function:

void IntegerOps::rem ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 772 of file integerOps.cpp.

References Integer::is_negative(), neg(), and unsigned_rem().

Here is the call graph for this function:

int IntegerOps::rem_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 626 of file integerOps.cpp.

References Integer::length_to_size_in_bytes(), and unsigned_rem_result_length().

Here is the call graph for this function:

Digit IntegerOps::scale ( Digit array,
Digit  factor,
int  length 
) [static, private]

Definition at line 428 of file integerOps.cpp.

References axpy().

Referenced by qr_decomposition().

Here is the call graph for this function:

void IntegerOps::self_test (  )  [static]

Definition at line 1034 of file integerOps.cpp.

References add(), check(), convert_from_string(), convert_to_double(), convert_to_integer(), factorial(), int_to_Integer(), int_to_Integer_result_size_in_bytes(), mul(), outputStream::print_cr(), std, sub(), and unfactorial().

Here is the call graph for this function:

void IntegerOps::string_to_Integer ( char *  s,
int  base,
Integer z 
) [static]

Definition at line 929 of file integerOps.cpp.

References as_Digit(), first_digit(), int_to_Integer(), and neg().

Referenced by convert_from_string(), and PRIM_DECL_3().

Here is the call graph for this function:

int IntegerOps::string_to_Integer_result_size_in_bytes ( char *  s,
int  base 
) [static]

Definition at line 708 of file integerOps.cpp.

References Integer::length_to_size_in_bytes(), and missing_code_for().

Referenced by PRIM_DECL_3().

Here is the call graph for this function:

void IntegerOps::sub ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 742 of file integerOps.cpp.

References Integer::is_negative(), neg(), unsigned_add(), unsigned_cmp(), and unsigned_sub().

Referenced by PRIM_DECL_2(), self_test(), and xmy().

Here is the call graph for this function:

int IntegerOps::sub_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 603 of file integerOps.cpp.

References Integer::is_negative(), Integer::length_to_size_in_bytes(), unsigned_add_result_length(), unsigned_cmp(), and unsigned_sub_result_length().

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

void IntegerOps::unsigned_add ( Integer x,
Integer y,
Integer z 
) [static, private]

Definition at line 378 of file integerOps.cpp.

References Integer::length(), min(), Integer::set_length(), and xpy().

Referenced by add(), and sub().

Here is the call graph for this function:

static int IntegerOps::unsigned_add_result_length ( Integer x,
Integer y 
) [inline, static, private]

Definition at line 92 of file integerOps.hpp.

References Integer::length(), and max().

Referenced by add_result_size_in_bytes(), and sub_result_size_in_bytes().

Here is the call graph for this function:

int IntegerOps::unsigned_cmp ( Integer x,
Integer y 
) [static, private]

Definition at line 556 of file integerOps.cpp.

References Integer::length().

Referenced by add(), add_result_size_in_bytes(), cmp(), sub(), and sub_result_size_in_bytes().

Here is the call graph for this function:

void IntegerOps::unsigned_mul ( Integer x,
Integer y,
Integer z 
) [static, private]

Definition at line 405 of file integerOps.cpp.

References axpy(), Integer::length(), and Integer::set_length().

Referenced by mul().

Here is the call graph for this function:

static int IntegerOps::unsigned_mul_result_length ( Integer x,
Integer y 
) [inline, static, private]

Definition at line 94 of file integerOps.hpp.

References Integer::is_zero(), and Integer::length().

Referenced by mul_result_size_in_bytes().

Here is the call graph for this function:

void IntegerOps::unsigned_quo ( Integer x,
Integer y,
Integer z 
) [static, private]

Definition at line 518 of file integerOps.cpp.

References Integer::length(), qr_decomposition(), and Integer::set_length().

Referenced by div(), and quo().

Here is the call graph for this function:

static int IntegerOps::unsigned_quo_result_length ( Integer x,
Integer y 
) [inline, static, private]

Definition at line 95 of file integerOps.hpp.

References Integer::length(), and max().

Referenced by div_result_size_in_bytes(), and quo_result_size_in_bytes().

Here is the call graph for this function:

void IntegerOps::unsigned_rem ( Integer x,
Integer y,
Integer z 
) [static, private]

Definition at line 537 of file integerOps.cpp.

References copy(), Integer::length(), qr_decomposition(), and Integer::set_length().

Referenced by mod(), and rem().

Here is the call graph for this function:

static int IntegerOps::unsigned_rem_result_length ( Integer x,
Integer y 
) [inline, static, private]

Definition at line 96 of file integerOps.hpp.

References Integer::length().

Referenced by mod_result_size_in_bytes(), and rem_result_size_in_bytes().

Here is the call graph for this function:

void IntegerOps::unsigned_sub ( Integer x,
Integer y,
Integer z 
) [static, private]

Definition at line 392 of file integerOps.cpp.

References fatal, Integer::length(), Integer::set_length(), and xmy().

Referenced by add(), and sub().

Here is the call graph for this function:

static int IntegerOps::unsigned_sub_result_length ( Integer x,
Integer y 
) [inline, static, private]

Definition at line 93 of file integerOps.hpp.

References Integer::length().

Referenced by add_result_size_in_bytes(), and sub_result_size_in_bytes().

Here is the call graph for this function:

Digit IntegerOps::xdy ( Digit  x,
Digit  y,
Digit carry 
) [inline, static, private]

Definition at line 326 of file integerOps.cpp.

References div(), eax, and edx.

Referenced by last_digit(), and qr_decomposition().

Here is the call graph for this function:

Digit IntegerOps::xmy ( Digit  x,
Digit  y,
Digit carry 
) [inline, static, private]

Definition at line 282 of file integerOps.cpp.

References assert, eax, and sub().

Referenced by unsigned_sub().

Here is the call graph for this function:

void IntegerOps::xor ( Integer x,
Integer y,
Integer z 
) [static]

Definition at line 824 of file integerOps.cpp.

References Integer::is_positive(), Integer::length(), min(), missing_code_for(), and Integer::set_length().

Here is the call graph for this function:

int IntegerOps::xor_result_size_in_bytes ( Integer x,
Integer y 
) [static]

Definition at line 675 of file integerOps.cpp.

References Integer::is_positive(), Integer::length(), Integer::length_to_size_in_bytes(), max(), and missing_code_for().

Here is the call graph for this function:

Digit IntegerOps::xpy ( Digit  x,
Digit  y,
Digit carry 
) [inline, static, private]

Definition at line 261 of file integerOps.cpp.

References add(), assert, and eax.

Referenced by unsigned_add().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Oct 9 14:00:54 2006 for Strongtalk VM by  doxygen 1.4.7