Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
#include <large_number.h>
Public Member Functions | |
large_number () | |
large_number (int n) | |
large_number (const large_number &a) | |
large_number (std::vector< unsigned char > &vec) | |
large_number (char const *number_str) | |
void | add_digit (unsigned int value) |
size_t | num_digits () const |
unsigned char & | operator[] (size_t n) |
const unsigned char & | operator[] (size_t n) const |
large_number & | operator++ () |
large_number & | operator++ (int) |
large_number & | operator+= (large_number n) |
large_number & | operator+= (int n) |
large_number & | operator= (const large_number &b) |
template<class T > | |
large_number & | operator*= (const T n) |
char | digit_char (size_t i) const |
Static Public Member Functions | |
static bool | test () |
Private Member Functions | |
template<class T > | |
void | multiply (const T n) |
Private Attributes | |
std::vector< unsigned char > | _digits |
Friends | |
std::ostream & | operator<< (std::ostream &out, const large_number &a) |
bool | operator== (large_number const &a, large_number const &b) |
bool | operator!= (large_number const &a, large_number const &b) |
template<class T > | |
large_number & | operator+ (const large_number &a, const T &b) |
Store large unsigned numbers as a C++ vector The class provides convenience functions to add a digit to the number, perform multiplication of large number with long unsigned integers.
|
inline |
< initializer with value = 1
|
inlineexplicit |
< initializer from an integer < initializer from an integer initializer from another large_number
|
inline |
initializer from a vector
|
inlineexplicit |
initializer from a string
|
inlineexplicit |
|
inline |
|
inline |
returns i^th digit as an ASCII character
|
inlineprivate |
multiply large number with another integer and store the result in the same large number
|
inline |
Get number of digits in the number
|
inline |
operator overload to increment
|
inline |
operator overload to increment (prefix)
|
inline |
operator overload to increment (postfix)
|
inline |
|
inline |
operator overload to add
|
inline |
|
inline |
operator over load to access the i^th digit conveniently and also assign value to it
|
inline |
|
inlinestatic |
Function to check implementation
|
friend |
operator overload to compare two numbers
|
friend |
operator overload to perform addition
|
friend |
operator overload to compare two numbers
|
friend |
operator overload to compare two numbers
|
private |
where individual digits are stored