Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
fast_float::stackvec< size > Struct Template Reference

#include <fast_float.h>

Inheritance diagram for fast_float::stackvec< size >:
[legend]

Public Member Functions

 stackvec ()=default
 
 stackvec (const stackvec &)=delete
 
stackvecoperator= (const stackvec &)=delete
 
 stackvec (stackvec &&)=delete
 
stackvecoperator= (stackvec &&other)=delete
 
 stackvec (limb_span s)
 
limboperator[] (size_t index) noexcept
 
const limboperator[] (size_t index) const noexcept
 
const limbrindex (size_t index) const noexcept
 
void set_len (size_t len) noexcept
 
constexpr size_t len () const noexcept
 
constexpr bool is_empty () const noexcept
 
constexpr size_t capacity () const noexcept
 
void push_unchecked (limb value) noexcept
 
bool try_push (limb value) noexcept
 
void extend_unchecked (limb_span s) noexcept
 
bool try_extend (limb_span s) noexcept
 
void resize_unchecked (size_t new_len, limb value) noexcept
 
bool try_resize (size_t new_len, limb value) noexcept
 
bool nonzero (size_t index) const noexcept
 
void normalize () noexcept
 

Public Attributes

limb data [size]
 
uint16_t length {0}
 

Detailed Description

template<uint16_t size>
struct fast_float::stackvec< size >

Definition at line 1632 of file fast_float.h.

Constructor & Destructor Documentation

◆ stackvec() [1/4]

template<uint16_t size>
fast_float::stackvec< size >::stackvec ( )
default

◆ stackvec() [2/4]

template<uint16_t size>
fast_float::stackvec< size >::stackvec ( const stackvec< size > &  )
delete

◆ stackvec() [3/4]

template<uint16_t size>
fast_float::stackvec< size >::stackvec ( stackvec< size > &&  )
delete

◆ stackvec() [4/4]

template<uint16_t size>
fast_float::stackvec< size >::stackvec ( limb_span  s)
inline

Definition at line 1644 of file fast_float.h.

1644 {
1646 }
#define FASTFLOAT_ASSERT(x)
Definition: fast_float.h:179
bool try_extend(limb_span s) noexcept
Definition: fast_float.h:1697

References FASTFLOAT_ASSERT, and fast_float::stackvec< size >::try_extend().

Here is the call graph for this function:

Member Function Documentation

◆ capacity()

template<uint16_t size>
constexpr size_t fast_float::stackvec< size >::capacity ( ) const
inlineconstexprnoexcept

Definition at line 1673 of file fast_float.h.

1673 {
1674 return size;
1675 }

References size.

Referenced by fast_float::bigint::shl_limbs(), fast_float::stackvec< size >::try_extend(), fast_float::stackvec< size >::try_push(), and fast_float::stackvec< size >::try_resize().

Here is the caller graph for this function:

◆ extend_unchecked()

template<uint16_t size>
void fast_float::stackvec< size >::extend_unchecked ( limb_span  s)
inlinenoexcept

Definition at line 1691 of file fast_float.h.

1691 {
1692 limb* ptr = data + length;
1693 ::memcpy((void*)ptr, (const void*)s.ptr, sizeof(limb) * s.len());
1694 set_len(len() + s.len());
1695 }
uint32_t limb
Definition: fast_float.h:1616
constexpr size_t len() const noexcept
Definition: fast_float.h:1667
void set_len(size_t len) noexcept
Definition: fast_float.h:1664

References fast_float::stackvec< size >::data, fast_float::stackvec< size >::len(), fast_float::stackvec< size >::length, and fast_float::stackvec< size >::set_len().

Referenced by fast_float::stackvec< size >::try_extend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_empty()

template<uint16_t size>
constexpr bool fast_float::stackvec< size >::is_empty ( ) const
inlineconstexprnoexcept

Definition at line 1670 of file fast_float.h.

1670 {
1671 return length == 0;
1672 }

References fast_float::stackvec< size >::length.

Referenced by fast_float::bigint::ctlz(), and fast_float::bigint::shl_limbs().

Here is the caller graph for this function:

◆ len()

template<uint16_t size>
constexpr size_t fast_float::stackvec< size >::len ( ) const
inlineconstexprnoexcept

◆ nonzero()

template<uint16_t size>
bool fast_float::stackvec< size >::nonzero ( size_t  index) const
inlinenoexcept

Definition at line 1731 of file fast_float.h.

1731 {
1732 while (index < len()) {
1733 if (rindex(index) != 0) {
1734 return true;
1735 }
1736 index++;
1737 }
1738 return false;
1739 }
const limb & rindex(size_t index) const noexcept
Definition: fast_float.h:1657

References fast_float::stackvec< size >::len(), and fast_float::stackvec< size >::rindex().

Referenced by fast_float::bigint::hi64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalize()

template<uint16_t size>
void fast_float::stackvec< size >::normalize ( )
inlinenoexcept

Definition at line 1741 of file fast_float.h.

1741 {
1742 while (len() > 0 && rindex(0) == 0) {
1743 length--;
1744 }
1745 }

References fast_float::stackvec< size >::len(), fast_float::stackvec< size >::length, and fast_float::stackvec< size >::rindex().

Referenced by fast_float::bigint::bigint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

template<uint16_t size>
stackvec & fast_float::stackvec< size >::operator= ( const stackvec< size > &  )
delete

◆ operator=() [2/2]

template<uint16_t size>
stackvec & fast_float::stackvec< size >::operator= ( stackvec< size > &&  other)
delete

◆ operator[]() [1/2]

template<uint16_t size>
const limb & fast_float::stackvec< size >::operator[] ( size_t  index) const
inlinenoexcept

Definition at line 1652 of file fast_float.h.

1652 {
1654 return data[index];
1655 }
#define FASTFLOAT_DEBUG_ASSERT(x)
Definition: fast_float.h:184

References fast_float::stackvec< size >::data, FASTFLOAT_DEBUG_ASSERT, and fast_float::stackvec< size >::length.

◆ operator[]() [2/2]

template<uint16_t size>
limb & fast_float::stackvec< size >::operator[] ( size_t  index)
inlinenoexcept

Definition at line 1648 of file fast_float.h.

1648 {
1650 return data[index];
1651 }

References fast_float::stackvec< size >::data, FASTFLOAT_DEBUG_ASSERT, and fast_float::stackvec< size >::length.

◆ push_unchecked()

template<uint16_t size>
void fast_float::stackvec< size >::push_unchecked ( limb  value)
inlinenoexcept

Definition at line 1677 of file fast_float.h.

1677 {
1678 data[length] = value;
1679 length++;
1680 }

References fast_float::stackvec< size >::data, and fast_float::stackvec< size >::length.

Referenced by fast_float::bigint::bigint(), and fast_float::stackvec< size >::try_push().

Here is the caller graph for this function:

◆ resize_unchecked()

template<uint16_t size>
void fast_float::stackvec< size >::resize_unchecked ( size_t  new_len,
limb  value 
)
inlinenoexcept

Definition at line 1708 of file fast_float.h.

1708 {
1709 if (new_len > len()) {
1710 size_t count = new_len - len();
1711 limb* first = data + len();
1712 limb* last = first + count;
1713 ::std::fill(first, last, value);
1714 set_len(new_len);
1715 } else {
1716 set_len(new_len);
1717 }
1718 }

References fast_float::stackvec< size >::data, fast_float::stackvec< size >::len(), and fast_float::stackvec< size >::set_len().

Referenced by fast_float::stackvec< size >::try_resize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rindex()

template<uint16_t size>
const limb & fast_float::stackvec< size >::rindex ( size_t  index) const
inlinenoexcept

Definition at line 1657 of file fast_float.h.

1657 {
1659 size_t rindex = length - index - 1;
1660 return data[rindex];
1661 }

References fast_float::stackvec< size >::data, FASTFLOAT_DEBUG_ASSERT, fast_float::stackvec< size >::length, and fast_float::stackvec< size >::rindex().

Referenced by fast_float::bigint::ctlz(), fast_float::bigint::hi64(), fast_float::stackvec< size >::nonzero(), fast_float::stackvec< size >::normalize(), and fast_float::stackvec< size >::rindex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_len()

template<uint16_t size>
void fast_float::stackvec< size >::set_len ( size_t  len)
inlinenoexcept

Definition at line 1664 of file fast_float.h.

1664 {
1665 length = uint16_t(len);
1666 }

References fast_float::stackvec< size >::len(), and fast_float::stackvec< size >::length.

Referenced by fast_float::stackvec< size >::extend_unchecked(), fast_float::long_mul(), fast_float::stackvec< size >::resize_unchecked(), and fast_float::bigint::shl_limbs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ try_extend()

template<uint16_t size>
bool fast_float::stackvec< size >::try_extend ( limb_span  s)
inlinenoexcept

Definition at line 1697 of file fast_float.h.

1697 {
1698 if (len() + s.len() <= capacity()) {
1700 return true;
1701 } else {
1702 return false;
1703 }
1704 }
constexpr size_t capacity() const noexcept
Definition: fast_float.h:1673
void extend_unchecked(limb_span s) noexcept
Definition: fast_float.h:1691

References fast_float::stackvec< size >::capacity(), fast_float::stackvec< size >::extend_unchecked(), and fast_float::stackvec< size >::len().

Referenced by fast_float::long_mul(), and fast_float::stackvec< size >::stackvec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ try_push()

template<uint16_t size>
bool fast_float::stackvec< size >::try_push ( limb  value)
inlinenoexcept

Definition at line 1682 of file fast_float.h.

1682 {
1683 if (len() < capacity()) {
1684 push_unchecked(value);
1685 return true;
1686 } else {
1687 return false;
1688 }
1689 }
void push_unchecked(limb value) noexcept
Definition: fast_float.h:1677

References fast_float::stackvec< size >::capacity(), fast_float::stackvec< size >::len(), and fast_float::stackvec< size >::push_unchecked().

Referenced by fast_float::bigint::shl_bits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ try_resize()

template<uint16_t size>
bool fast_float::stackvec< size >::try_resize ( size_t  new_len,
limb  value 
)
inlinenoexcept

Definition at line 1720 of file fast_float.h.

1720 {
1721 if (new_len > capacity()) {
1722 return false;
1723 } else {
1724 resize_unchecked(new_len, value);
1725 return true;
1726 }
1727 }
void resize_unchecked(size_t new_len, limb value) noexcept
Definition: fast_float.h:1708

References fast_float::stackvec< size >::capacity(), and fast_float::stackvec< size >::resize_unchecked().

Here is the call graph for this function:

Member Data Documentation

◆ data

template<uint16_t size>
limb fast_float::stackvec< size >::data[size]

◆ length

template<uint16_t size>
uint16_t fast_float::stackvec< size >::length {0}

The documentation for this struct was generated from the following file: