#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | Vec_Flt_t_ |
Defines | |
#define | Vec_FltForEachEntry(vVec, Entry, i) for ( i = 0; (i < Vec_FltSize(vVec)) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ ) |
#define | Vec_FltForEachEntryStart(vVec, Entry, i, Start) for ( i = Start; (i < Vec_FltSize(vVec)) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ ) |
#define | Vec_FltForEachEntryStartStop(vVec, Entry, i, Start, Stop) for ( i = Start; (i < Stop) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ ) |
#define | Vec_FltForEachEntryReverse(vVec, pEntry, i) for ( i = Vec_FltSize(vVec) - 1; (i >= 0) && (((pEntry) = Vec_FltEntry(vVec, i)), 1); i-- ) |
Typedefs | |
typedef struct Vec_Flt_t_ | Vec_Flt_t |
Functions | |
static Vec_Flt_t * | Vec_FltAlloc (int nCap) |
static Vec_Flt_t * | Vec_FltStart (int nSize) |
static Vec_Flt_t * | Vec_FltAllocArray (float *pArray, int nSize) |
static Vec_Flt_t * | Vec_FltAllocArrayCopy (float *pArray, int nSize) |
static Vec_Flt_t * | Vec_FltDup (Vec_Flt_t *pVec) |
static Vec_Flt_t * | Vec_FltDupArray (Vec_Flt_t *pVec) |
static void | Vec_FltFree (Vec_Flt_t *p) |
static float * | Vec_FltReleaseArray (Vec_Flt_t *p) |
static float * | Vec_FltArray (Vec_Flt_t *p) |
static int | Vec_FltSize (Vec_Flt_t *p) |
static float | Vec_FltEntry (Vec_Flt_t *p, int i) |
static void | Vec_FltWriteEntry (Vec_Flt_t *p, int i, float Entry) |
static void | Vec_FltAddToEntry (Vec_Flt_t *p, int i, float Addition) |
static float | Vec_FltEntryLast (Vec_Flt_t *p) |
static void | Vec_FltGrow (Vec_Flt_t *p, int nCapMin) |
static void | Vec_FltFill (Vec_Flt_t *p, int nSize, float Entry) |
static void | Vec_FltFillExtra (Vec_Flt_t *p, int nSize, float Entry) |
static void | Vec_FltShrink (Vec_Flt_t *p, int nSizeNew) |
static void | Vec_FltClear (Vec_Flt_t *p) |
static void | Vec_FltPush (Vec_Flt_t *p, float Entry) |
static void | Vec_FltPushOrder (Vec_Flt_t *p, float Entry) |
static int | Vec_FltPushUnique (Vec_Flt_t *p, float Entry) |
static float | Vec_FltPop (Vec_Flt_t *p) |
static int | Vec_FltFind (Vec_Flt_t *p, float Entry) |
static int | Vec_FltRemove (Vec_Flt_t *p, float Entry) |
static int | Vec_FltSortCompare1 (float *pp1, float *pp2) |
static int | Vec_FltSortCompare2 (float *pp1, float *pp2) |
static void | Vec_FltSort (Vec_Flt_t *p, int fReverse) |
#define Vec_FltForEachEntry | ( | vVec, | |||
Entry, | |||||
i | ) | for ( i = 0; (i < Vec_FltSize(vVec)) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ ) |
#define Vec_FltForEachEntryReverse | ( | vVec, | |||
pEntry, | |||||
i | ) | for ( i = Vec_FltSize(vVec) - 1; (i >= 0) && (((pEntry) = Vec_FltEntry(vVec, i)), 1); i-- ) |
#define Vec_FltForEachEntryStart | ( | vVec, | |||
Entry, | |||||
i, | |||||
Start | ) | for ( i = Start; (i < Vec_FltSize(vVec)) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ ) |
#define Vec_FltForEachEntryStartStop | ( | vVec, | |||
Entry, | |||||
i, | |||||
Start, | |||||
Stop | ) | for ( i = Start; (i < Stop) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ ) |
typedef struct Vec_Flt_t_ Vec_Flt_t |
CFile****************************************************************
FileName [vecFlt.h]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Resizable arrays.]
Synopsis [Resizable arrays of floats.]
Author [Aaron P. Hurst]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [
] INCLUDES /// PARAMETERS /// BASIC TYPES ///
static void Vec_FltAddToEntry | ( | Vec_Flt_t * | p, | |
int | i, | |||
float | Addition | |||
) | [inline, static] |
static Vec_Flt_t* Vec_FltAlloc | ( | int | nCap | ) | [inline, static] |
FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Allocates a vector with the given capacity.]
Description []
SideEffects []
SeeAlso []
static Vec_Flt_t* Vec_FltAllocArray | ( | float * | pArray, | |
int | nSize | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Creates the vector from a float array of the given size.]
Description []
SideEffects []
SeeAlso []
static Vec_Flt_t* Vec_FltAllocArrayCopy | ( | float * | pArray, | |
int | nSize | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Creates the vector from a float array of the given size.]
Description []
SideEffects []
SeeAlso []
static float* Vec_FltArray | ( | Vec_Flt_t * | p | ) | [inline, static] |
static void Vec_FltClear | ( | Vec_Flt_t * | p | ) | [inline, static] |
Function*************************************************************
Synopsis [Duplicates the float array.]
Description []
SideEffects []
SeeAlso []
Function*************************************************************
Synopsis [Transfers the array into another vector.]
Description []
SideEffects []
SeeAlso []
static float Vec_FltEntry | ( | Vec_Flt_t * | p, | |
int | i | |||
) | [inline, static] |
static float Vec_FltEntryLast | ( | Vec_Flt_t * | p | ) | [inline, static] |
static void Vec_FltFill | ( | Vec_Flt_t * | p, | |
int | nSize, | |||
float | Entry | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Fills the vector with given number of entries.]
Description []
SideEffects []
SeeAlso []
Definition at line 361 of file vecFlt.h.
00362 { 00363 int i; 00364 Vec_FltGrow( p, nSize ); 00365 for ( i = 0; i < nSize; i++ ) 00366 p->pArray[i] = Entry; 00367 p->nSize = nSize; 00368 }
static void Vec_FltFillExtra | ( | Vec_Flt_t * | p, | |
int | nSize, | |||
float | Entry | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Fills the vector with given number of entries.]
Description []
SideEffects []
SeeAlso []
Definition at line 381 of file vecFlt.h.
00382 { 00383 int i; 00384 if ( p->nSize >= nSize ) 00385 return; 00386 Vec_FltGrow( p, nSize ); 00387 for ( i = p->nSize; i < nSize; i++ ) 00388 p->pArray[i] = Entry; 00389 p->nSize = nSize; 00390 }
static int Vec_FltFind | ( | Vec_Flt_t * | p, | |
float | Entry | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Find entry.]
Description []
SideEffects []
SeeAlso []
static void Vec_FltFree | ( | Vec_Flt_t * | p | ) | [inline, static] |
static void Vec_FltGrow | ( | Vec_Flt_t * | p, | |
int | nCapMin | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Resizes the vector to the given capacity.]
Description []
SideEffects []
SeeAlso []
static float Vec_FltPop | ( | Vec_Flt_t * | p | ) | [inline, static] |
static void Vec_FltPush | ( | Vec_Flt_t * | p, | |
float | Entry | |||
) | [inline, static] |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 436 of file vecFlt.h.
00437 { 00438 if ( p->nSize == p->nCap ) 00439 { 00440 if ( p->nCap < 16 ) 00441 Vec_FltGrow( p, 16 ); 00442 else 00443 Vec_FltGrow( p, 2 * p->nCap ); 00444 } 00445 p->pArray[p->nSize++] = Entry; 00446 }
static void Vec_FltPushOrder | ( | Vec_Flt_t * | p, | |
float | Entry | |||
) | [inline, static] |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 459 of file vecFlt.h.
00460 { 00461 int i; 00462 if ( p->nSize == p->nCap ) 00463 { 00464 if ( p->nCap < 16 ) 00465 Vec_FltGrow( p, 16 ); 00466 else 00467 Vec_FltGrow( p, 2 * p->nCap ); 00468 } 00469 p->nSize++; 00470 for ( i = p->nSize-2; i >= 0; i-- ) 00471 if ( p->pArray[i] > Entry ) 00472 p->pArray[i+1] = p->pArray[i]; 00473 else 00474 break; 00475 p->pArray[i+1] = Entry; 00476 }
static int Vec_FltPushUnique | ( | Vec_Flt_t * | p, | |
float | Entry | |||
) | [inline, static] |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 489 of file vecFlt.h.
00490 { 00491 int i; 00492 for ( i = 0; i < p->nSize; i++ ) 00493 if ( p->pArray[i] == Entry ) 00494 return 1; 00495 Vec_FltPush( p, Entry ); 00496 return 0; 00497 }
static float* Vec_FltReleaseArray | ( | Vec_Flt_t * | p | ) | [inline, static] |
static int Vec_FltRemove | ( | Vec_Flt_t * | p, | |
float | Entry | |||
) | [inline, static] |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
static void Vec_FltShrink | ( | Vec_Flt_t * | p, | |
int | nSizeNew | |||
) | [inline, static] |
static int Vec_FltSize | ( | Vec_Flt_t * | p | ) | [inline, static] |
static void Vec_FltSort | ( | Vec_Flt_t * | p, | |
int | fReverse | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Sorting the entries by their value.]
Description []
SideEffects []
SeeAlso []
Definition at line 615 of file vecFlt.h.
00616 { 00617 if ( fReverse ) 00618 qsort( (void *)p->pArray, p->nSize, sizeof(float), 00619 (int (*)(const void *, const void *)) Vec_FltSortCompare2 ); 00620 else 00621 qsort( (void *)p->pArray, p->nSize, sizeof(float), 00622 (int (*)(const void *, const void *)) Vec_FltSortCompare1 ); 00623 }
static int Vec_FltSortCompare1 | ( | float * | pp1, | |
float * | pp2 | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Comparison procedure for two floats.]
Description []
SideEffects []
SeeAlso []
static int Vec_FltSortCompare2 | ( | float * | pp1, | |
float * | pp2 | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Comparison procedure for two floats.]
Description []
SideEffects []
SeeAlso []
static Vec_Flt_t* Vec_FltStart | ( | int | nSize | ) | [inline, static] |
Function*************************************************************
Synopsis [Allocates a vector with the given size and cleans it.]
Description []
SideEffects []
SeeAlso []
Definition at line 97 of file vecFlt.h.
00098 { 00099 Vec_Flt_t * p; 00100 p = Vec_FltAlloc( nSize ); 00101 p->nSize = nSize; 00102 memset( p->pArray, 0, sizeof(float) * nSize ); 00103 return p; 00104 }
static void Vec_FltWriteEntry | ( | Vec_Flt_t * | p, | |
int | i, | |||
float | Entry | |||
) | [inline, static] |