DelaunayHelpers.h File Reference

#include <vector>
#include <topology/SimplicialHelpers.h>

Go to the source code of this file.

Namespaces

namespace  Delaunay

Defines

#define printTuple(out, f, d, tup, id)

Functions

template<class Del>
void Delaunay::printToEPS (const Del *del, FILE *out)
template<class Point>
void Delaunay::printPoint (unsigned long id, const Point &p, FILE *out)
template<class IntVect>
void Delaunay::printEle (unsigned long id, const IntVect &v, FILE *out)
template<class Vertex>
void Delaunay::printToNode (const std::vector< Vertex * > &verts, FILE *out)
template<class Del>
void Delaunay::printToNode (const Del *del, FILE *out)
template<class Del>
void Delaunay::printToNodeEle (const Del *del, FILE *node, FILE *ele)


Define Documentation

#define printTuple out,
f,
d,
tup,
id   ) 
 

Value:

do { \
  switch(d) { \
    case 0: \
      fprintf(out, "%lu\n", id); \
      break; \
    case 1: \
      fprintf(out, "%lu "f"\n", id, tup[0]); \
      break; \
    case 2: \
      fprintf(out, "%lu "f" "f"\n", id, tup[0], tup[1]); \
      break; \
    case 3: \
      fprintf(out, "%lu "f" "f" "f"\n", id, tup[0], tup[1], tup[2]); \
      break; \
    case 4: \
      fprintf(out, "%lu "f" "f" "f" "f"\n", id, tup[0], tup[1], tup[2], tup[3]); \
      break; \
    default: \
      /* There must be at least 5, so print them out (no newline). */ \
      fprintf(out, "%lu "f" "f" "f" "f" "f, id, \
          tup[0], tup[1], tup[2], tup[3], tup[4]); \
      /* Excrutiatingly slowly print out the remainder. */ \
      for(size_t j = 4; j < d; ++j) { \
        fprintf(out, " "f, tup[j]); \
      } \
      fputs("\n", out); \
  } \
} while(0)
Print a tuple of a few items. fprintf is much faster if you can call it with everything you need; here, we have code for 0..4 items, and we write out the loop if we need more. We could unroll the loop a bit more, but that's more trouble than it's currently worth since I only ever print 4-tuples (3-simplices).


Generated on Thu Mar 27 19:04:15 2008 by  doxygen 1.4.6