Dendro  5.01
Dendro in Greek language means tree. The Dendro library is a large scale (262K cores on ORNL's Titan) distributed memory adaptive octree framework. The main goal of Dendro is to perform large scale multiphysics simulations efficeiently in mordern supercomputers. Dendro consists of efficient parallel data structures and algorithms to perform variational ( finite element) methods and finite difference mthods on 2:1 balanced arbitary adaptive octrees which enables the users to perform simulations raning from black holes (binary black hole mergers) to blood flow in human body, where applications ranging from relativity, astrophysics to biomedical engineering.
Functions
binOp Namespace Reference

A set of functions for fast binary operations. More...

Functions

bool isPowerOfTwo (unsigned int n)
 
unsigned int binLength (unsigned int num)
 
unsigned int fastLog2 (unsigned int num)
 
int toBin (unsigned int dec, unsigned int binLen, std::vector< bool > &result)
 Converts a decimal number to binary. More...
 
unsigned int binToDec (unsigned int *numBin, unsigned int binLen)
 
int getNextHighestPowerOfTwo (unsigned int n)
 
int getPrevHighestPowerOfTwo (unsigned int n)
 
template<typename T >
void setBit (T &val, unsigned int i)
 sets the i^th bit on the value val
 
template<typename T >
unsigned int getBit (T val, unsigned int i)
 gets the i^th bit on the value val
 

Detailed Description

A set of functions for fast binary operations.

Author
Hari Sundar

Function Documentation

◆ binLength()

unsigned int binOp::binLength ( unsigned int  num)
Returns
the minimum number of digits required to represent num in binary

◆ binToDec()

unsigned int binOp::binToDec ( unsigned int *  numBin,
unsigned int  binLen 
)
Parameters
numBinbinary representation of the number
binLenlength of numBin
Returns
the decimal representation of the binary number

◆ fastLog2()

unsigned int binOp::fastLog2 ( unsigned int  num)

return log to base 2 of num

◆ getNextHighestPowerOfTwo()

int binOp::getNextHighestPowerOfTwo ( unsigned int  n)
Returns
compute the next highest power of 2 of 32-bit v

◆ getPrevHighestPowerOfTwo()

int binOp::getPrevHighestPowerOfTwo ( unsigned int  n)
Returns
compute the prev highest power of 2 of 32-bit v

◆ isPowerOfTwo()

bool binOp::isPowerOfTwo ( unsigned int  n)
Returns
true if n is a power of 2.

◆ toBin()

int binOp::toBin ( unsigned int  dec,
unsigned int  binLen,
std::vector< bool > &  result 
)

Converts a decimal number to binary.

Parameters
decthe decimal number
binLenthe number of digits required in the binary representation
resultthe binary representation
Returns
error flag