summaryrefslogtreecommitdiffstats
path: root/src/misc/vec/vecQue.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-05-05 09:04:14 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-05-05 09:04:14 -0700
commiteacfad762271794965d428cacd1ce56fbc575f93 (patch)
treed4f004b991b412bce177d4637a8322bd26a1f9cd /src/misc/vec/vecQue.h
parent7d3301584a82b06e9c6a887e02554bc6a14bec5e (diff)
downloadabc-eacfad762271794965d428cacd1ce56fbc575f93.tar.gz
abc-eacfad762271794965d428cacd1ce56fbc575f93.tar.bz2
abc-eacfad762271794965d428cacd1ce56fbc575f93.zip
Changing the queue to work in the same the array of costs is realloced.
Diffstat (limited to 'src/misc/vec/vecQue.h')
-rw-r--r--src/misc/vec/vecQue.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/misc/vec/vecQue.h b/src/misc/vec/vecQue.h
index 445c6fb3..18b8bc10 100644
--- a/src/misc/vec/vecQue.h
+++ b/src/misc/vec/vecQue.h
@@ -44,10 +44,10 @@ struct Vec_Que_t_
int nSize;
int * pHeap;
int * pOrder;
- float * pCostsFlt; // owned by the caller
+ float ** pCostsFlt; // owned by the caller
};
-static inline float Vec_QueCost( Vec_Que_t * p, int v ) { return p->pCostsFlt ? p->pCostsFlt[v] : v; }
+static inline float Vec_QueCost( Vec_Que_t * p, int v ) { return *p->pCostsFlt ? (*p->pCostsFlt)[v] : v; }
////////////////////////////////////////////////////////////////////////
/// MACRO DEFINITIONS ///
@@ -92,9 +92,9 @@ static inline void Vec_QueFreeP( Vec_Que_t ** p )
Vec_QueFree( *p );
*p = NULL;
}
-static inline void Vec_QueSetCosts( Vec_Que_t * p, float * pCosts )
+static inline void Vec_QueSetCosts( Vec_Que_t * p, float ** pCosts )
{
-// assert( p->pCostsFlt == NULL );
+ assert( p->pCostsFlt == NULL );
p->pCostsFlt = pCosts;
}
static inline void Vec_QueGrow( Vec_Que_t * p, int nCapMin )
@@ -333,7 +333,7 @@ static inline void Vec_QueTest( Vec_Flt_t * vCosts )
// start the queue
p = Vec_QueAlloc( Vec_FltSize(vCosts) );
- Vec_QueSetCosts( p, Vec_FltArray(vCosts) );
+ Vec_QueSetCosts( p, Vec_FltArrayP(vCosts) );
for ( i = 0; i < Vec_FltSize(vCosts); i++ )
Vec_QuePush( p, i );
// Vec_QuePrint( p );