ReproBLAS
Macros | Typedefs | Functions
idxd.h File Reference

idxd.h defines the indexed types and the lower level functions associated with their use. More...

#include <stddef.h>
#include <stdlib.h>
#include <float.h>

Go to the source code of this file.

Macros

#define DIWIDTH   40
 Indexed double precision bin width. More...
 
#define SIWIDTH   13
 Indexed single precision bin width. More...
 
#define idxd_DIMAXINDEX   (((DBL_MAX_EXP - DBL_MIN_EXP + DBL_MANT_DIG - 1)/DIWIDTH) - 1)
 Indexed double precision maximum index. More...
 
#define idxd_SIMAXINDEX   (((FLT_MAX_EXP - FLT_MIN_EXP + FLT_MANT_DIG - 1)/SIWIDTH) - 1)
 Indexed single precision maximum index. More...
 
#define idxd_DIMAXFOLD   (idxd_DIMAXINDEX + 1)
 The maximum double precision fold supported by the library. More...
 
#define idxd_SIMAXFOLD   (idxd_SIMAXINDEX + 1)
 The maximum single precision fold supported by the library. More...
 
#define idxd_DIENDURANCE   (1 << (DBL_MANT_DIG - DIWIDTH - 2))
 Indexed double precision deposit endurance. More...
 
#define idxd_SIENDURANCE   (1 << (FLT_MANT_DIG - SIWIDTH - 2))
 Indexed single precision deposit endurance. More...
 
#define idxd_DICAPACITY   (idxd_DIENDURANCE*(1.0/DBL_EPSILON - 1.0))
 Indexed double precision capacity. More...
 
#define idxd_SICAPACITY   (idxd_SIENDURANCE*(1.0/FLT_EPSILON - 1.0))
 Indexed single precision capacity. More...
 
#define idxd_DMCOMPRESSION   (1.0/(1 << (DBL_MANT_DIG - DIWIDTH + 1)))
 Indexed double precision compression factor. More...
 
#define idxd_SMCOMPRESSION   (1.0/(1 << (FLT_MANT_DIG - SIWIDTH + 1)))
 Indexed single precision compression factor. More...
 
#define idxd_DMEXPANSION   (1.0*(1 << (DBL_MANT_DIG - DIWIDTH + 1)))
 Indexed double precision expansion factor. More...
 
#define idxd_SMEXPANSION   (1.0*(1 << (FLT_MANT_DIG - SIWIDTH + 1)))
 Indexed single precision expansion factor. More...
 

Typedefs

typedef double double_indexed
 The indexed double datatype. More...
 
typedef double double_complex_indexed
 The indexed complex double datatype. More...
 
typedef float float_indexed
 The indexed float datatype. More...
 
typedef float float_complex_indexed
 The indexed complex float datatype. More...
 

Functions

size_t idxd_disize (const int fold)
 indexed double precision size More...
 
size_t idxd_zisize (const int fold)
 indexed complex double precision size More...
 
size_t idxd_sisize (const int fold)
 indexed single precision size More...
 
size_t idxd_cisize (const int fold)
 indexed complex single precision size More...
 
double_indexedidxd_dialloc (const int fold)
 indexed double precision allocation More...
 
double_complex_indexedidxd_zialloc (const int fold)
 indexed complex double precision allocation More...
 
float_indexedidxd_sialloc (const int fold)
 indexed single precision allocation More...
 
float_complex_indexedidxd_cialloc (const int fold)
 indexed complex single precision allocation More...
 
int idxd_dinum (const int fold)
 indexed double precision size More...
 
int idxd_zinum (const int fold)
 indexed complex double precision size More...
 
int idxd_sinum (const int fold)
 indexed single precision size More...
 
int idxd_cinum (const int fold)
 indexed complex single precision size More...
 
double idxd_dibound (const int fold, const int N, const double X, const double S)
 Get indexed double precision summation error bound. More...
 
float idxd_sibound (const int fold, const int N, const float X, const float S)
 Get indexed single precision summation error bound. More...
 
const double * idxd_dmbins (const int X)
 Get indexed double precision reference bins. More...
 
const float * idxd_smbins (const int X)
 Get indexed single precision reference bins. More...
 
int idxd_dindex (const double X)
 Get index of double precision. More...
 
int idxd_dmindex (const double *priX)
 Get index of manually specified indexed double precision. More...
 
int idxd_dmindex0 (const double *priX)
 Check if index of manually specified indexed double precision is 0. More...
 
int idxd_sindex (const float X)
 Get index of single precision. More...
 
int idxd_smindex (const float *priX)
 Get index of manually specified indexed single precision. More...
 
int idxd_smindex0 (const float *priX)
 Check if index of manually specified indexed single precision is 0. More...
 
int idxd_dmdenorm (const int fold, const double *priX)
 Check if indexed type has denormal bits. More...
 
int idxd_zmdenorm (const int fold, const double *priX)
 Check if indexed type has denormal bits. More...
 
int idxd_smdenorm (const int fold, const float *priX)
 Check if indexed type has denormal bits. More...
 
int idxd_cmdenorm (const int fold, const float *priX)
 Check if indexed type has denormal bits. More...
 
void idxd_diprint (const int fold, const double_indexed *X)
 Print indexed double precision. More...
 
void idxd_dmprint (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX)
 Print manually specified indexed double precision. More...
 
void idxd_ziprint (const int fold, const double_complex_indexed *X)
 Print indexed complex double precision. More...
 
void idxd_zmprint (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX)
 Print manually specified indexed complex double precision. More...
 
void idxd_siprint (const int fold, const float_indexed *X)
 Print indexed single precision. More...
 
void idxd_smprint (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX)
 Print manually specified indexed single precision. More...
 
void idxd_ciprint (const int fold, const float_complex_indexed *X)
 Print indexed complex single precision. More...
 
void idxd_cmprint (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX)
 Print manually specified indexed complex single precision. More...
 
void idxd_didiset (const int fold, const double_indexed *X, double_indexed *Y)
 Set indexed double precision (Y = X) More...
 
void idxd_dmdmset (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Set manually specified indexed double precision (Y = X) More...
 
void idxd_ziziset (const int fold, const double_complex_indexed *X, double_complex_indexed *Y)
 Set indexed complex double precision (Y = X) More...
 
void idxd_zmzmset (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Set manually specified indexed complex double precision (Y = X) More...
 
void idxd_zidiset (const int fold, const double_indexed *X, double_complex_indexed *Y)
 Set indexed complex double precision to indexed double precision (Y = X) More...
 
void idxd_zmdmset (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Set manually specified indexed complex double precision to manually specified indexed double precision (Y = X) More...
 
void idxd_sisiset (const int fold, const float_indexed *X, float_indexed *Y)
 Set indexed single precision (Y = X) More...
 
void idxd_smsmset (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Set manually specified indexed single precision (Y = X) More...
 
void idxd_ciciset (const int fold, const float_complex_indexed *X, float_complex_indexed *Y)
 Set indexed complex single precision (Y = X) More...
 
void idxd_cmcmset (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Set manually specified indexed complex single precision (Y = X) More...
 
void idxd_cisiset (const int fold, const float_indexed *X, float_complex_indexed *Y)
 Set indexed complex single precision to indexed single precision (Y = X) More...
 
void idxd_cmsmset (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Set manually specified indexed complex single precision to manually specified indexed single precision (Y = X) More...
 
void idxd_disetzero (const int fold, double_indexed *X)
 Set indexed double precision to 0 (X = 0) More...
 
void idxd_dmsetzero (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Set manually specified indexed double precision to 0 (X = 0) More...
 
void idxd_zisetzero (const int fold, double_complex_indexed *X)
 Set indexed double precision to 0 (X = 0) More...
 
void idxd_zmsetzero (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Set manually specified indexed complex double precision to 0 (X = 0) More...
 
void idxd_sisetzero (const int fold, float_indexed *X)
 Set indexed single precision to 0 (X = 0) More...
 
void idxd_smsetzero (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Set manually specified indexed single precision to 0 (X = 0) More...
 
void idxd_cisetzero (const int fold, float_complex_indexed *X)
 Set indexed single precision to 0 (X = 0) More...
 
void idxd_cmsetzero (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Set manually specified indexed complex single precision to 0 (X = 0) More...
 
void idxd_didiadd (const int fold, const double_indexed *X, double_indexed *Y)
 Add indexed double precision (Y += X) More...
 
void idxd_dmdmadd (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Add manually specified indexed double precision (Y += X) More...
 
void idxd_ziziadd (const int fold, const double_complex_indexed *X, double_complex_indexed *Y)
 Add indexed complex double precision (Y += X) More...
 
void idxd_zmzmadd (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, double *priY, const int incpriY, double *carY, const int inccarY)
 Add manually specified indexed complex double precision (Y += X) More...
 
void idxd_sisiadd (const int fold, const float_indexed *X, float_indexed *Y)
 Add indexed single precision (Y += X) More...
 
void idxd_smsmadd (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Add manually specified indexed single precision (Y += X) More...
 
void idxd_ciciadd (const int fold, const float_complex_indexed *X, float_complex_indexed *Y)
 Add indexed complex single precision (Y += X) More...
 
void idxd_cmcmadd (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, float *priY, const int incpriY, float *carY, const int inccarY)
 Add manually specified indexed complex single precision (Y += X) More...
 
void idxd_didiaddv (const int fold, const int N, const double_indexed *X, const int incX, double_indexed *Y, const int incY)
 Add indexed double precision vectors (Y += X) More...
 
void idxd_ziziaddv (const int fold, const int N, const double_complex_indexed *X, const int incX, double_complex_indexed *Y, const int incY)
 Add indexed complex double precision vectors (Y += X) More...
 
void idxd_sisiaddv (const int fold, const int N, const float_indexed *X, const int incX, float_indexed *Y, const int incY)
 Add indexed single precision vectors (Y += X) More...
 
void idxd_ciciaddv (const int fold, const int N, const float_complex_indexed *X, const int incX, float_complex_indexed *Y, const int incY)
 Add indexed complex single precision vectors (Y += X) More...
 
void idxd_didadd (const int fold, const double X, double_indexed *Y)
 Add double precision to indexed double precision (Y += X) More...
 
void idxd_dmdadd (const int fold, const double X, double *priY, const int incpriY, double *carY, const int inccarY)
 Add double precision to manually specified indexed double precision (Y += X) More...
 
void idxd_zizadd (const int fold, const void *X, double_complex_indexed *Y)
 Add complex double precision to indexed complex double precision (Y += X) More...
 
void idxd_zmzadd (const int fold, const void *X, double *priY, const int incpriY, double *carY, const int inccarY)
 Add complex double precision to manually specified indexed complex double precision (Y += X) More...
 
void idxd_sisadd (const int fold, const float X, float_indexed *Y)
 Add single precision to indexed single precision (Y += X) More...
 
void idxd_smsadd (const int fold, const float X, float *priY, const int incpriY, float *carY, const int inccarY)
 Add single precision to manually specified indexed single precision (Y += X) More...
 
void idxd_cicadd (const int fold, const void *X, float_complex_indexed *Y)
 Add complex single precision to indexed complex single precision (Y += X) More...
 
void idxd_cmcadd (const int fold, const void *X, float *priY, const int incpriY, float *carY, const int inccarY)
 Add complex single precision to manually specified indexed complex single precision (Y += X) More...
 
void idxd_didupdate (const int fold, const double X, double_indexed *Y)
 Update indexed double precision with double precision (X -> Y) More...
 
void idxd_dmdupdate (const int fold, const double X, double *priY, const int incpriY, double *carY, const int inccarY)
 Update manually specified indexed double precision with double precision (X -> Y) More...
 
void idxd_zizupdate (const int fold, const void *X, double_complex_indexed *Y)
 Update indexed complex double precision with complex double precision (X -> Y) More...
 
void idxd_zmzupdate (const int fold, const void *X, double *priY, const int incpriY, double *carY, const int inccarY)
 Update manually specified indexed complex double precision with complex double precision (X -> Y) More...
 
void idxd_zidupdate (const int fold, const double X, double_complex_indexed *Y)
 Update indexed complex double precision with double precision (X -> Y) More...
 
void idxd_zmdupdate (const int fold, const double X, double *priY, const int incpriY, double *carY, const int inccarY)
 Update manually specified indexed complex double precision with double precision (X -> Y) More...
 
void idxd_sisupdate (const int fold, const float X, float_indexed *Y)
 Update indexed single precision with single precision (X -> Y) More...
 
void idxd_smsupdate (const int fold, const float X, float *priY, const int incpriY, float *carY, const int inccarY)
 Update manually specified indexed single precision with single precision (X -> Y) More...
 
void idxd_cicupdate (const int fold, const void *X, float_complex_indexed *Y)
 Update indexed complex single precision with complex single precision (X -> Y) More...
 
void idxd_cmcupdate (const int fold, const void *X, float *priY, const int incpriY, float *carY, const int inccarY)
 Update manually specified indexed complex single precision with complex single precision (X -> Y) More...
 
void idxd_cisupdate (const int fold, const float X, float_complex_indexed *Y)
 Update indexed complex single precision with single precision (X -> Y) More...
 
void idxd_cmsupdate (const int fold, const float X, float *priY, const int incpriY, float *carY, const int inccarY)
 Update manually specified indexed complex single precision with single precision (X -> Y) More...
 
void idxd_diddeposit (const int fold, const double X, double_indexed *Y)
 Add double precision to suitably indexed indexed double precision (Y += X) More...
 
void idxd_dmddeposit (const int fold, const double X, double *priY, const int incpriY)
 Add double precision to suitably indexed manually specified indexed double precision (Y += X) More...
 
void idxd_zizdeposit (const int fold, const void *X, double_complex_indexed *Y)
 Add complex double precision to suitably indexed indexed complex double precision (Y += X) More...
 
void idxd_zmzdeposit (const int fold, const void *X, double *priY, const int incpriY)
 Add complex double precision to suitably indexed manually specified indexed complex double precision (Y += X) More...
 
void idxd_sisdeposit (const int fold, const float X, float_indexed *Y)
 Add single precision to suitably indexed indexed single precision (Y += X) More...
 
void idxd_smsdeposit (const int fold, const float X, float *priY, const int incpriY)
 Add single precision to suitably indexed manually specified indexed single precision (Y += X) More...
 
void idxd_cicdeposit (const int fold, const void *X, float_complex_indexed *Y)
 Add complex single precision to suitably indexed indexed complex single precision (Y += X) More...
 
void idxd_cmcdeposit (const int fold, const void *X, float *priY, const int incpriY)
 Add complex single precision to suitably indexed manually specified indexed complex single precision (Y += X) More...
 
void idxd_direnorm (const int fold, double_indexed *X)
 Renormalize indexed double precision. More...
 
void idxd_dmrenorm (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Renormalize manually specified indexed double precision. More...
 
void idxd_zirenorm (const int fold, double_complex_indexed *X)
 Renormalize indexed complex double precision. More...
 
void idxd_zmrenorm (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Renormalize manually specified indexed complex double precision. More...
 
void idxd_sirenorm (const int fold, float_indexed *X)
 Renormalize indexed single precision. More...
 
void idxd_smrenorm (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Renormalize manually specified indexed single precision. More...
 
void idxd_cirenorm (const int fold, float_complex_indexed *X)
 Renormalize indexed complex single precision. More...
 
void idxd_cmrenorm (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Renormalize manually specified indexed complex single precision. More...
 
void idxd_didconv (const int fold, const double X, double_indexed *Y)
 Convert double precision to indexed double precision (X -> Y) More...
 
void idxd_dmdconv (const int fold, const double X, double *priY, const int incpriY, double *carY, const int inccarY)
 Convert double precision to manually specified indexed double precision (X -> Y) More...
 
void idxd_zizconv (const int fold, const void *X, double_complex_indexed *Y)
 Convert complex double precision to indexed complex double precision (X -> Y) More...
 
void idxd_zmzconv (const int fold, const void *X, double *priY, const int incpriY, double *carY, const int inccarY)
 Convert complex double precision to manually specified indexed complex double precision (X -> Y) More...
 
void idxd_sisconv (const int fold, const float X, float_indexed *Y)
 Convert single precision to indexed single precision (X -> Y) More...
 
void idxd_smsconv (const int fold, const float X, float *priY, const int incpriY, float *carY, const int inccarY)
 Convert single precision to manually specified indexed single precision (X -> Y) More...
 
void idxd_cicconv (const int fold, const void *X, float_complex_indexed *Y)
 Convert complex single precision to indexed complex single precision (X -> Y) More...
 
void idxd_cmcconv (const int fold, const void *X, float *priY, const int incpriY, float *carY, const int inccarY)
 Convert complex single precision to manually specified indexed complex single precision (X -> Y) More...
 
double idxd_ddiconv (const int fold, const double_indexed *X)
 Convert indexed double precision to double precision (X -> Y) More...
 
double idxd_ddmconv (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX)
 Convert manually specified indexed double precision to double precision (X -> Y) More...
 
void idxd_zziconv_sub (const int fold, const double_complex_indexed *X, void *conv)
 Convert indexed complex double precision to complex double precision (X -> Y) More...
 
void idxd_zzmconv_sub (const int fold, const double *priX, const int incpriX, const double *carX, const int inccarX, void *conv)
 Convert manually specified indexed complex double precision to complex double precision (X -> Y) More...
 
float idxd_ssiconv (const int fold, const float_indexed *X)
 Convert indexed single precision to single precision (X -> Y) More...
 
float idxd_ssmconv (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX)
 Convert manually specified indexed single precision to single precision (X -> Y) More...
 
void idxd_cciconv_sub (const int fold, const float_complex_indexed *X, void *conv)
 Convert indexed complex single precision to complex single precision (X -> Y) More...
 
void idxd_ccmconv_sub (const int fold, const float *priX, const int incpriX, const float *carX, const int inccarX, void *conv)
 Convert manually specified indexed complex single precision to complex single precision (X -> Y) More...
 
void idxd_dinegate (const int fold, double_indexed *X)
 Negate indexed double precision (X = -X) More...
 
void idxd_dmnegate (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Negate manually specified indexed double precision (X = -X) More...
 
void idxd_zinegate (const int fold, double_complex_indexed *X)
 Negate indexed complex double precision (X = -X) More...
 
void idxd_zmnegate (const int fold, double *priX, const int incpriX, double *carX, const int inccarX)
 Negate manually specified indexed complex double precision (X = -X) More...
 
void idxd_sinegate (const int fold, float_indexed *X)
 Negate indexed single precision (X = -X) More...
 
void idxd_smnegate (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Negate manually specified indexed single precision (X = -X) More...
 
void idxd_cinegate (const int fold, float_complex_indexed *X)
 Negate indexed complex single precision (X = -X) More...
 
void idxd_cmnegate (const int fold, float *priX, const int incpriX, float *carX, const int inccarX)
 Negate manually specified indexed complex single precision (X = -X) More...
 
double idxd_dscale (const double X)
 Get a reproducible double precision scale. More...
 
float idxd_sscale (const float X)
 Get a reproducible single precision scale. More...
 
void idxd_dmdrescale (const int fold, const double X, const double scaleY, double *priY, const int incpriY, double *carY, const int inccarY)
 rescale manually specified indexed double precision sum of squares More...
 
void idxd_zmdrescale (const int fold, const double X, const double scaleY, double *priY, const int incpriY, double *carY, const int inccarY)
 rescale manually specified indexed complex double precision sum of squares More...
 
void idxd_smsrescale (const int fold, const float X, const float scaleY, float *priY, const int incpriY, float *carY, const int inccarY)
 rescale manually specified indexed single precision sum of squares More...
 
void idxd_cmsrescale (const int fold, const float X, const float scaleY, float *priY, const int incpriY, float *carY, const int inccarY)
 rescale manually specified indexed complex single precision sum of squares More...
 
double idxd_dmdmaddsq (const int fold, const double scaleX, const double *priX, const int incpriX, const double *carX, const int inccarX, const double scaleY, double *priY, const int incpriY, double *carY, const int inccarY)
 Add manually specified indexed double precision scaled sums of squares (Y += X) More...
 
double idxd_didiaddsq (const int fold, const double scaleX, const double_indexed *X, const double scaleY, double_indexed *Y)
 Add indexed double precision scaled sums of squares (Y += X) More...
 
float idxd_smsmaddsq (const int fold, const float scaleX, const float *priX, const int incpriX, const float *carX, const int inccarX, const float scaleY, float *priY, const int incpriY, float *carY, const int inccarY)
 Add manually specified indexed single precision scaled sums of squares (Y += X) More...
 
float idxd_sisiaddsq (const int fold, const float scaleX, const float_indexed *X, const float scaleY, float_indexed *Y)
 Add indexed single precision scaled sums of squares (Y += X) More...
 
double idxd_ufp (const double X)
 unit in the first place More...
 
float idxd_ufpf (const float X)
 unit in the first place More...
 

Detailed Description

idxd.h defines the indexed types and the lower level functions associated with their use.

This header is modeled after cblas.h, and as such functions are prefixed with character sets describing the data types they operate upon. For example, the function dfoo would perform the function foo on double possibly returning a double.

If two character sets are prefixed, the first set of characters describes the output and the second the input type. For example, the function dzbar would perform the function bar on double complex and return a double.

Such character sets are listed as follows:

Throughout the library, complex types are specified via *void pointers. These routines will sometimes be suffixed by sub, to represent that a function has been made into a subroutine. This allows programmers to use whatever complex types they are already using, as long as the memory pointed to is of the form of two adjacent floating point types, the first and second representing real and imaginary components of the complex number.

The goal of using indexed types is to obtain either more accurate or reproducible summation of floating point numbers. In reproducible summation, floating point numbers are split into several slices along predefined boundaries in the exponent range. The space between two boundaries is called a bin. Indexed types are composed of several accumulators, each accumulating the slices in a particular bin. The accumulators correspond to the largest consecutive nonzero bins seen so far.

The parameter fold describes how many accumulators are used in the indexed types supplied to a subroutine (an indexed type with k accumulators is k-fold). The default value for this parameter can be set in config.h. If you are unsure of what value to use for fold, we recommend 3. Note that the fold of indexed types must be the same for all indexed types that interact with each other. Operations on more than one indexed type assume all indexed types being operated upon have the same fold. Note that the fold of an indexed type may not be changed once the type has been allocated. A common use case would be to set the value of fold as a global macro in your code and supply it to all indexed functions that you use.

Power users of the library may find themselves wanting to manually specify the underlying primary and carry vectors of an indexed type themselves. If you do not know what these are, don't worry about the manually specified indexed types.

Macro Definition Documentation

#define DIWIDTH   40

Indexed double precision bin width.

bin width (in bits)

Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
#define idxd_DICAPACITY   (idxd_DIENDURANCE*(1.0/DBL_EPSILON - 1.0))

Indexed double precision capacity.

The maximum number of double precision numbers that can be summed using indexed double precision. Applies also to indexed complex double precision.

Author
Peter Ahrens
Date
27 Apr 2015
#define idxd_DIENDURANCE   (1 << (DBL_MANT_DIG - DIWIDTH - 2))

Indexed double precision deposit endurance.

The number of deposits that can be performed before a renorm is necessary. Applies also to indexed complex double precision.

Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
#define idxd_DIMAXFOLD   (idxd_DIMAXINDEX + 1)

The maximum double precision fold supported by the library.

Author
Peter Ahrens
Date
14 Jan 2016
#define idxd_DIMAXINDEX   (((DBL_MAX_EXP - DBL_MIN_EXP + DBL_MANT_DIG - 1)/DIWIDTH) - 1)

Indexed double precision maximum index.

maximum index (inclusive)

Author
Peter Ahrens
Date
24 Jun 2015
#define idxd_DMCOMPRESSION   (1.0/(1 << (DBL_MANT_DIG - DIWIDTH + 1)))

Indexed double precision compression factor.

This factor is used to scale down inputs before deposition into the bin of highest index

Author
Peter Ahrens
Date
19 May 2015
#define idxd_DMEXPANSION   (1.0*(1 << (DBL_MANT_DIG - DIWIDTH + 1)))

Indexed double precision expansion factor.

This factor is used to scale up inputs after deposition into the bin of highest index

Author
Peter Ahrens
Date
19 May 2015
#define idxd_SICAPACITY   (idxd_SIENDURANCE*(1.0/FLT_EPSILON - 1.0))

Indexed single precision capacity.

The maximum number of single precision numbers that can be summed using indexed single precision. Applies also to indexed complex double precision.

Author
Peter Ahrens
Date
27 Apr 2015
#define idxd_SIENDURANCE   (1 << (FLT_MANT_DIG - SIWIDTH - 2))

Indexed single precision deposit endurance.

The number of deposits that can be performed before a renorm is necessary. Applies also to indexed complex single precision.

Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
#define idxd_SIMAXFOLD   (idxd_SIMAXINDEX + 1)

The maximum single precision fold supported by the library.

Author
Peter Ahrens
Date
14 Jan 2016
#define idxd_SIMAXINDEX   (((FLT_MAX_EXP - FLT_MIN_EXP + FLT_MANT_DIG - 1)/SIWIDTH) - 1)

Indexed single precision maximum index.

maximum index (inclusive)

Author
Peter Ahrens
Date
24 Jun 2015
#define idxd_SMCOMPRESSION   (1.0/(1 << (FLT_MANT_DIG - SIWIDTH + 1)))

Indexed single precision compression factor.

This factor is used to scale down inputs before deposition into the bin of highest index

Author
Peter Ahrens
Date
19 May 2015
#define idxd_SMEXPANSION   (1.0*(1 << (FLT_MANT_DIG - SIWIDTH + 1)))

Indexed single precision expansion factor.

This factor is used to scale up inputs after deposition into the bin of highest index

Author
Peter Ahrens
Date
19 May 2015
#define SIWIDTH   13

Indexed single precision bin width.

bin width (in bits)

Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015

Typedef Documentation

typedef double double_complex_indexed

The indexed complex double datatype.

To allocate a double_complex_indexed, call idxd_zialloc()

Warning
A double_complex_indexed is, under the hood, an array of double. Therefore, if you have defined an array of double_complex_indexed, you must index it by multiplying the index into the array by the number of underlying double that make up the double_complex_indexed. This number can be obtained by a call to idxd_zinum()
typedef double double_indexed

The indexed double datatype.

To allocate a double_indexed, call idxd_dialloc()

Warning
A double_indexed is, under the hood, an array of double. Therefore, if you have defined an array of double_indexed, you must index it by multiplying the index into the array by the number of underlying double that make up the double_indexed. This number can be obtained by a call to idxd_dinum()
typedef float float_complex_indexed

The indexed complex float datatype.

To allocate a float_complex_indexed, call idxd_cialloc()

Warning
A float_complex_indexed is, under the hood, an array of float. Therefore, if you have defined an array of float_complex_indexed, you must index it by multiplying the index into the array by the number of underlying float that make up the float_complex_indexed. This number can be obtained by a call to idxd_cinum()
typedef float float_indexed

The indexed float datatype.

To allocate a float_indexed, call idxd_sialloc()

Warning
A float_indexed is, under the hood, an array of float. Therefore, if you have defined an array of float_indexed, you must index it by multiplying the index into the array by the number of underlying float that make up the float_indexed. This number can be obtained by a call to idxd_sinum()

Function Documentation

void idxd_cciconv_sub ( const int  fold,
const float_complex_indexed X,
void *  conv 
)

Convert indexed complex single precision to complex single precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xindexed scalar X
convscalar return
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_ccmconv_sub ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
void *  conv 
)

Convert manually specified indexed complex single precision to complex single precision (X -> Y)

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
convscalar return
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
float_complex_indexed* idxd_cialloc ( const int  fold)

indexed complex single precision allocation

Parameters
foldthe fold of the indexed type
Returns
a freshly allocated indexed type. (free with free())
Author
Peter Ahrens
Date
27 Apr 2015
void idxd_cicadd ( const int  fold,
const void *  X,
float_complex_indexed Y 
)

Add complex single precision to indexed complex single precision (Y += X)

Performs the operation Y += X on an indexed type Y

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cicconv ( const int  fold,
const void *  X,
float_complex_indexed Y 
)

Convert complex single precision to indexed complex single precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cicdeposit ( const int  fold,
const void *  X,
float_complex_indexed Y 
)

Add complex single precision to suitably indexed indexed complex single precision (Y += X)

Performs the operation Y += X on an indexed type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called idxd_cicupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call idxd_cicdeposit() to deposit a maximum of idxd_SIENDURANCE elements into Y before renormalizing Y with idxd_cirenorm(). After any number of successive calls of idxd_cicdeposit() on Y, you must renormalize Y with idxd_cirenorm() before using any other function on Y.
Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void idxd_ciciadd ( const int  fold,
const float_complex_indexed X,
float_complex_indexed Y 
)

Add indexed complex single precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_ciciaddv ( const int  fold,
const int  N,
const float_complex_indexed X,
const int  incX,
float_complex_indexed Y,
const int  incY 
)

Add indexed complex single precision vectors (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
Nvector length
Xindexed vector X
incXX vector stride (use every incX'th element)
Yindexed vector Y
incYY vector stride (use every incY'th element)
Author
Peter Ahrens
Date
25 Jun 2015
void idxd_ciciset ( const int  fold,
const float_complex_indexed X,
float_complex_indexed Y 
)

Set indexed complex single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cicupdate ( const int  fold,
const void *  X,
float_complex_indexed Y 
)

Update indexed complex single precision with complex single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value of real and imaginary components less than absolute value of real and imaginary components of X respectively.

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cinegate ( const int  fold,
float_complex_indexed X 
)

Negate indexed complex single precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int idxd_cinum ( const int  fold)

indexed complex single precision size

Parameters
foldthe fold of the indexed type
Returns
the size (in float) of the indexed type
Author
Peter Ahrens
Date
27 Apr 2015
void idxd_ciprint ( const int  fold,
const float_complex_indexed X 
)

Print indexed complex single precision.

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cirenorm ( const int  fold,
float_complex_indexed X 
)

Renormalize indexed complex single precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cisetzero ( const int  fold,
float_complex_indexed X 
)

Set indexed single precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cisiset ( const int  fold,
const float_indexed X,
float_complex_indexed Y 
)

Set indexed complex single precision to indexed single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
size_t idxd_cisize ( const int  fold)

indexed complex single precision size

Parameters
foldthe fold of the indexed type
Returns
the size (in bytes) of the indexed type
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cisupdate ( const int  fold,
const float  X,
float_complex_indexed Y 
)

Update indexed complex single precision with single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmcadd ( const int  fold,
const void *  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add complex single precision to manually specified indexed complex single precision (Y += X)

Performs the operation Y += X on an indexed type Y

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmcconv ( const int  fold,
const void *  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Convert complex single precision to manually specified indexed complex single precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmcdeposit ( const int  fold,
const void *  X,
float *  priY,
const int  incpriY 
)

Add complex single precision to suitably indexed manually specified indexed complex single precision (Y += X)

Performs the operation Y += X on an indexed type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called idxd_cmcupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call idxd_cmcdeposit() to deposit a maximum of idxd_SIENDURANCE elements into Y before renormalizing Y with idxd_cmrenorm(). After any number of successive calls of idxd_cmcdeposit() on Y, you must renormalize Y with idxd_cmrenorm() before using any other function on Y.
Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void idxd_cmcmadd ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add manually specified indexed complex single precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmcmset ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Set manually specified indexed complex single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmcupdate ( const int  fold,
const void *  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Update manually specified indexed complex single precision with complex single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value of real and imaginary components less than absolute value of real and imaginary components of X respectively.

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int idxd_cmdenorm ( const int  fold,
const float *  priX 
)

Check if indexed type has denormal bits.

A quick check to determine if calculations involving X cannot be performed with "denormals are zero"

Parameters
foldthe fold of the indexed type
priXX's primary vector
Returns
>0 if x has denormal bits, 0 otherwise.
Author
Peter Ahrens
Date
23 Jun 2015
void idxd_cmnegate ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Negate manually specified indexed complex single precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmprint ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX 
)

Print manually specified indexed complex single precision.

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmrenorm ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Renormalize manually specified indexed complex single precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmsetzero ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Set manually specified indexed complex single precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmsmset ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Set manually specified indexed complex single precision to manually specified indexed single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_cmsrescale ( const int  fold,
const float  X,
const float  scaleY,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

rescale manually specified indexed complex single precision sum of squares

Rescale an indexed complex single precision sum of squares Y

Parameters
foldthe fold of the indexed types
XY's new scaleY (X == idxd_sscale (f) for some float f) (X >= scaleY)
scaleYY's current scaleY (scaleY == idxd_sscale (f) for some float f) (X >= scaleY)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Peter Ahrens
Date
19 Jun 2015
void idxd_cmsupdate ( const int  fold,
const float  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Update manually specified indexed complex single precision with single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double idxd_ddiconv ( const int  fold,
const double_indexed X 
)

Convert indexed double precision to double precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Returns
scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double idxd_ddmconv ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX 
)

Convert manually specified indexed double precision to double precision (X -> Y)

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Returns
scalar Y
Author
Peter Ahrens
Date
31 Jul 2015
double_indexed* idxd_dialloc ( const int  fold)

indexed double precision allocation

Parameters
foldthe fold of the indexed type
Returns
a freshly allocated indexed type. (free with free())
Author
Peter Ahrens
Date
27 Apr 2015
double idxd_dibound ( const int  fold,
const int  N,
const double  X,
const double  S 
)

Get indexed double precision summation error bound.

This is a bound on the absolute error of a summation using indexed types

Parameters
foldthe fold of the indexed types
Nthe number of double precision floating point summands
Xthe summand of maximum absolute value
Sthe value of the sum computed using indexed types
Returns
error bound
Author
Peter Ahrens
Date
31 Jul 2015
void idxd_didadd ( const int  fold,
const double  X,
double_indexed Y 
)

Add double precision to indexed double precision (Y += X)

Performs the operation Y += X on an indexed type Y

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_didconv ( const int  fold,
const double  X,
double_indexed Y 
)

Convert double precision to indexed double precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_diddeposit ( const int  fold,
const double  X,
double_indexed Y 
)

Add double precision to suitably indexed indexed double precision (Y += X)

Performs the operation Y += X on an indexed type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called idxd_didupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call idxd_diddeposit() to deposit a maximum of idxd_DIENDURANCE elements into Y before renormalizing Y with idxd_direnorm(). After any number of successive calls of idxd_diddeposit() on Y, you must renormalize Y with idxd_direnorm() before using any other function on Y.
Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void idxd_didiadd ( const int  fold,
const double_indexed X,
double_indexed Y 
)

Add indexed double precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double idxd_didiaddsq ( const int  fold,
const double  scaleX,
const double_indexed X,
const double  scaleY,
double_indexed Y 
)

Add indexed double precision scaled sums of squares (Y += X)

Performs the operation Y += X, where X and Y represent scaled sums of squares.

Parameters
foldthe fold of the indexed types
scaleXscale of X (scaleX == idxd_dscale (Z) for some double Z)
Xindexed scalar X
scaleYscale of Y (scaleY == idxd_dscale (Z) for some double Z)
Yindexed scalar Y
Returns
updated scale of Y
Author
Peter Ahrens
Date
2 Dec 2015
void idxd_didiaddv ( const int  fold,
const int  N,
const double_indexed X,
const int  incX,
double_indexed Y,
const int  incY 
)

Add indexed double precision vectors (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
Nvector length
Xindexed vector X
incXX vector stride (use every incX'th element)
Yindexed vector Y
incYY vector stride (use every incY'th element)
Author
Peter Ahrens
Date
25 Jun 2015
void idxd_didiset ( const int  fold,
const double_indexed X,
double_indexed Y 
)

Set indexed double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_didupdate ( const int  fold,
const double  X,
double_indexed Y 
)

Update indexed double precision with double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int idxd_dindex ( const double  X)

Get index of double precision.

The index of a non-indexed type is the smallest index an indexed type would need to have to sum it reproducibly. Higher indicies correspond to smaller bins.

Parameters
Xscalar X
Returns
X's index
Author
Peter Ahrens
Hong Diep Nguyen
Date
19 Jun 2015
void idxd_dinegate ( const int  fold,
double_indexed X 
)

Negate indexed double precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int idxd_dinum ( const int  fold)

indexed double precision size

Parameters
foldthe fold of the indexed type
Returns
the size (in double) of the indexed type
Author
Peter Ahrens
Date
27 Apr 2015
void idxd_diprint ( const int  fold,
const double_indexed X 
)

Print indexed double precision.

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_direnorm ( const int  fold,
double_indexed X 
)

Renormalize indexed double precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_disetzero ( const int  fold,
double_indexed X 
)

Set indexed double precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
size_t idxd_disize ( const int  fold)

indexed double precision size

Parameters
foldthe fold of the indexed type
Returns
the size (in bytes) of the indexed type
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
const double* idxd_dmbins ( const int  X)

Get indexed double precision reference bins.

returns a pointer to the bins corresponding to the given index

Parameters
Xindex
Returns
pointer to constant double precision bins of index X
Author
Peter Ahrens
Hong Diep Nguyen
Date
19 Jun 2015
void idxd_dmdadd ( const int  fold,
const double  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add double precision to manually specified indexed double precision (Y += X)

Performs the operation Y += X on an indexed type Y

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_dmdconv ( const int  fold,
const double  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Convert double precision to manually specified indexed double precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
30 Apr 2015
void idxd_dmddeposit ( const int  fold,
const double  X,
double *  priY,
const int  incpriY 
)

Add double precision to suitably indexed manually specified indexed double precision (Y += X)

Performs the operation Y += X on an indexed type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called idxd_dmdupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call idxd_dmddeposit() to deposit a maximum of idxd_DIENDURANCE elements into Y before renormalizing Y with idxd_dmrenorm(). After any number of successive calls of idxd_dmddeposit() on Y, you must renormalize Y with idxd_dmrenorm() before using any other function on Y.
Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
int idxd_dmdenorm ( const int  fold,
const double *  priX 
)

Check if indexed type has denormal bits.

A quick check to determine if calculations involving X cannot be performed with "denormals are zero"

Parameters
foldthe fold of the indexed type
priXX's primary vector
Returns
>0 if x has denormal bits, 0 otherwise.
Author
Peter Ahrens
Date
23 Jun 2015
void idxd_dmdmadd ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add manually specified indexed double precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double idxd_dmdmaddsq ( const int  fold,
const double  scaleX,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
const double  scaleY,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add manually specified indexed double precision scaled sums of squares (Y += X)

Performs the operation Y += X, where X and Y represent scaled sums of squares.

Parameters
foldthe fold of the indexed types
scaleXscale of X (scaleX == idxd_dscale (Z) for some double Z)
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
scaleYscale of Y (scaleY == idxd_dscale (Z) for some double Z)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Returns
updated scale of Y
Author
Peter Ahrens
Date
1 Jun 2015
void idxd_dmdmset ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Set manually specified indexed double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_dmdrescale ( const int  fold,
const double  X,
const double  scaleY,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

rescale manually specified indexed double precision sum of squares

Rescale an indexed double precision sum of squares Y

Parameters
foldthe fold of the indexed types
XY's new scaleY (X == idxd_dscale (f) for some double f) (X >= scaleY)
scaleYY's current scaleY (scaleY == idxd_dscale (f) for some double f) (X >= scaleY)
priYY's primary vector
incpriYstride within Y's primary vector
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Peter Ahrens
Date
19 Jun 2015
void idxd_dmdupdate ( const int  fold,
const double  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Update manually specified indexed double precision with double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
5 May 2015
int idxd_dmindex ( const double *  priX)

Get index of manually specified indexed double precision.

The index of an indexed type is the bin that it corresponds to. Higher indicies correspond to smaller bins.

Parameters
priXX's primary vector
Returns
X's index
Author
Peter Ahrens
Hong Diep Nguyen
Date
23 Sep 2015
int idxd_dmindex0 ( const double *  priX)

Check if index of manually specified indexed double precision is 0.

A quick check to determine if the index is 0

Parameters
priXX's primary vector
Returns
>0 if x has index 0, 0 otherwise.
Author
Peter Ahrens
Date
19 May 2015
void idxd_dmnegate ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Negate manually specified indexed double precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_dmprint ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX 
)

Print manually specified indexed double precision.

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_dmrenorm ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Renormalize manually specified indexed double precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
23 Sep 2015
void idxd_dmsetzero ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Set manually specified indexed double precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double idxd_dscale ( const double  X)

Get a reproducible double precision scale.

For any given X, return a reproducible scaling factor Y of the form

2^(DIWIDTH * z) where z is an integer

such that

Y * 2^(-DBL_MANT_DIG - DIWIDTH - 1) < X < Y * 2\^(DIWIDTH + 2)

Parameters
Xdouble precision number to be scaled
Returns
reproducible scaling factor
Author
Peter Ahrens
Date
19 Jun 2015
float_indexed* idxd_sialloc ( const int  fold)

indexed single precision allocation

Parameters
foldthe fold of the indexed type
Returns
a freshly allocated indexed type. (free with free())
Author
Peter Ahrens
Date
27 Apr 2015
float idxd_sibound ( const int  fold,
const int  N,
const float  X,
const float  S 
)

Get indexed single precision summation error bound.

This is a bound on the absolute error of a summation using indexed types

Parameters
foldthe fold of the indexed types
Nthe number of single precision floating point summands
Xthe summand of maximum absolute value
Sthe value of the sum computed using indexed types
Returns
error bound
Author
Peter Ahrens
Date
31 Jul 2015
Author
Peter Ahrens
Hong Diep Nguyen
Date
21 May 2015
int idxd_sindex ( const float  X)

Get index of single precision.

The index of a non-indexed type is the smallest index an indexed type would need to have to sum it reproducibly. Higher indicies correspond to smaller bins.

Parameters
Xscalar X
Returns
X's index
Author
Peter Ahrens
Hong Diep Nguyen
Date
19 Jun 2015
void idxd_sinegate ( const int  fold,
float_indexed X 
)

Negate indexed single precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int idxd_sinum ( const int  fold)

indexed single precision size

Parameters
foldthe fold of the indexed type
Returns
the size (in float) of the indexed type
Author
Peter Ahrens
Date
27 Apr 2015
void idxd_siprint ( const int  fold,
const float_indexed X 
)

Print indexed single precision.

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_sirenorm ( const int  fold,
float_indexed X 
)

Renormalize indexed single precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_sisadd ( const int  fold,
const float  X,
float_indexed Y 
)

Add single precision to indexed single precision (Y += X)

Performs the operation Y += X on an indexed type Y

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_sisconv ( const int  fold,
const float  X,
float_indexed Y 
)

Convert single precision to indexed single precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_sisdeposit ( const int  fold,
const float  X,
float_indexed Y 
)

Add single precision to suitably indexed indexed single precision (Y += X)

Performs the operation Y += X on an indexed type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called idxd_sisupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call idxd_sisdeposit() to deposit a maximum of idxd_SIENDURANCE elements into Y before renormalizing Y with idxd_sirenorm(). After any number of successive calls of idxd_sisdeposit() on Y, you must renormalize Y with idxd_sirenorm() before using any other function on Y.
Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void idxd_sisetzero ( const int  fold,
float_indexed X 
)

Set indexed single precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_sisiadd ( const int  fold,
const float_indexed X,
float_indexed Y 
)

Add indexed single precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
float idxd_sisiaddsq ( const int  fold,
const float  scaleX,
const float_indexed X,
const float  scaleY,
float_indexed Y 
)

Add indexed single precision scaled sums of squares (Y += X)

Performs the operation Y += X, where X and Y represent scaled sums of squares.

Parameters
foldthe fold of the indexed types
scaleXscale of X (scaleX == idxd_sscale (Z) for some float Z)
Xindexed scalar X
scaleYscale of Y (scaleY == idxd_sscale (Z) for some float Z)
Yindexed scalar Y
Returns
updated scale of Y
Author
Peter Ahrens
Date
2 Dec 2015
void idxd_sisiaddv ( const int  fold,
const int  N,
const float_indexed X,
const int  incX,
float_indexed Y,
const int  incY 
)

Add indexed single precision vectors (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
Nvector length
Xindexed vector X
incXX vector stride (use every incX'th element)
Yindexed vector Y
incYY vector stride (use every incY'th element)
Author
Peter Ahrens
Date
25 Jun 2015
void idxd_sisiset ( const int  fold,
const float_indexed X,
float_indexed Y 
)

Set indexed single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
size_t idxd_sisize ( const int  fold)

indexed single precision size

Parameters
foldthe fold of the indexed type
Returns
the size (in bytes) of the indexed type
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_sisupdate ( const int  fold,
const float  X,
float_indexed Y 
)

Update indexed single precision with single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
const float* idxd_smbins ( const int  X)

Get indexed single precision reference bins.

returns a pointer to the bins corresponding to the given index

Parameters
Xindex
Returns
pointer to constant single precision bins of index X
Author
Peter Ahrens
Hong Diep Nguyen
Date
19 Jun 2015
int idxd_smdenorm ( const int  fold,
const float *  priX 
)

Check if indexed type has denormal bits.

A quick check to determine if calculations involving X cannot be performed with "denormals are zero"

Parameters
foldthe fold of the indexed type
priXX's primary vector
Returns
>0 if x has denormal bits, 0 otherwise.
Author
Peter Ahrens
Date
23 Jun 2015
int idxd_smindex ( const float *  priX)

Get index of manually specified indexed single precision.

The index of an indexed type is the bin that it corresponds to. Higher indicies correspond to smaller bins.

Parameters
priXX's primary vector
Returns
X's index
Author
Peter Ahrens
Hong Diep Nguyen
Date
23 Sep 2015
int idxd_smindex0 ( const float *  priX)

Check if index of manually specified indexed single precision is 0.

A quick check to determine if the index is 0

Parameters
priXX's primary vector
Returns
>0 if x has index 0, 0 otherwise.
Author
Peter Ahrens
Date
19 May 2015
void idxd_smnegate ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Negate manually specified indexed single precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_smprint ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX 
)

Print manually specified indexed single precision.

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_smrenorm ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Renormalize manually specified indexed single precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
23 Sep 2015
void idxd_smsadd ( const int  fold,
const float  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add single precision to manually specified indexed single precision (Y += X)

Performs the operation Y += X on an indexed type Y

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_smsconv ( const int  fold,
const float  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Convert single precision to manually specified indexed single precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
30 Apr 2015
void idxd_smsdeposit ( const int  fold,
const float  X,
float *  priY,
const int  incpriY 
)

Add single precision to suitably indexed manually specified indexed single precision (Y += X)

Performs the operation Y += X on an indexed type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called idxd_smsupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call idxd_smsdeposit() to deposit a maximum of idxd_SIENDURANCE elements into Y before renormalizing Y with idxd_smrenorm(). After any number of successive calls of idxd_smsdeposit() on Y, you must renormalize Y with idxd_smrenorm() before using any other function on Y.
Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void idxd_smsetzero ( const int  fold,
float *  priX,
const int  incpriX,
float *  carX,
const int  inccarX 
)

Set manually specified indexed single precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_smsmadd ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add manually specified indexed single precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
float idxd_smsmaddsq ( const int  fold,
const float  scaleX,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
const float  scaleY,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Add manually specified indexed single precision scaled sums of squares (Y += X)

Performs the operation Y += X, where X and Y represent scaled sums of squares.

Parameters
foldthe fold of the indexed types
scaleXscale of X (scaleX == idxd_sscale (Z) for some float Z)
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
scaleYscale of Y (scaleY == idxd_sscale (Z) for some double Z)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Returns
updated scale of Y
Author
Peter Ahrens
Date
1 Jun 2015
void idxd_smsmset ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Set manually specified indexed single precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_smsrescale ( const int  fold,
const float  X,
const float  scaleY,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

rescale manually specified indexed single precision sum of squares

Rescale an indexed single precision sum of squares Y

Parameters
foldthe fold of the indexed types
XY's new scaleY (X == idxd_sscale (f) for some float f) (X >= scaleY)
scaleYY's current scaleY (scaleY == idxd_sscale (f) for some float f) (X >= scaleY)
priYY's primary vector
incpriYstride within Y's primary vector
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Peter Ahrens
Date
1 Jun 2015
void idxd_smsupdate ( const int  fold,
const float  X,
float *  priY,
const int  incpriY,
float *  carY,
const int  inccarY 
)

Update manually specified indexed single precision with single precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
5 May 2015
float idxd_sscale ( const float  X)

Get a reproducible single precision scale.

For any given X, return a reproducible scaling factor Y of the form

2^(SIWIDTH * z) where z is an integer

such that

Y * 2^(-FLT_MANT_DIG - SIWIDTH - 1) < X < Y * 2\^(SIWIDTH + 2)

Parameters
Xsingle precision number to be scaled
Returns
reproducible scaling factor
Author
Peter Ahrens
Date
19 Jun 2015
float idxd_ssiconv ( const int  fold,
const float_indexed X 
)

Convert indexed single precision to single precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Returns
scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
float idxd_ssmconv ( const int  fold,
const float *  priX,
const int  incpriX,
const float *  carX,
const int  inccarX 
)

Convert manually specified indexed single precision to single precision (X -> Y)

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Returns
scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double idxd_ufp ( double  X)

unit in the first place

This method returns just the implicit 1 in the mantissa of a double

Parameters
Xscalar X
Returns
unit in the first place
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
float idxd_ufpf ( float  X)

unit in the first place

This method returns just the implicit 1 in the mantissa of a float

Parameters
Xscalar X
Returns
unit in the first place
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
double_complex_indexed* idxd_zialloc ( const int  fold)

indexed complex double precision allocation

Parameters
foldthe fold of the indexed type
Returns
a freshly allocated indexed type. (free with free())
Author
Peter Ahrens
Date
27 Apr 2015
void idxd_zidiset ( const int  fold,
const double_indexed X,
double_complex_indexed Y 
)

Set indexed complex double precision to indexed double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zidupdate ( const int  fold,
const double  X,
double_complex_indexed Y 
)

Update indexed complex double precision with double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zinegate ( const int  fold,
double_complex_indexed X 
)

Negate indexed complex double precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int idxd_zinum ( const int  fold)

indexed complex double precision size

Parameters
foldthe fold of the indexed type
Returns
the size (in double) of the indexed type
Author
Peter Ahrens
Date
27 Apr 2015
void idxd_ziprint ( const int  fold,
const double_complex_indexed X 
)

Print indexed complex double precision.

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zirenorm ( const int  fold,
double_complex_indexed X 
)

Renormalize indexed complex double precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zisetzero ( const int  fold,
double_complex_indexed X 
)

Set indexed double precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
size_t idxd_zisize ( const int  fold)

indexed complex double precision size

Parameters
foldthe fold of the indexed type
Returns
the size (in bytes) of the indexed type
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zizadd ( const int  fold,
const void *  X,
double_complex_indexed Y 
)

Add complex double precision to indexed complex double precision (Y += X)

Performs the operation Y += X on an indexed type Y

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zizconv ( const int  fold,
const void *  X,
double_complex_indexed Y 
)

Convert complex double precision to indexed complex double precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zizdeposit ( const int  fold,
const void *  X,
double_complex_indexed Y 
)

Add complex double precision to suitably indexed indexed complex double precision (Y += X)

Performs the operation Y += X on an indexed type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called idxd_zizupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call idxd_zizdeposit() to deposit a maximum of idxd_DIENDURANCE elements into Y before renormalizing Y with idxd_zirenorm(). After any number of successive calls of idxd_zizdeposit() on Y, you must renormalize Y with idxd_zirenorm() before using any other function on Y.
Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void idxd_ziziadd ( const int  fold,
const double_complex_indexed X,
double_complex_indexed Y 
)

Add indexed complex double precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_ziziaddv ( const int  fold,
const int  N,
const double_complex_indexed X,
const int  incX,
double_complex_indexed Y,
const int  incY 
)

Add indexed complex double precision vectors (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
Nvector length
Xindexed vector X
incXX vector stride (use every incX'th element)
Yindexed vector Y
incYY vector stride (use every incY'th element)
Author
Peter Ahrens
Date
25 Jun 2015
void idxd_ziziset ( const int  fold,
const double_complex_indexed X,
double_complex_indexed Y 
)

Set indexed complex double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
Xindexed scalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zizupdate ( const int  fold,
const void *  X,
double_complex_indexed Y 
)

Update indexed complex double precision with complex double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value of real and imaginary components less than absolute value of real and imaginary components of X respectively.

Parameters
foldthe fold of the indexed types
Xscalar X
Yindexed scalar Y
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
int idxd_zmdenorm ( const int  fold,
const double *  priX 
)

Check if indexed type has denormal bits.

A quick check to determine if calculations involving X cannot be performed with "denormals are zero"

Parameters
foldthe fold of the indexed type
priXX's primary vector
Returns
>0 if x has denormal bits, 0 otherwise.
Author
Peter Ahrens
Date
23 Jun 2015
void idxd_zmdmset ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Set manually specified indexed complex double precision to manually specified indexed double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmdrescale ( const int  fold,
const double  X,
const double  scaleY,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

rescale manually specified indexed complex double precision sum of squares

Rescale an indexed complex double precision sum of squares Y

Parameters
foldthe fold of the indexed types
XY's new scaleY (X == idxd_dscale (f) for some double f) (X >= scaleY)
scaleYY's current scaleY (scaleY == idxd_dscale (f) for some double f) (X >= scaleY)
priYY's primary vector
incpriYstride within Y's primary vector
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Peter Ahrens
Date
1 Jun 2015
void idxd_zmdupdate ( const int  fold,
const double  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Update manually specified indexed complex double precision with double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value less than X

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmnegate ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Negate manually specified indexed complex double precision (X = -X)

Performs the operation X = -X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmprint ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX 
)

Print manually specified indexed complex double precision.

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmrenorm ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Renormalize manually specified indexed complex double precision.

Renormalization keeps the primary vector within the necessary bins by shifting over to the carry vector

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmsetzero ( const int  fold,
double *  priX,
const int  incpriX,
double *  carX,
const int  inccarX 
)

Set manually specified indexed complex double precision to 0 (X = 0)

Performs the operation X = 0

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmzadd ( const int  fold,
const void *  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add complex double precision to manually specified indexed complex double precision (Y += X)

Performs the operation Y += X on an indexed type Y

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmzconv ( const int  fold,
const void *  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Convert complex double precision to manually specified indexed complex double precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmzdeposit ( const int  fold,
const void *  X,
double *  priY,
const int  incpriY 
)

Add complex double precision to suitably indexed manually specified indexed complex double precision (Y += X)

Performs the operation Y += X on an indexed type Y where the index of Y is larger than the index of X

Note
This routine was provided as a means of allowing the you to optimize your code. After you have called idxd_zmzupdate() on Y with the maximum absolute value of all future elements you wish to deposit in Y, you can call idxd_zmzdeposit() to deposit a maximum of idxd_DIENDURANCE elements into Y before renormalizing Y with idxd_zmrenorm(). After any number of successive calls of idxd_zmzdeposit() on Y, you must renormalize Y with idxd_zmrenorm() before using any other function on Y.
Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
10 Jun 2015
void idxd_zmzmadd ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Add manually specified indexed complex double precision (Y += X)

Performs the operation Y += X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmzmset ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Set manually specified indexed complex double precision (Y = X)

Performs the operation Y = X

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zmzupdate ( const int  fold,
const void *  X,
double *  priY,
const int  incpriY,
double *  carY,
const int  inccarY 
)

Update manually specified indexed complex double precision with complex double precision (X -> Y)

This method updates Y to an index suitable for adding numbers with absolute value of real and imaginary components less than absolute value of real and imaginary components of X respectively.

Parameters
foldthe fold of the indexed types
Xscalar X
priYY's primary vector
incpriYstride within Y's primary vector (use every incpriY'th element)
carYY's carry vector
inccarYstride within Y's carry vector (use every inccarY'th element)
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zziconv_sub ( const int  fold,
const double_complex_indexed X,
void *  conv 
)

Convert indexed complex double precision to complex double precision (X -> Y)

Parameters
foldthe fold of the indexed types
Xindexed scalar X
convscalar return
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015
void idxd_zzmconv_sub ( const int  fold,
const double *  priX,
const int  incpriX,
const double *  carX,
const int  inccarX,
void *  conv 
)

Convert manually specified indexed complex double precision to complex double precision (X -> Y)

Parameters
foldthe fold of the indexed types
priXX's primary vector
incpriXstride within X's primary vector (use every incpriX'th element)
carXX's carry vector
inccarXstride within X's carry vector (use every inccarX'th element)
convscalar return
Author
Hong Diep Nguyen
Peter Ahrens
Date
27 Apr 2015