summaryrefslogtreecommitdiffstats
path: root/src/misc/vec
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-03-01 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2008-03-01 08:01:00 -0800
commit320c429bc46728c1faddfc561c166810aa134a04 (patch)
treec773cc96431cd38ae35484dae7d7d17a79671ac2 /src/misc/vec
parentf65983c2c0810cfb933f696952325a81d2378987 (diff)
downloadabc-320c429bc46728c1faddfc561c166810aa134a04.tar.gz
abc-320c429bc46728c1faddfc561c166810aa134a04.tar.bz2
abc-320c429bc46728c1faddfc561c166810aa134a04.zip
Version abc80301
Diffstat (limited to 'src/misc/vec')
-rw-r--r--src/misc/vec/vec.h5
-rw-r--r--src/misc/vec/vecVec.h42
2 files changed, 45 insertions, 2 deletions
diff --git a/src/misc/vec/vec.h b/src/misc/vec/vec.h
index a4bd4771..4091ac7f 100644
--- a/src/misc/vec/vec.h
+++ b/src/misc/vec/vec.h
@@ -83,11 +83,11 @@ typedef long long sint64;
#endif
#ifndef PRT
-#define PRT(a,t) printf("%s = ", (a)); printf("%6.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC))
+#define PRT(a,t) printf("%s = ", (a)); printf("%7.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC))
#endif
#ifndef PRTP
-#define PRTP(a,t,T) printf("%s = ", (a)); printf("%6.2f sec (%6.2f %%)\n", (float)(t)/(float)(CLOCKS_PER_SEC), (T)? 100.0*(t)/(T) : 0.0)
+#define PRTP(a,t,T) printf("%s = ", (a)); printf("%7.2f sec (%6.2f %%)\n", (float)(t)/(float)(CLOCKS_PER_SEC), (T)? 100.0*(t)/(T) : 0.0)
#endif
#include "vecInt.h"
@@ -96,6 +96,7 @@ typedef long long sint64;
#include "vecPtr.h"
#include "vecVec.h"
#include "vecAtt.h"
+#include "port_type.h"
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
diff --git a/src/misc/vec/vecVec.h b/src/misc/vec/vecVec.h
index 55ffdf4f..13880c21 100644
--- a/src/misc/vec/vecVec.h
+++ b/src/misc/vec/vecVec.h
@@ -207,6 +207,48 @@ static inline void Vec_VecFree( Vec_Vec_t * p )
/**Function*************************************************************
+ Synopsis [Frees the vector.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline Vec_Vec_t * Vec_VecDupPtr( Vec_Vec_t * p )
+{
+ Vec_Ptr_t * vNew, * vVec;
+ int i;
+ vNew = Vec_PtrAlloc( Vec_VecSize(p) );
+ Vec_VecForEachLevel( p, vVec, i )
+ Vec_PtrPush( vNew, Vec_PtrDup(vVec) );
+ return (Vec_Vec_t *)vNew;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Frees the vector.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline Vec_Vec_t * Vec_VecDupInt( Vec_Vec_t * p )
+{
+ Vec_Ptr_t * vNew, * vVec;
+ int i;
+ vNew = Vec_PtrAlloc( Vec_VecSize(p) );
+ Vec_VecForEachLevel( p, vVec, i )
+ Vec_PtrPush( vNew, Vec_IntDup((Vec_Int_t *)vVec) );
+ return (Vec_Vec_t *)vNew;
+}
+
+/**Function*************************************************************
+
Synopsis [Frees the vector of vectors.]
Description []