RDKit
Open-source cheminformatics and machine learning.
RDValue-doublemagic.h
Go to the documentation of this file.
1 // Copyright (c) 2015, Novartis Institutes for BioMedical Research Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following
12 // disclaimer in the documentation and/or other materials provided
13 // with the distribution.
14 // * Neither the name of Novartis Institutes for BioMedical Research Inc.
15 // nor the names of its contributors may be used to endorse or promote
16 // products derived from this software without specific prior written
17 // permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 //
31 #include <RDGeneral/export.h>
32 #ifndef RDKIT_RDVALUE_PTRMAGIC_H
33 #define RDKIT_RDVALUE_PTRMAGIC_H
34 
35 #include <cstdint>
36 #include <cassert>
37 #include <boost/any.hpp>
38 #include "Invariant.h"
39 #include <iostream>
40 #include <iomanip>
41 #include <sstream>
42 #include <vector>
43 #include <string>
45 #include <boost/utility.hpp>
46 #include <boost/lexical_cast.hpp>
47 #include <boost/type_traits.hpp>
48 #include <boost/static_assert.hpp>
50 #include <cmath>
51 #include "LocaleSwitcher.h"
52 
53 #define RDVALUE_HASBOOL
54 
55 namespace RDKit {
56 
57 // Inspired by
58 // https://nikic.github.io/2012/02/02/Pointer-magic-for-efficient-dynamic-value-representations.html
59 // 16 bit storage for value types using Quiet NaN spaces in
60 // doubles
61 // Won't work on Solaris and some other os's as mmaping maps from
62 // top memory down
63 // Example check:
64 // std::string *pointer = new std::string(v);
65 // assert((reinterpret_cast<boost::uint64_t>(pointer) & StringTag) == 0);
66 
67 // implementations, need a typedef at compile time to figure this out.
68 // current implementation is probably little endian, need to check.
69 
70 /*
71  Encoding for storing other things as a double. Use
72  Quiet NaN
73  Quiet NaN: // used to encode types
74  F F F 1XXX < - X = type bits (first bit is set to one)
75 
76  seeeeeee|eeeemmmm|mmmmmmmm|mmmmmmmm|mmmmmmmm|mmmmmmmm|mmmmmmmm|mmmmmmmm
77  s1111111|11111ppp|pppppppp|pppppppp|pppppppp|pppppppp|pppppppp|pppppppp
78  ^- first mantissa bit 1 everything else is "payload" -^
79  ^- exponent bits all 1 and mustn't be all-zero (as it
80  ^- any sign bit would be INF then)
81 
82  Available
83  8 = 1000 MaxDouble // Not really a tag, is a sentinel
84  9 = 1001 Float
85  b = 1010 Int32
86  a = 1011 Uint32
87  C = 1100 <none>
88  D = 1101 <none>
89  E = 1110 <none>
90  F = 1111 PtrTag (look at lower 3 bits for type)
91 */
92 
93 namespace RDTypeTag {
94 static const boost::uint64_t NaN = 0xfff7FFFFFFFFFFFF; // signalling NaN
95 static const boost::uint64_t MaxDouble = 0xfff8000000000000; //
96 static const boost::uint64_t DoubleTag = 0xfff8000000000000; //
97 static const boost::uint64_t FloatTag = 0xfff9000000000000; //
98 static const boost::uint64_t IntTag = 0xfffa000000000000; //
99 static const boost::uint64_t UnsignedIntTag = 0xfffb000000000000; //
100 static const boost::uint64_t BoolTag = 0xfffc000000000000; //
101 
102 // PTR Tags use the last 3 bits for typing info
103 static const boost::uint64_t PtrTag = 0xffff000000000000;
104 static const boost::uint64_t StringTag = 0xffff000000000001; // 001
105 static const boost::uint64_t VecDoubleTag = 0xffff000000000002; // 010
106 static const boost::uint64_t VecFloatTag = 0xffff000000000003; // 011
107 static const boost::uint64_t VecIntTag = 0xffff000000000004; // 100
108 static const boost::uint64_t VecUnsignedIntTag = 0xffff000000000005; // 101
109 static const boost::uint64_t VecStringTag = 0xffff000000000006; // 110
110 static const boost::uint64_t AnyTag = 0xffff000000000007; // 111
111 
112 // Retrieves the tag (and PtrMask) from the type
113 template <class T>
114 inline boost::uint64_t GetTag() {
115  return AnyTag;
116 }
117 template <>
118 inline boost::uint64_t GetTag<double>() {
119  return MaxDouble;
120 }
121 template <>
122 inline boost::uint64_t GetTag<float>() {
123  return FloatTag;
124 }
125 template <>
126 inline boost::uint64_t GetTag<int>() {
127  return IntTag;
128 }
129 template <>
130 inline boost::uint64_t GetTag<unsigned int>() {
131  return UnsignedIntTag;
132 }
133 template <>
134 inline boost::uint64_t GetTag<bool>() {
135  return BoolTag;
136 }
137 template <>
138 inline boost::uint64_t GetTag<std::string>() {
139  return StringTag;
140 }
141 template <>
142 inline boost::uint64_t GetTag<std::vector<double>>() {
143  return VecDoubleTag;
144 }
145 template <>
146 inline boost::uint64_t GetTag<std::vector<float>>() {
147  return VecFloatTag;
148 }
149 template <>
150 inline boost::uint64_t GetTag<std::vector<int>>() {
151  return VecIntTag;
152 }
153 template <>
154 inline boost::uint64_t GetTag<std::vector<unsigned int>>() {
155  return VecUnsignedIntTag;
156 }
157 template <>
158 inline boost::uint64_t GetTag<std::vector<std::string>>() {
159  return VecStringTag;
160 }
161 template <>
162 inline boost::uint64_t GetTag<boost::any>() {
163  return AnyTag;
164 }
165 } // namespace RDTypeTag
166 
167 struct RDValue {
168  // Bit Twidling for conversion from the Tag to a Pointer
169  static const boost::uint64_t TagMask = 0xFFFF000000000000;
170  static const boost::uint64_t PointerTagMask = 0xFFFF000000000007;
171  static const boost::uint64_t ApplyMask = 0x0000FFFFFFFFFFFF;
172  static const boost::uint64_t ApplyPtrMask = 0x0000FFFFFFFFFFF8;
173 
174  union {
175  double doubleBits;
176  boost::uint64_t otherBits;
177  };
178 
179  inline RDValue() : doubleBits(0.0) {}
180 
181  inline RDValue(double number) {
182  if (boost::math::isnan(number)) {
183  // Store a signalling NaN for NaN's.
184  // quiet NaNs are used for other types.
186  assert(boost::math::isnan(doubleBits));
187  } else
188  doubleBits = number;
189  }
190 
191  inline RDValue(float number) {
193  memcpy(((char *)&otherBits), &number, sizeof(float));
194  }
195 
196  inline RDValue(int32_t number) {
197  otherBits = (((boost::uint64_t)number) & ApplyMask) | RDTypeTag::IntTag;
198  }
199 
200  inline RDValue(unsigned int number) {
201  otherBits =
202  (((boost::uint64_t)number) & ApplyMask) | RDTypeTag::UnsignedIntTag;
203  }
204 
205  inline RDValue(bool number) {
206  otherBits =
207  (static_cast<boost::uint64_t>(number) & ApplyMask) | RDTypeTag::BoolTag;
208  }
209 
210  inline RDValue(boost::any *pointer) {
211  // ensure that the pointer really is only 48 bit
212  assert((reinterpret_cast<boost::uint64_t>(pointer) & RDTypeTag::AnyTag) ==
213  0);
214  otherBits = reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::AnyTag;
215  }
216 
217  inline RDValue(const boost::any &any) {
218  // ensure that the pointer really is only 48 bit
219  boost::any *pointer = new boost::any(any);
220  assert((reinterpret_cast<boost::uint64_t>(pointer) & RDTypeTag::AnyTag) ==
221  0);
222  otherBits = reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::AnyTag;
223  }
224 
225  // Unknown types are stored as boost::any
226  template <class T>
227  inline RDValue(const T &v) {
228  boost::any *pointer = new boost::any(v);
229  assert((reinterpret_cast<boost::uint64_t>(pointer) & RDTypeTag::AnyTag) ==
230  0);
231  otherBits = reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::AnyTag;
232  }
233 
234  inline RDValue(const std::string &v) {
235  std::string *pointer = new std::string(v);
236  assert((reinterpret_cast<boost::uint64_t>(pointer) &
237  RDTypeTag::StringTag) == 0);
238  otherBits =
239  reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::StringTag;
240  }
241 
242  inline RDValue(const std::vector<double> &v) {
243  std::vector<double> *pointer = new std::vector<double>(v);
244  assert((reinterpret_cast<boost::uint64_t>(pointer) &
246  otherBits =
247  reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::VecDoubleTag;
248  }
249 
250  inline RDValue(const std::vector<float> &v) {
251  std::vector<float> *pointer = new std::vector<float>(v);
252  assert((reinterpret_cast<boost::uint64_t>(pointer) &
253  RDTypeTag::VecFloatTag) == 0);
254  otherBits =
255  reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::VecFloatTag;
256  }
257 
258  inline RDValue(const std::vector<int> &v) {
259  std::vector<int> *pointer = new std::vector<int>(v);
260  assert((reinterpret_cast<boost::uint64_t>(pointer) &
261  RDTypeTag::VecIntTag) == 0);
262  otherBits =
263  reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::VecIntTag;
264  }
265 
266  inline RDValue(const std::vector<unsigned int> &v) {
267  std::vector<unsigned int> *pointer = new std::vector<unsigned int>(v);
268  assert((reinterpret_cast<boost::uint64_t>(pointer) &
269  RDTypeTag::VecIntTag) == 0);
270  otherBits = reinterpret_cast<boost::uint64_t>(pointer) |
272  }
273 
274  inline RDValue(const std::vector<std::string> &v) {
275  std::vector<std::string> *pointer = new std::vector<std::string>(v);
276  assert((reinterpret_cast<boost::uint64_t>(pointer) &
278  otherBits =
279  reinterpret_cast<boost::uint64_t>(pointer) | RDTypeTag::VecStringTag;
280  }
281 
282  boost::uint64_t getTag() const {
285  return RDTypeTag::DoubleTag;
286  }
287 
288  boost::uint64_t tag = otherBits & TagMask;
289  if (tag == RDTypeTag::PtrTag) return otherBits & PointerTagMask;
290  return tag;
291  }
292 
293  // ptrCast - unsafe, use rdvalue_cast instead.
294  template <class T>
295  inline T *ptrCast() const {
296  return reinterpret_cast<T *>(otherBits & ~RDTypeTag::GetTag<T>());
297  }
298 
299  // RDValue doesn't have an explicit destructor, it must
300  // be wrapped in a container.
301  // The idea is that POD types don't need to be destroyed
302  // and this allows the container optimization possibilities.
303  inline void destroy() {
304  switch (getTag()) {
306  delete ptrCast<std::string>();
307  break;
309  delete ptrCast<std::vector<double>>();
310  break;
312  delete ptrCast<std::vector<float>>();
313  break;
315  delete ptrCast<std::vector<int>>();
316  break;
318  delete ptrCast<std::vector<unsigned int>>();
319  break;
321  delete ptrCast<std::vector<std::string>>();
322  break;
323  case RDTypeTag::AnyTag:
324  delete ptrCast<boost::any>();
325  break;
326  default:
327  break;
328  }
329  }
330 
331  static inline void cleanup_rdvalue(RDValue v) { v.destroy(); }
332 };
333 
334 /////////////////////////////////////////////////////////////////////////////////////
335 // Given two RDValue::Values - copy the appropriate structure
336 // RDValue doesn't have a copy constructor, the default
337 // copy act's like a move for better value semantics.
338 // Containers may need to copy though.
339 inline void copy_rdvalue(RDValue &dest, const RDValue &src) {
340  dest.destroy();
341  switch (src.getTag()) {
343  dest = RDValue(*src.ptrCast<std::string>());
344  break;
346  dest = RDValue(*src.ptrCast<std::vector<double>>());
347  break;
349  dest = RDValue(*src.ptrCast<std::vector<float>>());
350  break;
352  dest = RDValue(*src.ptrCast<std::vector<int>>());
353  break;
355  dest = RDValue(*src.ptrCast<std::vector<unsigned int>>());
356  break;
358  dest = RDValue(*src.ptrCast<std::vector<std::string>>());
359  break;
360  case RDTypeTag::AnyTag:
361  dest = RDValue(*src.ptrCast<boost::any>());
362  break;
363  default:
364  dest = src;
365  }
366 }
367 
368 /////////////////////////////////////////////////////////////////////////////////////
369 // rdvalue_is<T>
370 
371 template <class T>
372 inline bool rdvalue_is(const RDValue_cast_t) {
373  const short tag =
374  RDTypeTag::GetTag<typename boost::remove_reference<T>::type>();
375  if (v.getTag() == tag) return true;
376 
377  // If we are an Any tag, check the any type info
378  if (v.getTag() == RDTypeTag::AnyTag) {
379  return v.value.a->type() == typeid(T);
380  }
381 
382  return false;
383 }
384 
385 template <>
386 inline bool rdvalue_is<double>(const RDValue_cast_t) {
387  return v.otherBits < RDTypeTag::MaxDouble ||
388  (v.otherBits & RDTypeTag::NaN) == RDTypeTag::NaN;
389 }
390 
391 template <>
393  return rdvalue_is<double>(v);
394 }
395 
396 /*
397 template<>
398 inline bool rdvalue_is<bool>(const RDValue_cast_t) {
399  return (v.getTag() == RDTypeTag::IntTag &&
400  (static_cast<int32_t>(v.otherBits & ~RDTypeTag::IntTag) == 1 ||
401  static_cast<int32_t>(v.otherBits & ~RDTypeTag::IntTag) == 0 ));
402 }
403 
404 template<>
405 inline bool rdvalue_is<const bool&>(const RDValue_cast_t) {
406  return rdvalue_is<bool>(v);
407 }
408 */
409 
410 /////////////////////////////////////////////////////////////////////////////////////
411 // rdvalue_cast<T>
412 //
413 // POD types do not support reference semantics. Other types do.
414 // rdvalue_cast<const std::vector<double> &>(RDValue); // ok
415 // rdvalue_cast<const float &>(RDValue); // bad_any_cast
416 
418 // Get stuff stored in boost any
419 template <class T>
421  // Disable reference and pointer casts to POD data.
422  BOOST_STATIC_ASSERT(!(
423  (boost::is_pointer<T>::value &&
424  (boost::is_integral<typename boost::remove_pointer<T>::type>::value ||
425  boost::is_floating_point<
426  typename boost::remove_pointer<T>::type>::value)) ||
427  (boost::is_reference<T>::value &&
428  (boost::is_integral<typename boost::remove_reference<T>::type>::value ||
429  boost::is_floating_point<
430  typename boost::remove_reference<T>::type>::value))));
431 
432  if (rdvalue_is<boost::any>(v)) {
433  return boost::any_cast<T>(*v.ptrCast<boost::any>());
434  }
435  throw boost::bad_any_cast();
436 }
437 
438 // POD casts
439 template <>
441  if (rdvalue_is<double>(v)) return v.doubleBits;
442  throw boost::bad_any_cast();
443 }
444 
445 template <>
447  if (rdvalue_is<float>(v)) {
448  float f;
449  memcpy(&f, ((char *)&v.otherBits), sizeof(float));
450  return f;
451  }
452  throw boost::bad_any_cast();
453 }
454 
455 // n.b. with const expressions, could use ~RDTagTypes::GetTag<T>()
456 // and enable_if
457 template <>
459  if (rdvalue_is<int>(v))
460  return static_cast<int32_t>(v.otherBits & ~RDTypeTag::IntTag);
461  throw boost::bad_any_cast();
462 }
463 template <>
465  if (rdvalue_is<unsigned int>(v))
466  return static_cast<uint32_t>(v.otherBits & ~RDTypeTag::UnsignedIntTag);
467  throw boost::bad_any_cast();
468 }
469 
470 template <>
472  if (rdvalue_is<bool>(v))
473  return static_cast<bool>(v.otherBits & ~RDTypeTag::BoolTag);
474  throw boost::bad_any_cast();
475 }
476 
477 } // namespace RDKit
478 #endif
RDKit::RDValue::RDValue
RDValue(const boost::any &any)
Definition: RDValue-doublemagic.h:217
RDKit::RDValue::ptrCast
T * ptrCast() const
Definition: RDValue-doublemagic.h:295
RDKit::RDValue::RDValue
RDValue(const std::string &v)
Definition: RDValue-doublemagic.h:234
RDKit::RDValue::otherBits
boost::uint64_t otherBits
Definition: RDValue-doublemagic.h:176
RDKit::rdvalue_cast< bool >
bool rdvalue_cast< bool >(RDValue_cast_t v)
Definition: RDValue-doublemagic.h:471
RDKit::RDValue::RDValue
RDValue(double number)
Definition: RDValue-doublemagic.h:181
RDKit::rdvalue_is< double >
bool rdvalue_is< double >(const RDValue_cast_t)
Definition: RDValue-doublemagic.h:386
RDKit::RDValue_cast_t
RDValue RDValue_cast_t
Definition: RDValue-doublemagic.h:417
RDKit::RDValue::RDValue
RDValue(const std::vector< unsigned int > &v)
Definition: RDValue-doublemagic.h:266
RDKit::RDTypeTag::FloatTag
static const boost::uint64_t FloatTag
Definition: RDValue-doublemagic.h:97
BoostStartInclude.h
RDKit::RDValue::RDValue
RDValue(boost::any *pointer)
Definition: RDValue-doublemagic.h:210
RDKit::RDTypeTag::UnsignedIntTag
static const boost::uint64_t UnsignedIntTag
Definition: RDValue-doublemagic.h:99
RDKit::RDValue::RDValue
RDValue(unsigned int number)
Definition: RDValue-doublemagic.h:200
RDKit::RDValue
Definition: RDValue-doublemagic.h:167
RDKit::RDTypeTag::PtrTag
static const boost::uint64_t PtrTag
Definition: RDValue-doublemagic.h:103
RDKit::RDValue::PointerTagMask
static const boost::uint64_t PointerTagMask
Definition: RDValue-doublemagic.h:170
RDKit::RDTypeTag::DoubleTag
static const boost::uint64_t DoubleTag
Definition: RDValue-doublemagic.h:96
RDKit::RDValue::ApplyPtrMask
static const boost::uint64_t ApplyPtrMask
Definition: RDValue-doublemagic.h:172
RDKit::RDTypeTag::VecDoubleTag
static const boost::uint64_t VecDoubleTag
Definition: RDValue-doublemagic.h:105
RDKit::RDTypeTag::VecUnsignedIntTag
static const boost::uint64_t VecUnsignedIntTag
Definition: RDValue-doublemagic.h:108
RDKit::RDValue::RDValue
RDValue(int32_t number)
Definition: RDValue-doublemagic.h:196
RDKit::RDValue::RDValue
RDValue(const std::vector< float > &v)
Definition: RDValue-doublemagic.h:250
RDKit::RDValue::RDValue
RDValue(const T &v)
Definition: RDValue-doublemagic.h:227
RDKit::rdvalue_cast< int >
int rdvalue_cast< int >(RDValue_cast_t v)
Definition: RDValue-doublemagic.h:458
RDKit::RDValue::doubleBits
double doubleBits
Definition: RDValue-doublemagic.h:175
RDKit::RDValue::cleanup_rdvalue
static void cleanup_rdvalue(RDValue v)
Definition: RDValue-doublemagic.h:331
BoostEndInclude.h
RDKit::rdvalue_cast
T rdvalue_cast(RDValue_cast_t v)
Definition: RDValue-doublemagic.h:420
RDKit::RDValue::RDValue
RDValue()
Definition: RDValue-doublemagic.h:179
RDKit::RDValue::destroy
void destroy()
Definition: RDValue-doublemagic.h:303
RDKit::RDValue::RDValue
RDValue(const std::vector< std::string > &v)
Definition: RDValue-doublemagic.h:274
RDKit::RDTypeTag::NaN
static const boost::uint64_t NaN
Definition: RDValue-doublemagic.h:94
RDKit::rdvalue_cast< unsigned int >
unsigned int rdvalue_cast< unsigned int >(RDValue_cast_t v)
Definition: RDValue-doublemagic.h:464
RDKit::RDTypeTag::GetTag< unsigned int >
boost::uint64_t GetTag< unsigned int >()
Definition: RDValue-doublemagic.h:130
RDKit::RDTypeTag::VecFloatTag
static const boost::uint64_t VecFloatTag
Definition: RDValue-doublemagic.h:106
RDKit::rdvalue_is< const double & >
bool rdvalue_is< const double & >(const RDValue_cast_t)
Definition: RDValue-doublemagic.h:392
RDKit::RDTypeTag::AnyTag
static const boost::uint64_t AnyTag
Definition: RDValue-doublemagic.h:110
RDKit::RDTypeTag::IntTag
static const boost::uint64_t IntTag
Definition: RDValue-doublemagic.h:98
LocaleSwitcher.h
RDKit::RDValue::RDValue
RDValue(bool number)
Definition: RDValue-doublemagic.h:205
RDKit::RDTypeTag::GetTag
boost::uint64_t GetTag()
Definition: RDValue-doublemagic.h:114
Invariant.h
RDKit::RDTypeTag::VecIntTag
static const boost::uint64_t VecIntTag
Definition: RDValue-doublemagic.h:107
RDKit::RDTypeTag::StringTag
static const boost::uint64_t StringTag
Definition: RDValue-doublemagic.h:104
RDKit::RDTypeTag::GetTag< float >
boost::uint64_t GetTag< float >()
Definition: RDValue-doublemagic.h:122
RDKit
Std stuff.
Definition: Atom.h:30
RDKit::RDTypeTag::BoolTag
static const boost::uint64_t BoolTag
Definition: RDValue-doublemagic.h:100
RDKit::rdvalue_cast< double >
double rdvalue_cast< double >(RDValue_cast_t v)
Definition: RDValue-doublemagic.h:440
RDKit::RDValue::getTag
boost::uint64_t getTag() const
Definition: RDValue-doublemagic.h:282
RDKit::RDTypeTag::GetTag< int >
boost::uint64_t GetTag< int >()
Definition: RDValue-doublemagic.h:126
RDKit::rdvalue_is
bool rdvalue_is(const RDValue_cast_t)
Definition: RDValue-doublemagic.h:372
RDKit::RDTypeTag::VecStringTag
static const boost::uint64_t VecStringTag
Definition: RDValue-doublemagic.h:109
RDKit::RDValue::TagMask
static const boost::uint64_t TagMask
Definition: RDValue-doublemagic.h:169
RDKit::RDTypeTag::GetTag< double >
boost::uint64_t GetTag< double >()
Definition: RDValue-doublemagic.h:118
RDKit::RDTypeTag::GetTag< bool >
boost::uint64_t GetTag< bool >()
Definition: RDValue-doublemagic.h:134
RDKit::rdvalue_cast< float >
float rdvalue_cast< float >(RDValue_cast_t v)
Definition: RDValue-doublemagic.h:446
RDKit::RDValue::RDValue
RDValue(const std::vector< double > &v)
Definition: RDValue-doublemagic.h:242
RDKit::RDValue::RDValue
RDValue(float number)
Definition: RDValue-doublemagic.h:191
RDKit::RDValue::RDValue
RDValue(const std::vector< int > &v)
Definition: RDValue-doublemagic.h:258
RDKit::RDTypeTag::MaxDouble
static const boost::uint64_t MaxDouble
Definition: RDValue-doublemagic.h:95
RDKit::copy_rdvalue
void copy_rdvalue(RDValue &dest, const RDValue &src)
Definition: RDValue-doublemagic.h:339
export.h
RDKit::RDValue::ApplyMask
static const boost::uint64_t ApplyMask
Definition: RDValue-doublemagic.h:171