~ubuntu-branches/ubuntu/quantal/python-demgengeo/quantal

« back to all changes in this revision

Viewing changes to sphere_fitting/utils/simplex.h

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2011-11-18 21:47:18 UTC
  • Revision ID: package-import@ubuntu.com-20111118214718-4ysqm3dhpqwdd7gd
Tags: upstream-0.99~bzr106
ImportĀ upstreamĀ versionĀ 0.99~bzr106

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////
 
2
//                                                         //
 
3
// Copyright (c) 2007-2011 by The University of Queensland //
 
4
// Earth Systems Science Computational Centre (ESSCC)      //
 
5
// http://www.uq.edu.au/esscc                              //
 
6
//                                                         //
 
7
// Primary Business: Brisbane, Queensland, Australia       //
 
8
// Licensed under the Open Software License version 3.0    //
 
9
// http://www.opensource.org/licenses/osl-3.0.php          //
 
10
//                                                         //
 
11
/////////////////////////////////////////////////////////////
 
12
 
 
13
// simplex method
 
14
#ifndef __SIMPLEX_H
 
15
#define __SIMPLEX_H
 
16
 
 
17
#include "nvector.h"
 
18
#include "nfunction.h"
 
19
 
 
20
#include <iostream>
 
21
 
 
22
 
 
23
template<class T,int n>
 
24
class simplex_method
 
25
{
 
26
 private:
 
27
  nfunction<T,n>* m_func;
 
28
  nvector<T,n> m_vert[n+1];
 
29
  T m_val[n+1];
 
30
 
 
31
  nvector<T,n> reflect(int);
 
32
  void insert(const nvector<T,n>&,T,int);
 
33
  void shrink();
 
34
  void sort();
 
35
 
 
36
 public:
 
37
  simplex_method(nfunction<T,n>*);
 
38
 
 
39
  nvector<T,n> solve(T,const nvector<T,n> &,int max=-1);
 
40
};
 
41
 
 
42
#include "simplex.hh"
 
43
 
 
44
#endif //__SIMPLEX_H