abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vecFlt.h File Reference
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  Vec_Flt_t_
 

Macros

#define Vec_FltForEachEntry(vVec, Entry, i)   for ( i = 0; (i < Vec_FltSize(vVec)) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ )
 MACRO DEFINITIONS ///. More...
 
#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
typedefABC_NAMESPACE_HEADER_START
struct Vec_Flt_t_ 
Vec_Flt_t
 INCLUDES ///. More...
 

Functions

static Vec_Flt_tVec_FltAlloc (int nCap)
 FUNCTION DEFINITIONS ///. More...
 
static Vec_Flt_tVec_FltStart (int nSize)
 
static Vec_Flt_tVec_FltStartFull (int nSize)
 
static Vec_Flt_tVec_FltAllocArray (float *pArray, int nSize)
 
static Vec_Flt_tVec_FltAllocArrayCopy (float *pArray, int nSize)
 
static Vec_Flt_tVec_FltDup (Vec_Flt_t *pVec)
 
static Vec_Flt_tVec_FltDupArray (Vec_Flt_t *pVec)
 
static void Vec_FltFree (Vec_Flt_t *p)
 
static void Vec_FltFreeP (Vec_Flt_t **p)
 
static float * Vec_FltReleaseArray (Vec_Flt_t *p)
 
static float * Vec_FltArray (Vec_Flt_t *p)
 
static float ** Vec_FltArrayP (Vec_Flt_t *p)
 
static int Vec_FltSize (Vec_Flt_t *p)
 
static int Vec_FltCap (Vec_Flt_t *p)
 
static double Vec_FltMemory (Vec_Flt_t *p)
 
static float Vec_FltEntry (Vec_Flt_t *p, int i)
 
static float * Vec_FltEntryP (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 void Vec_FltUpdateEntry (Vec_Flt_t *p, int i, float Value)
 
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 Fill)
 
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 float Vec_FltFindMax (Vec_Flt_t *p)
 
static float Vec_FltFindMin (Vec_Flt_t *p)
 
static int Vec_FltEqual (Vec_Flt_t *p1, Vec_Flt_t *p2)
 
static void Vec_FltPrint (Vec_Flt_t *vVec)
 
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)
 

Macro Definition Documentation

#define Vec_FltForEachEntry (   vVec,
  Entry,
 
)    for ( i = 0; (i < Vec_FltSize(vVec)) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ )

MACRO DEFINITIONS ///.

Definition at line 54 of file vecFlt.h.

#define Vec_FltForEachEntryReverse (   vVec,
  pEntry,
 
)    for ( i = Vec_FltSize(vVec) - 1; (i >= 0) && (((pEntry) = Vec_FltEntry(vVec, i)), 1); i-- )

Definition at line 60 of file vecFlt.h.

#define Vec_FltForEachEntryStart (   vVec,
  Entry,
  i,
  Start 
)    for ( i = Start; (i < Vec_FltSize(vVec)) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ )

Definition at line 56 of file vecFlt.h.

#define Vec_FltForEachEntryStartStop (   vVec,
  Entry,
  i,
  Start,
  Stop 
)    for ( i = Start; (i < Stop) && (((Entry) = Vec_FltEntry(vVec, i)), 1); i++ )

Definition at line 58 of file vecFlt.h.

Typedef Documentation

typedef typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t

INCLUDES ///.

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 [

Id:
vecInt.h,v 1.00 2005/06/20 00:00:00 alanmi Exp

]PARAMETERS ///BASIC TYPES ///

Definition at line 42 of file vecFlt.h.

Function Documentation

static void Vec_FltAddToEntry ( Vec_Flt_t p,
int  i,
float  Addition 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 381 of file vecFlt.h.

382 {
383  assert( i >= 0 && i < p->nSize );
384  p->pArray[i] += Addition;
385 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static Vec_Flt_t* Vec_FltAlloc ( int  nCap)
inlinestatic

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Allocates a vector with the given capacity.]

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file vecFlt.h.

79 {
80  Vec_Flt_t * p;
81  p = ABC_ALLOC( Vec_Flt_t, 1 );
82  if ( nCap > 0 && nCap < 16 )
83  nCap = 16;
84  p->nSize = 0;
85  p->nCap = nCap;
86  p->pArray = p->nCap? ABC_ALLOC( float, p->nCap ) : NULL;
87  return p;
88 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
static Vec_Flt_t* Vec_FltAllocArray ( float *  pArray,
int  nSize 
)
inlinestatic

Function*************************************************************

Synopsis [Creates the vector from a float array of the given size.]

Description []

SideEffects []

SeeAlso []

Definition at line 129 of file vecFlt.h.

130 {
131  Vec_Flt_t * p;
132  p = ABC_ALLOC( Vec_Flt_t, 1 );
133  p->nSize = nSize;
134  p->nCap = nSize;
135  p->pArray = pArray;
136  return p;
137 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
static Vec_Flt_t* Vec_FltAllocArrayCopy ( float *  pArray,
int  nSize 
)
inlinestatic

Function*************************************************************

Synopsis [Creates the vector from a float array of the given size.]

Description []

SideEffects []

SeeAlso []

Definition at line 150 of file vecFlt.h.

151 {
152  Vec_Flt_t * p;
153  p = ABC_ALLOC( Vec_Flt_t, 1 );
154  p->nSize = nSize;
155  p->nCap = nSize;
156  p->pArray = ABC_ALLOC( float, nSize );
157  memcpy( p->pArray, pArray, sizeof(float) * nSize );
158  return p;
159 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
char * memcpy()
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
static float* Vec_FltArray ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 274 of file vecFlt.h.

275 {
276  return p->pArray;
277 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static float** Vec_FltArrayP ( Vec_Flt_t p)
inlinestatic

Definition at line 278 of file vecFlt.h.

279 {
280  return &p->pArray;
281 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_FltCap ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 310 of file vecFlt.h.

311 {
312  return p->nCap;
313 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_FltClear ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 512 of file vecFlt.h.

513 {
514  p->nSize = 0;
515 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Flt_t* Vec_FltDup ( Vec_Flt_t pVec)
inlinestatic

Function*************************************************************

Synopsis [Duplicates the float array.]

Description []

SideEffects []

SeeAlso []

Definition at line 172 of file vecFlt.h.

173 {
174  Vec_Flt_t * p;
175  p = ABC_ALLOC( Vec_Flt_t, 1 );
176  p->nSize = pVec->nSize;
177  p->nCap = pVec->nCap;
178  p->pArray = p->nCap? ABC_ALLOC( float, p->nCap ) : NULL;
179  memcpy( p->pArray, pVec->pArray, sizeof(float) * pVec->nSize );
180  return p;
181 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
char * memcpy()
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
static Vec_Flt_t* Vec_FltDupArray ( Vec_Flt_t pVec)
inlinestatic

Function*************************************************************

Synopsis [Transfers the array into another vector.]

Description []

SideEffects []

SeeAlso []

Definition at line 194 of file vecFlt.h.

195 {
196  Vec_Flt_t * p;
197  p = ABC_ALLOC( Vec_Flt_t, 1 );
198  p->nSize = pVec->nSize;
199  p->nCap = pVec->nCap;
200  p->pArray = pVec->pArray;
201  pVec->nSize = 0;
202  pVec->nCap = 0;
203  pVec->pArray = NULL;
204  return p;
205 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
static float Vec_FltEntry ( Vec_Flt_t p,
int  i 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 342 of file vecFlt.h.

343 {
344  assert( i >= 0 && i < p->nSize );
345  return p->pArray[i];
346 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static float Vec_FltEntryLast ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 415 of file vecFlt.h.

416 {
417  return p->pArray[p->nSize-1];
418 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static float* Vec_FltEntryP ( Vec_Flt_t p,
int  i 
)
inlinestatic

Definition at line 347 of file vecFlt.h.

348 {
349  assert( i >= 0 && i < p->nSize );
350  return p->pArray + i;
351 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static int Vec_FltEqual ( Vec_Flt_t p1,
Vec_Flt_t p2 
)
inlinestatic

Function*************************************************************

Synopsis [Checks if two vectors are equal.]

Description []

SideEffects []

SeeAlso []

Definition at line 701 of file vecFlt.h.

702 {
703  int i;
704  if ( p1->nSize != p2->nSize )
705  return 0;
706  for ( i = 0; i < p1->nSize; i++ )
707  if ( p1->pArray[i] != p2->pArray[i] )
708  return 0;
709  return 1;
710 }
static void Vec_FltFill ( Vec_Flt_t p,
int  nSize,
float  Entry 
)
inlinestatic

Function*************************************************************

Synopsis [Fills the vector with given number of entries.]

Description []

SideEffects []

SeeAlso []

Definition at line 450 of file vecFlt.h.

451 {
452  int i;
453  Vec_FltGrow( p, nSize );
454  for ( i = 0; i < nSize; i++ )
455  p->pArray[i] = Entry;
456  p->nSize = nSize;
457 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_FltGrow(Vec_Flt_t *p, int nCapMin)
Definition: vecFlt.h:431
static void Vec_FltFillExtra ( Vec_Flt_t p,
int  nSize,
float  Fill 
)
inlinestatic

Function*************************************************************

Synopsis [Fills the vector with given number of entries.]

Description []

SideEffects []

SeeAlso []

Definition at line 470 of file vecFlt.h.

471 {
472  int i;
473  if ( nSize <= p->nSize )
474  return;
475  if ( nSize > 2 * p->nCap )
476  Vec_FltGrow( p, nSize );
477  else if ( nSize > p->nCap )
478  Vec_FltGrow( p, 2 * p->nCap );
479  for ( i = p->nSize; i < nSize; i++ )
480  p->pArray[i] = Fill;
481  p->nSize = nSize;
482 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_FltGrow(Vec_Flt_t *p, int nCapMin)
Definition: vecFlt.h:431
static int Vec_FltFind ( Vec_Flt_t p,
float  Entry 
)
inlinestatic

Function*************************************************************

Synopsis [Find entry.]

Description []

SideEffects []

SeeAlso []

Definition at line 619 of file vecFlt.h.

620 {
621  int i;
622  for ( i = 0; i < p->nSize; i++ )
623  if ( p->pArray[i] == Entry )
624  return i;
625  return -1;
626 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static float Vec_FltFindMax ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis [Find entry.]

Description []

SideEffects []

SeeAlso []

Definition at line 665 of file vecFlt.h.

666 {
667  int i;
668  float Best;
669  if ( p->nSize == 0 )
670  return 0;
671  Best = p->pArray[0];
672  for ( i = 1; i < p->nSize; i++ )
673  if ( Best < p->pArray[i] )
674  Best = p->pArray[i];
675  return Best;
676 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static float Vec_FltFindMin ( Vec_Flt_t p)
inlinestatic

Definition at line 677 of file vecFlt.h.

678 {
679  int i;
680  float Best;
681  if ( p->nSize == 0 )
682  return 0;
683  Best = p->pArray[0];
684  for ( i = 1; i < p->nSize; i++ )
685  if ( Best > p->pArray[i] )
686  Best = p->pArray[i];
687  return Best;
688 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_FltFree ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 218 of file vecFlt.h.

219 {
220  ABC_FREE( p->pArray );
221  ABC_FREE( p );
222 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_FltFreeP ( Vec_Flt_t **  p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 235 of file vecFlt.h.

236 {
237  if ( *p == NULL )
238  return;
239  ABC_FREE( (*p)->pArray );
240  ABC_FREE( (*p) );
241 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_FltGrow ( Vec_Flt_t p,
int  nCapMin 
)
inlinestatic

Function*************************************************************

Synopsis [Resizes the vector to the given capacity.]

Description []

SideEffects []

SeeAlso []

Definition at line 431 of file vecFlt.h.

432 {
433  if ( p->nCap >= nCapMin )
434  return;
435  p->pArray = ABC_REALLOC( float, p->pArray, nCapMin );
436  p->nCap = nCapMin;
437 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_REALLOC(type, obj, num)
Definition: abc_global.h:233
static double Vec_FltMemory ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 326 of file vecFlt.h.

327 {
328  return !p ? 0.0 : 1.0 * sizeof(float) * p->nCap + sizeof(Vec_Flt_t);
329 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
static float Vec_FltPop ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis [Returns the last entry and removes it from the list.]

Description []

SideEffects []

SeeAlso []

Definition at line 602 of file vecFlt.h.

603 {
604  assert( p->nSize > 0 );
605  return p->pArray[--p->nSize];
606 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static void Vec_FltPrint ( Vec_Flt_t vVec)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 723 of file vecFlt.h.

724 {
725  int i; float Entry;
726  printf( "Vector has %d entries: {", Vec_FltSize(vVec) );
727  Vec_FltForEachEntry( vVec, Entry, i )
728  printf( " %f", Entry );
729  printf( " }\n" );
730 }
#define Vec_FltForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecFlt.h:54
static int Vec_FltSize(Vec_Flt_t *p)
Definition: vecFlt.h:294
static void Vec_FltPush ( Vec_Flt_t p,
float  Entry 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 528 of file vecFlt.h.

529 {
530  if ( p->nSize == p->nCap )
531  {
532  if ( p->nCap < 16 )
533  Vec_FltGrow( p, 16 );
534  else
535  Vec_FltGrow( p, 2 * p->nCap );
536  }
537  p->pArray[p->nSize++] = Entry;
538 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_FltGrow(Vec_Flt_t *p, int nCapMin)
Definition: vecFlt.h:431
static void Vec_FltPushOrder ( Vec_Flt_t p,
float  Entry 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 551 of file vecFlt.h.

552 {
553  int i;
554  if ( p->nSize == p->nCap )
555  {
556  if ( p->nCap < 16 )
557  Vec_FltGrow( p, 16 );
558  else
559  Vec_FltGrow( p, 2 * p->nCap );
560  }
561  p->nSize++;
562  for ( i = p->nSize-2; i >= 0; i-- )
563  if ( p->pArray[i] > Entry )
564  p->pArray[i+1] = p->pArray[i];
565  else
566  break;
567  p->pArray[i+1] = Entry;
568 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_FltGrow(Vec_Flt_t *p, int nCapMin)
Definition: vecFlt.h:431
static int Vec_FltPushUnique ( Vec_Flt_t p,
float  Entry 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 581 of file vecFlt.h.

582 {
583  int i;
584  for ( i = 0; i < p->nSize; i++ )
585  if ( p->pArray[i] == Entry )
586  return 1;
587  Vec_FltPush( p, Entry );
588  return 0;
589 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_FltPush(Vec_Flt_t *p, float Entry)
Definition: vecFlt.h:528
static float* Vec_FltReleaseArray ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 254 of file vecFlt.h.

255 {
256  float * pArray = p->pArray;
257  p->nCap = 0;
258  p->nSize = 0;
259  p->pArray = NULL;
260  return pArray;
261 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_FltRemove ( Vec_Flt_t p,
float  Entry 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 639 of file vecFlt.h.

640 {
641  int i;
642  for ( i = 0; i < p->nSize; i++ )
643  if ( p->pArray[i] == Entry )
644  break;
645  if ( i == p->nSize )
646  return 0;
647  assert( i < p->nSize );
648  for ( i++; i < p->nSize; i++ )
649  p->pArray[i-1] = p->pArray[i];
650  p->nSize--;
651  return 1;
652 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static void Vec_FltShrink ( Vec_Flt_t p,
int  nSizeNew 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 495 of file vecFlt.h.

496 {
497  assert( p->nSize >= nSizeNew );
498  p->nSize = nSizeNew;
499 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static int Vec_FltSize ( Vec_Flt_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 294 of file vecFlt.h.

295 {
296  return p->nSize;
297 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_FltSort ( Vec_Flt_t p,
int  fReverse 
)
inlinestatic

Function*************************************************************

Synopsis [Sorting the entries by their value.]

Description []

SideEffects []

SeeAlso []

Definition at line 785 of file vecFlt.h.

786 {
787  if ( fReverse )
788  qsort( (void *)p->pArray, p->nSize, sizeof(float),
789  (int (*)(const void *, const void *)) Vec_FltSortCompare2 );
790  else
791  qsort( (void *)p->pArray, p->nSize, sizeof(float),
792  (int (*)(const void *, const void *)) Vec_FltSortCompare1 );
793 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_FltSortCompare2(float *pp1, float *pp2)
Definition: vecFlt.h:764
static int Vec_FltSortCompare1(float *pp1, float *pp2)
Definition: vecFlt.h:743
static int Vec_FltSortCompare1 ( float *  pp1,
float *  pp2 
)
static

Function*************************************************************

Synopsis [Comparison procedure for two floats.]

Description []

SideEffects []

SeeAlso []

Definition at line 743 of file vecFlt.h.

744 {
745  // for some reason commenting out lines (as shown) led to crashing of the release version
746  if ( *pp1 < *pp2 )
747  return -1;
748  if ( *pp1 > *pp2 ) //
749  return 1;
750  return 0; //
751 }
static int Vec_FltSortCompare2 ( float *  pp1,
float *  pp2 
)
static

Function*************************************************************

Synopsis [Comparison procedure for two floats.]

Description []

SideEffects []

SeeAlso []

Definition at line 764 of file vecFlt.h.

765 {
766  // for some reason commenting out lines (as shown) led to crashing of the release version
767  if ( *pp1 > *pp2 )
768  return -1;
769  if ( *pp1 < *pp2 ) //
770  return 1;
771  return 0; //
772 }
static Vec_Flt_t* Vec_FltStart ( int  nSize)
inlinestatic

Function*************************************************************

Synopsis [Allocates a vector with the given size and cleans it.]

Description []

SideEffects []

SeeAlso []

Definition at line 101 of file vecFlt.h.

102 {
103  Vec_Flt_t * p;
104  p = Vec_FltAlloc( nSize );
105  p->nSize = nSize;
106  memset( p->pArray, 0, sizeof(float) * nSize );
107  return p;
108 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Flt_t * Vec_FltAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecFlt.h:78
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
static Vec_Flt_t* Vec_FltStartFull ( int  nSize)
inlinestatic

Definition at line 109 of file vecFlt.h.

110 {
111  Vec_Flt_t * p;
112  p = Vec_FltAlloc( nSize );
113  p->nSize = nSize;
114  memset( p->pArray, 0xFF, sizeof(float) * nSize );
115  return p;
116 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Flt_t * Vec_FltAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecFlt.h:78
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
Definition: vecFlt.h:42
static void Vec_FltUpdateEntry ( Vec_Flt_t p,
int  i,
float  Value 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 398 of file vecFlt.h.

399 {
400  if ( Vec_FltEntry( p, i ) < Value )
401  Vec_FltWriteEntry( p, i, Value );
402 }
static void Vec_FltWriteEntry(Vec_Flt_t *p, int i, float Entry)
Definition: vecFlt.h:364
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static float Vec_FltEntry(Vec_Flt_t *p, int i)
Definition: vecFlt.h:342
static void Vec_FltWriteEntry ( Vec_Flt_t p,
int  i,
float  Entry 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 364 of file vecFlt.h.

365 {
366  assert( i >= 0 && i < p->nSize );
367  p->pArray[i] = Entry;
368 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213