NCBI C++ ToolKit
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
rapidjson::internal::BigInteger Class Reference

Search Toolkit Book for rapidjson::internal::BigInteger

#include <misc/jsonwrapp/rapidjson11/internal/biginteger.h>

+ Collaboration diagram for rapidjson::internal::BigInteger:

Public Types

typedef uint64_t Type
 

Public Member Functions

 BigInteger (const BigInteger &rhs)
 
 BigInteger (uint64_t u)
 
 BigInteger (const char *decimals, size_t length)
 
BigIntegeroperator= (const BigInteger &rhs)
 
BigIntegeroperator= (uint64_t u)
 
BigIntegeroperator+= (uint64_t u)
 
BigIntegeroperator*= (uint64_t u)
 
BigIntegeroperator*= (uint32_t u)
 
BigIntegeroperator<<= (size_t shift)
 
bool operator== (const BigInteger &rhs) const
 
bool operator== (const Type rhs) const
 
BigIntegerMultiplyPow5 (unsigned exp)
 
bool Difference (const BigInteger &rhs, BigInteger *out) const
 
int Compare (const BigInteger &rhs) const
 
size_t GetCount () const
 
Type GetDigit (size_t index) const
 
bool IsZero () const
 

Private Member Functions

void AppendDecimal64 (const char *begin, const char *end)
 
void PushBack (Type digit)
 

Static Private Member Functions

static uint64_t ParseUint64 (const char *begin, const char *end)
 
static uint64_t MulAdd64 (uint64_t a, uint64_t b, uint64_t k, uint64_t *outHigh)
 

Private Attributes

Type digits_ [kCapacity]
 
size_t count_
 

Static Private Attributes

static const size_t kBitCount = 3328
 
static const size_t kCapacity = kBitCount / sizeof(Type)
 
static const size_t kTypeBit = sizeof(Type) * 8
 

Detailed Description

Definition at line 28 of file biginteger.h.

Member Typedef Documentation

◆ Type

Definition at line 30 of file biginteger.h.

Constructor & Destructor Documentation

◆ BigInteger() [1/3]

rapidjson::internal::BigInteger::BigInteger ( const BigInteger rhs)
inline

Definition at line 32 of file biginteger.h.

References digits_.

◆ BigInteger() [2/3]

rapidjson::internal::BigInteger::BigInteger ( uint64_t  u)
inlineexplicit

Definition at line 36 of file biginteger.h.

◆ BigInteger() [3/3]

rapidjson::internal::BigInteger::BigInteger ( const char *  decimals,
size_t  length 
)
inline

Definition at line 40 of file biginteger.h.

References i, and RAPIDJSON_ASSERT.

Member Function Documentation

◆ AppendDecimal64()

void rapidjson::internal::BigInteger::AppendDecimal64 ( const char *  begin,
const char *  end 
)
inlineprivate

Definition at line 224 of file biginteger.h.

◆ Compare()

int rapidjson::internal::BigInteger::Compare ( const BigInteger rhs) const
inline

Definition at line 208 of file biginteger.h.

References count_, digits_, and i.

◆ Difference()

bool rapidjson::internal::BigInteger::Difference ( const BigInteger rhs,
BigInteger out 
) const
inline

Definition at line 186 of file biginteger.h.

References a, b, Compare(), i, out(), and RAPIDJSON_ASSERT.

Referenced by rapidjson::internal::CheckWithinHalfULP().

◆ GetCount()

size_t rapidjson::internal::BigInteger::GetCount ( ) const
inline

Definition at line 219 of file biginteger.h.

◆ GetDigit()

Type rapidjson::internal::BigInteger::GetDigit ( size_t  index) const
inline

Definition at line 220 of file biginteger.h.

References RAPIDJSON_ASSERT.

◆ IsZero()

bool rapidjson::internal::BigInteger::IsZero ( void  ) const
inline

Definition at line 221 of file biginteger.h.

◆ MulAdd64()

static uint64_t rapidjson::internal::BigInteger::MulAdd64 ( uint64_t  a,
uint64_t  b,
uint64_t  k,
uint64_t outHigh 
)
inlinestaticprivate

Definition at line 249 of file biginteger.h.

References a, and b.

◆ MultiplyPow5()

BigInteger& rapidjson::internal::BigInteger::MultiplyPow5 ( unsigned  exp)
inline

Definition at line 162 of file biginteger.h.

References RAPIDJSON_UINT64_C2.

Referenced by rapidjson::internal::CheckWithinHalfULP().

◆ operator*=() [1/2]

BigInteger& rapidjson::internal::BigInteger::operator*= ( uint32_t  u)
inline

Definition at line 105 of file biginteger.h.

References i, and ud().

◆ operator*=() [2/2]

BigInteger& rapidjson::internal::BigInteger::operator*= ( uint64_t  u)
inline

Definition at line 87 of file biginteger.h.

References i.

◆ operator+=()

BigInteger& rapidjson::internal::BigInteger::operator+= ( uint64_t  u)
inline

Definition at line 70 of file biginteger.h.

References i.

◆ operator<<=()

BigInteger& rapidjson::internal::BigInteger::operator<<= ( size_t  shift)
inline

Definition at line 128 of file biginteger.h.

References i, memmove, offset, and RAPIDJSON_ASSERT.

◆ operator=() [1/2]

BigInteger& rapidjson::internal::BigInteger::operator= ( const BigInteger rhs)
inline

Definition at line 55 of file biginteger.h.

References count_, and digits_.

◆ operator=() [2/2]

BigInteger& rapidjson::internal::BigInteger::operator= ( uint64_t  u)
inline

Definition at line 64 of file biginteger.h.

◆ operator==() [1/2]

bool rapidjson::internal::BigInteger::operator== ( const BigInteger rhs) const
inline

Definition at line 154 of file biginteger.h.

References count_, and digits_.

◆ operator==() [2/2]

bool rapidjson::internal::BigInteger::operator== ( const Type  rhs) const
inline

Definition at line 158 of file biginteger.h.

◆ ParseUint64()

static uint64_t rapidjson::internal::BigInteger::ParseUint64 ( const char *  begin,
const char *  end 
)
inlinestaticprivate

Definition at line 239 of file biginteger.h.

References r(), and RAPIDJSON_ASSERT.

◆ PushBack()

void rapidjson::internal::BigInteger::PushBack ( Type  digit)
inlineprivate

Definition at line 234 of file biginteger.h.

References RAPIDJSON_ASSERT.

Member Data Documentation

◆ count_

size_t rapidjson::internal::BigInteger::count_
private

Definition at line 284 of file biginteger.h.

Referenced by Compare(), operator=(), and operator==().

◆ digits_

Type rapidjson::internal::BigInteger::digits_[kCapacity]
private

Definition at line 283 of file biginteger.h.

Referenced by BigInteger(), Compare(), operator=(), and operator==().

◆ kBitCount

const size_t rapidjson::internal::BigInteger::kBitCount = 3328
staticprivate

Definition at line 279 of file biginteger.h.

◆ kCapacity

const size_t rapidjson::internal::BigInteger::kCapacity = kBitCount / sizeof(Type)
staticprivate

Definition at line 280 of file biginteger.h.

◆ kTypeBit

const size_t rapidjson::internal::BigInteger::kTypeBit = sizeof(Type) * 8
staticprivate

Definition at line 281 of file biginteger.h.


The documentation for this class was generated from the following file:
Modified on Fri Sep 20 14:58:29 2024 by modify_doxy.py rev. 669887