1 // Voro++, a 3D cell-based Voronoi library
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : May 18th 2011
8 * \brief Implementations of the small helper functions. */
12 /** \brief Prints a vector of integers.
14 * Prints a vector of integers.
15 * \param[in] v the vector to print.
16 * \param[in] fp the file stream to print to. */
17 void voropp_print_vector(vector
<int> &v
,FILE *fp
) {
20 fprintf(fp
,"%d %d %d %d ",v
[k
],v
[k
+1],v
[k
+2],v
[k
+3]);
24 if(k
+4==s
) fprintf(fp
,"%d %d %d %d",v
[k
],v
[k
+1],v
[k
+2],v
[k
+3]);
25 else fprintf(fp
,"%d %d %d",v
[k
],v
[k
+1],v
[k
+2]);
27 if(k
+2==s
) fprintf(fp
,"%d %d",v
[k
],v
[k
+1]);
28 else fprintf(fp
,"%d",v
[k
]);
32 /** \brief Prints a vector of doubles.
34 * Prints a vector of doubles.
35 * \param[in] v the vector to print.
36 * \param[in] fp the file stream to print to. */
37 void voropp_print_vector(vector
<double> &v
,FILE *fp
) {
40 fprintf(fp
,"%g %g %g %g ",v
[k
],v
[k
+1],v
[k
+2],v
[k
+3]);
44 if(k
+4==s
) fprintf(fp
,"%g %g %g %g",v
[k
],v
[k
+1],v
[k
+2],v
[k
+3]);
45 else fprintf(fp
,"%g %g %g",v
[k
],v
[k
+1],v
[k
+2]);
47 if(k
+2==s
) fprintf(fp
,"%g %g",v
[k
],v
[k
+1]);
48 else fprintf(fp
,"%g",v
[k
]);