Xmipp
v3.23.11-Nereus
xmipp
external
condor
CTRSSolver.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 <stdio.h>
28
#include <memory.h>
29
30
//#include <crtdbg.h>
31
32
#include "
ObjectiveFunction.h
"
33
#include "
Matrix.h
"
34
#include "
IntPoly.h
"
35
#include "
tools.h
"
36
#include "
VectorChar.h
"
37
38
Vector
FullLambda
;
39
40
// from QPsolver:
41
void
simpleQPSolve
(
Matrix
mH,
Vector
vG,
Matrix
mA,
Vector
vB,
// in
42
Vector
vP,
Vector
vLambda,
int
*info);
// out
43
void
restartSimpleQPSolve
(
Vector
vBO,
// in
44
Vector
vP);
// out
45
46
// from TRSSolver:
47
Vector
L2NormMinimizer
(
Polynomial
q,
double
delta
,
48
int
*infoOut=NULL,
int
maxIter=1000,
double
*lambda1=NULL);
49
Vector
L2NormMinimizer
(
Polynomial
q,
Vector
pointXk,
double
delta
,
50
int
*infoOut=NULL,
int
maxIter=1000,
double
*lambda1=NULL);
51
Vector
L2NormMinimizer
(
Polynomial
q,
Vector
pointXk,
double
delta
,
52
int
*infoOut,
int
maxIter,
double
*lambda1,
Vector
minusG,
Matrix
H);
53
54
55
// from CTRSSolver:
56
char
checkForTermination
(
Vector
d
,
Vector
Base,
double
rhoEnd){
return
0;}
57
void
initConstrainedStep
(
ObjectiveFunction
*of){ FullLambda.
setSize
(0); }
58
59
Vector
ConstrainedL2NormMinimizer
(
InterPolynomial
poly,
int
k
,
double
delta
,
60
int
*info,
int
iterMax,
double
*lambda1,
Vector
vOBase,
ObjectiveFunction
*of)
61
{
62
int
dim=poly.
dim
();
63
Matrix
mH(dim,dim);
64
Vector
vG(dim);
65
poly.
gradientHessian
(poly.
NewtonPoints
[k],vG,mH);
66
67
if
(of->
isConstrained
)
68
printf(
"Limited version! Ignoring constraints !\n"
);
69
return
L2NormMinimizer
(poly, poly.
NewtonPoints
[k], delta, info, iterMax, lambda1, vG, mH);
70
71
// return ConstrainedL2NormMinimizer(mH,vG,delta,info,iterMax,lambda1,vOBase+poly.NewtonPoints[k],of);
72
}
73
74
void
projectionIntoFeasibleSpace
(
Vector
vFrom,
Vector
vBase,
ObjectiveFunction
*of)
75
{
76
vBase.
copyFrom
(vFrom);
77
}
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
ObjectiveFunction::isConstrained
int isConstrained
Definition:
ObjectiveFunction.h:54
InterPolynomial::NewtonPoints
Vector * NewtonPoints
Definition:
IntPoly.h:47
ConstrainedL2NormMinimizer
Vector ConstrainedL2NormMinimizer(InterPolynomial poly, int k, double delta, int *info, int iterMax, double *lambda1, Vector vOBase, ObjectiveFunction *of)
Definition:
CTRSSolver.cpp:59
restartSimpleQPSolve
void restartSimpleQPSolve(Vector vBO, Vector vP)
Definition:
QPSolver.cpp:363
ObjectiveFunction
Definition:
ObjectiveFunction.h:36
Vector
Definition:
Vector.h:37
Polynomial::dim
unsigned dim()
Definition:
Poly.h:62
simpleQPSolve
void simpleQPSolve(Matrix mH, Vector vG, Matrix mA, Vector vB, Vector vP, Vector vLambda, int *info)
Definition:
QPSolver.cpp:105
k
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
d
doublereal * d
Definition:
numerical_recipes.cpp:2230
Vector::setSize
void setSize(int _n)
Definition:
Vector.cpp:112
InterPolynomial
Definition:
IntPoly.h:35
Polynomial::gradientHessian
void gradientHessian(Vector P, Vector G, Matrix H)
Definition:
Poly.cpp:515
projectionIntoFeasibleSpace
void projectionIntoFeasibleSpace(Vector vFrom, Vector vBase, ObjectiveFunction *of)
Definition:
CTRSSolver.cpp:74
Matrix.h
Matrix
Definition:
Matrix.h:38
VectorChar.h
checkForTermination
char checkForTermination(Vector d, Vector Base, double rhoEnd)
Definition:
CTRSSolver.cpp:56
ObjectiveFunction.h
FullLambda
Vector FullLambda
Definition:
CTRSSolver.cpp:38
tools.h
Polynomial
Definition:
Poly.h:38
Vector::copyFrom
void copyFrom(Vector r, int _n=0)
Definition:
Vector.cpp:215
initConstrainedStep
void initConstrainedStep(ObjectiveFunction *of)
Definition:
CTRSSolver.cpp:57
IntPoly.h
L2NormMinimizer
Vector L2NormMinimizer(Polynomial q, double delta, int *infoOut=NULL, int maxIter=1000, double *lambda1=NULL)
Definition:
UTRSSolver.cpp:307
delta
double * delta
Definition:
numerical_recipes.cpp:7597
Generated by
1.8.13