CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
QhullSet.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (c) 2008-2015 C.B. Barber. All rights reserved.
4 ** $Id: //main/2015/qhull/src/libqhullcpp/QhullSet.cpp#1 $$Change: 1981 $
5 ** $DateTime: 2015/09/28 20:26:32 $$Author: bbarber $
6 **
7 ****************************************************************************/
8 
9 #
10 
11 #include "Qhull.h"
12 #include "QhullError.h"
13 #include "QhullSet.h"
14 
15 #ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4
16 #endif
17 
18 namespace orgQhull {
19 
20 #
21 
22 setT QhullSetBase::
23 s_empty_set;
24 
25 #
26 
27 QhullSetBase::
28 QhullSetBase(const Qhull &q, setT *s)
29 : qh_set(s ? s : &s_empty_set)
30 , qh_qh(q.qh())
31 {
32 }
33 
34 #
35 
36 // Same code for qh_setsize [qset_r.c] and QhullSetBase::count [static]
37 countT QhullSetBase::
38 count(const setT *set)
39 {
40  countT size;
41  const setelemT *sizep;
42 
43  if (!set){
44  return(0);
45  }
46  sizep= SETsizeaddr_(set);
47  if ((size= sizep->i)) {
48  size--;
49  if (size > set->maxsize) {
50  // FIXUP QH11022 How to add additional output to a error? -- qh_setprint(qhmem.ferr, "set: ", set);
51  throw QhullError(10032, "QhullSet internal error: current set size %d is greater than maximum size %d\n",
52  size, set->maxsize);
53  }
54  }else{
55  size= set->maxsize;
56  }
57  return size;
58 }//count
59 
60 }//namespace orgQhull
61 
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:20
ProjectSettings & set
Definition: settings.cc:103