Xmipp  v3.23.11-Nereus
parallel.cpp
Go to the documentation of this file.
1 /*
2 
3 CONDOR 1.06 - COnstrained, Non-linear, Direct, parallel Optimization
4  using trust Region method for high-computing load,
5  noisy functions
6 Copyright (C) 2004 Frank Vanden Berghen
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation version 2
11 of the License.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 
22 If you want to include this tools in any commercial product,
23 you can contact the author at fvandenb@iridia.ulb.ac.be
24 
25 */
26 
27 #include <memory.h>
28 #include <stdio.h>
29 
30 #include "Vector.h"
31 #include "IntPoly.h"
32 #include "tools.h"
33 #include "ObjectiveFunction.h"
34 
35 
36 void parallelImprove(InterPolynomial *p, int *_k, double _rho, double *_valueFk, Vector _Base)
37 {}
38 
40 void parallelInit(int _nnode, int _dim, ObjectiveFunction *_of){}
42 
43 int calculateNParallelJob(int n,double *vf,Vector *cp, ObjectiveFunction *of, int *notsuccess)
44 {
45  int i,r,nsuccess=0;
46  for (i=0; i<n; i++)
47  {
48  r=0;
49  vf[i]=of->eval(cp[i],&r);
50  notsuccess[i]=r;
51  if (!r) nsuccess++;
52  }
53  return nsuccess;
54 
55 }
56 
void parallelFinish()
Definition: parallel.cpp:41
Definition: Vector.h:37
void parallelImprove(InterPolynomial *p, int *_k, double _rho, double *_valueFk, Vector _Base)
Definition: parallel.cpp:36
#define i
virtual double eval(Vector v, int *nerror)=0
int calculateNParallelJob(int n, double *vf, Vector *cp, ObjectiveFunction *of, int *notsuccess)
Definition: parallel.cpp:43
void startParallelThread()
Definition: parallel.cpp:39
void parallelInit(int _nnode, int _dim, ObjectiveFunction *_of)
Definition: parallel.cpp:40
int * n