-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbfgs.h
25 lines (22 loc) · 788 Bytes
/
bfgs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include <vector>
class BFGSHistory {
public:
BFGSHistory(int np, int nh);
double setSearchDirection(double F, const double *p, const double *dp, double *du);
double setSearchDirection(double F, const float *p, const float *dp, float *du);
private:
template <typename T> double setSearchDirectionT(double F, const T *p, const T *dp, T *du);
std::vector<double> lastp_;
std::vector<double> lastdp_;
std::vector<std::vector<double>> deltaX_;
std::vector<std::vector<double>> deltaG_;
std::vector<double> rhoi_;
std::vector<double> alpha_;
double F_;
int np_;
int nh_;
int index_;
int nhave_;
bool first_;
};