RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
SimplexCostFunction.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13#ifndef _RBTSIMPLEXCOSTFUNCTION_H
14#define _RBTSIMPLEXCOSTFUNCTION_H
15
16#ifdef __PGI
17#define EIGEN_DONT_VECTORIZE
18#endif
19#include <Eigen/Core>
20
21#include "rxdock/BaseSF.h"
22#include "rxdock/ChromElement.h"
23
24namespace rxdock {
25
26// Rosenbrock cost function
28public:
30 : m_pSF(pSF), m_chrom(chrom) {}
31 typedef double DataType;
32 typedef Eigen::VectorXd ParameterType;
33 double operator()(const ParameterType &parameters) { // const
34 nCalls++;
35 std::vector<double> vec(parameters.data(),
36 parameters.data() + parameters.size());
37 m_chrom->SetVector(vec);
38 m_chrom->SyncToModel();
39 return m_pSF->Score();
40 }
41 unsigned long int nCalls = 0;
42
43private:
44 BaseSF *m_pSF;
45 ChromElementPtr m_chrom;
46};
47
48} // namespace rxdock
49
50#endif // _RBTSIMPLEXCOSTFUNCTION_H
Definition BaseSF.h:28
Definition SimplexCostFunction.h:27