Scippy

SoPlex

Sequential object-oriented simPlex

bigint Class Reference

#include <format-inl.h>

Public Member Functions

 bigint ()
 
 bigint (uint64_t n)
 
 ~bigint ()
 
 bigint (const bigint &)=delete
 
void operator= (const bigint &)=delete
 
void assign (const bigint &other)
 
void assign (uint64_t n)
 
int num_bigits () const
 
bigintoperator<<= (int shift)
 
template<typename Int >
bigintoperator*= (Int value)
 
void assign_pow10 (int exp)
 
void square ()
 
int divmod_assign (const bigint &divisor)
 

Private Types

enum  { bigits_capacity = 32 }
 
using bigit = uint32_t
 
using double_bigit = uint64_t
 

Private Member Functions

void subtract_bigits (int index, bigit other, bigit &borrow)
 
void remove_leading_zeros ()
 
void subtract_aligned (const bigint &other)
 
void multiply (uint32_t value)
 
void multiply (uint64_t value)
 

Private Attributes

basic_memory_buffer< bigit, bigits_capacitybigits_
 
int exp_
 

Static Private Attributes

static FMT_CONSTEXPR_DECL const int bigit_bits = bits<bigit>::value
 

Friends

struct formatter< bigint >
 
int compare (const bigint &lhs, const bigint &rhs)
 
int add_compare (const bigint &lhs1, const bigint &lhs2, const bigint &rhs)
 

Detailed Description

Definition at line 519 of file format-inl.h.

Member Typedef Documentation

◆ bigit

using bigit = uint32_t
private

Definition at line 523 of file format-inl.h.

◆ double_bigit

using double_bigit = uint64_t
private

Definition at line 524 of file format-inl.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
bigits_capacity 

Definition at line 525 of file format-inl.h.

Constructor & Destructor Documentation

◆ bigint() [1/3]

bigint ( )

Definition at line 588 of file format-inl.h.

◆ bigint() [2/3]

bigint ( uint64_t  n)
explicit

Definition at line 589 of file format-inl.h.

◆ ~bigint()

~bigint ( )

Definition at line 590 of file format-inl.h.

References buffer< T >::capacity().

◆ bigint() [3/3]

bigint ( const bigint )
delete

Member Function Documentation

◆ assign() [1/2]

void assign ( const bigint other)

◆ assign() [2/2]

void assign ( uint64_t  n)

Definition at line 602 of file format-inl.h.

References buffer< T >::resize().

◆ assign_pow10()

void assign_pow10 ( int  exp)

Definition at line 676 of file format-inl.h.

References internal::exp.

Referenced by internal::fallback_format().

◆ divmod_assign()

int divmod_assign ( const bigint divisor)

◆ multiply() [1/2]

void multiply ( uint32_t  value)
private

Definition at line 559 of file format-inl.h.

References buffer< T >::push_back(), and buffer< T >::size().

◆ multiply() [2/2]

void multiply ( uint64_t  value)
private

Definition at line 570 of file format-inl.h.

References buffer< T >::push_back(), and buffer< T >::size().

◆ num_bigits()

int num_bigits ( ) const

Definition at line 612 of file format-inl.h.

References buffer< T >::size().

◆ operator*=()

bigint& operator*= ( Int  value)

Definition at line 629 of file format-inl.h.

References FMT_ASSERT, and internal::multiply().

◆ operator<<=()

bigint& operator<<= ( int  shift)

Definition at line 614 of file format-inl.h.

References buffer< T >::push_back(), and buffer< T >::size().

◆ operator=()

void operator= ( const bigint )
delete

◆ remove_leading_zeros()

void remove_leading_zeros ( )
private

Definition at line 539 of file format-inl.h.

References buffer< T >::resize(), and buffer< T >::size().

◆ square()

void square ( )

Definition at line 695 of file format-inl.h.

References buffer< T >::resize(), and buffer< T >::size().

◆ subtract_aligned()

void subtract_aligned ( const bigint other)
private

Definition at line 546 of file format-inl.h.

References bigint::bigits_, bigint::exp_, FMT_ASSERT, and buffer< T >::size().

◆ subtract_bigits()

void subtract_bigits ( int  index,
bigit  other,
bigit borrow 
)
private

Definition at line 533 of file format-inl.h.

References internal::index.

Friends And Related Function Documentation

◆ add_compare

int add_compare ( const bigint lhs1,
const bigint lhs2,
const bigint rhs 
)
friend

Definition at line 652 of file format-inl.h.

◆ compare

int compare ( const bigint lhs,
const bigint rhs 
)
friend

Definition at line 635 of file format-inl.h.

◆ formatter< bigint >

friend struct formatter< bigint >
friend

Definition at line 531 of file format-inl.h.

Member Data Documentation

◆ bigit_bits

FMT_CONSTEXPR_DECL const int bigit_bits = bits<bigit>::value
staticprivate

Definition at line 529 of file format-inl.h.

Referenced by formatter< internal::bigint >::format().

◆ bigits_

◆ exp_