Open Babel  3.0
spectrophore.h
Go to the documentation of this file.
1 /**********************************************************************
2 Spectrophore.h - Spectrophore(TM) calculator.
3  Declarations of OBSpectrophore
4 
5 Copyright (C) 2005-2010 by Silicos NV
6 
7 This file is part of the Open Babel project.
8 For more information, see <http://openbabel.org/>
9 
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation version 2 of the License.
13 
14 The algorithm in this software has been covered by patent WO2009146735.
15 However, Silicos NV and the inventors of the above mentioned patent assure
16 that no patent infringment claims will be issued against individuals or
17 institutions that use this software under the GNU General Public License.
18 
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23 ***********************************************************************/
24 
25 
26 #ifndef OB_SPECTROPHORE_H
27 #define OB_SPECTROPHORE_H
28 
29 #include <openbabel/babelconfig.h>
30 #include <vector>
31 
43 #define MIN(x, y) (((x) < (y)) ? (x) : (y))
44 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
45 #define N_PROPERTIES 4
46 
47 
48 
49 namespace OpenBabel
50 {
51  class OBMol;
52 
302  class OBAPI OBSpectrophore
303  {
304  public:
305 
317  AngStepSize60};
318 
321  enum NormalizationOption {NoNormalization,
324  NormalizationTowardsZeroMeanAndUnitStd};
325 
328  enum StereoOption {NoStereoSpecificProbes,
331  AllStereoSpecificProbes};
332 
334 
339  OBSpectrophore(void);
340 
346  OBSpectrophore(const OBSpectrophore& sphore);
347 
350  virtual ~OBSpectrophore(void);
352 
361  OBSpectrophore& operator=(const OBSpectrophore& sphore);
363 
382  void SetResolution(const double r = 3.0);
383 
412  void SetAccuracy(const AccuracyOption a = AngStepSize20);
413 
436  void SetStereo(const StereoOption s = NoStereoSpecificProbes);
437 
455  void SetNormalization(const NormalizationOption n = NoNormalization);
457 
468  AccuracyOption GetAccuracy(void) const;
469 
474  double GetResolution(void) const;
475 
486  StereoOption GetStereo(void) const;
487 
498  NormalizationOption GetNormalization(void) const;
499 
547  std::vector<double> GetSpectrophore(OpenBabel::OBMol* mol);
549 
550 
551  protected:
552 
554  double _resolution;
558  std::vector<int> _rotationStepList;
559  unsigned int _nAtoms;
560  double** _property;
561  double* _radii;
562  double** _oricoor;
563  double** _coor;
564  unsigned int _beginProbe;
565  unsigned int _endProbe;
566  unsigned int _numberOfProbes;
567  std::vector<double> _spectro;
568  struct
569  {
570  int value[12];
571  } _probe[48];
572  struct
573  {
574  double x;
575  double y;
576  double z;
577  double v[N_PROPERTIES];
578  } _boxPoint[12];
580 
582  void _getMoleculeData(OpenBabel::OBMol*);
583  void _orient(void);
584  void _getBox(double**);
585  void _setBox(void);
586  void _getEnergies(double**, double*);
587  void _initiateSpectrophore(double*, double*);
588  void _rotateX(double**, double**, const double, const double);
589  void _rotateY(double**, double**, const double, const double);
590  void _rotateZ(double**, double**, const double, const double);
591  void _updateSpectrophore(double*, double*);
592  void _calculateProperties(OpenBabel::OBMol*);
593  void _solveMatrix(double**, double*, unsigned int);
594  void _luDecompose(double**, std::vector<int>&, unsigned int);
595  void _luSolve(double**, std::vector<int>&, double*, unsigned int);
596  void _swapRows(double*, unsigned int, unsigned int);
597  void _swapRows(double**, unsigned int, unsigned int, unsigned int);
599 
600  };
601 
602 } // end namespace OpenBabel
603 
604 
605 #endif //OB_SPECTROPHORE_H
NormalizationOption
Definition: spectrophore.h:321
Class to compute Spectrophores™.
Definition: spectrophore.h:302
double ** _coor
Definition: spectrophore.h:563
AccuracyOption _accuracy
Definition: spectrophore.h:555
double ** _oricoor
Definition: spectrophore.h:562
std::vector< int > _rotationStepList
Definition: spectrophore.h:558
Definition: spectrophore.h:315
Definition: spectrophore.h:314
AccuracyOption
Definition: spectrophore.h:308
Definition: spectrophore.h:309
Molecule Class.
Definition: mol.h:118
Definition: spectrophore.h:310
std::vector< double > _spectro
Definition: spectrophore.h:567
double * _radii
Definition: spectrophore.h:561
Definition: spectrophore.h:308
unsigned int _nAtoms
Definition: spectrophore.h:559
Definition: spectrophore.h:313
NormalizationOption _normalization
Definition: spectrophore.h:557
double y
Definition: spectrophore.h:575
unsigned int _endProbe
Definition: spectrophore.h:565
double ** _property
Definition: spectrophore.h:560
double x
Definition: spectrophore.h:574
StereoOption _stereoFlag
Definition: spectrophore.h:556
double z
Definition: spectrophore.h:576
Definition: spectrophore.h:316
unsigned int _beginProbe
Definition: spectrophore.h:564
StereoOption
Definition: spectrophore.h:328
Definition: spectrophore.h:311
#define N_PROPERTIES
Definition: spectrophore.h:45
unsigned int _numberOfProbes
Definition: spectrophore.h:566
double _resolution
Definition: spectrophore.h:554
Definition: spectrophore.h:312
Global namespace for all Open Babel code.
Definition: alias.h:22