Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
utils.hpp File Reference
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <libff/common/utils.tcc>
Include dependency graph for utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  libff
 

Macros

#define FMT(...)
 
#define ARRAY_SIZE(arr)
 

Typedefs

typedef std::vector< bool > libff::bit_vector
 

Functions

size_t libff::get_power_of_two (size_t n)
 
size_t libff::log2 (size_t n)
 returns ceil(log2(n)), so 1ul<<log2(n) is the smallest power of 2, that is not less than n
 
size_t libff::exp2 (size_t k)
 
size_t libff::to_twos_complement (int i, size_t w)
 
int libff::from_twos_complement (size_t i, size_t w)
 
size_t libff::bitreverse (size_t n, const size_t l)
 
bit_vector libff::int_list_to_bits (const std::initializer_list< unsigned long > &l, const size_t wordsize)
 
long long libff::div_ceil (long long x, long long y)
 
bool libff::is_little_endian ()
 
std::string libff::FORMAT (const std::string &prefix, const char *format,...)
 
template<typename ... Types>
void libff::UNUSED (Types &&...)
 
void libff::serialize_bit_vector (std::ostream &out, const bit_vector &v)
 
void libff::deserialize_bit_vector (std::istream &in, bit_vector &v)
 
template<typename T >
size_t libff::size_in_bits (const std::vector< T > &v)
 

Detailed Description

Declaration of misc math and serialization utility functions

Author
This file is part of libff, developed by SCIPR Lab and contributors (see AUTHORS).

Definition in file utils.hpp.

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE ( arr)
Value:
(sizeof(arr)/sizeof(arr[0]))

Definition at line 57 of file utils.hpp.

◆ FMT

#define FMT ( ...)
Value:
(libff::UNUSED(__VA_ARGS__), "")
void UNUSED(Types &&...)
Definition utils.hpp:43

Definition at line 48 of file utils.hpp.