@@ -32,7 +32,7 @@ enum AccuracyOrder {
32
32
* @param[in] eps Value of the finite difference step.
33
33
*/
34
34
void finite_gradient (
35
- const Eigen::VectorXd& x,
35
+ const Eigen::Ref< const Eigen:: VectorXd> & x,
36
36
const std::function<double (const Eigen::VectorXd&)>& f,
37
37
Eigen::VectorXd& grad,
38
38
const AccuracyOrder accuracy = SECOND,
@@ -48,7 +48,7 @@ void finite_gradient(
48
48
* @param[in] eps Value of the finite difference step.
49
49
*/
50
50
void finite_jacobian (
51
- const Eigen::VectorXd& x,
51
+ const Eigen::Ref< const Eigen:: VectorXd> & x,
52
52
const std::function<Eigen::VectorXd(const Eigen::VectorXd&)>& f,
53
53
Eigen::MatrixXd& jac,
54
54
const AccuracyOrder accuracy = SECOND,
@@ -64,7 +64,7 @@ void finite_jacobian(
64
64
* @param[in] eps Value of the finite difference step.
65
65
*/
66
66
void finite_hessian (
67
- const Eigen::VectorXd& x,
67
+ const Eigen::Ref< const Eigen:: VectorXd> & x,
68
68
const std::function<double (const Eigen::VectorXd&)>& f,
69
69
Eigen::MatrixXd& hess,
70
70
const AccuracyOrder accuracy = SECOND,
@@ -81,8 +81,8 @@ void finite_hessian(
81
81
* @return A boolean for if x and y are close to the same value.
82
82
*/
83
83
bool compare_gradient (
84
- const Eigen::VectorXd& x,
85
- const Eigen::VectorXd& y,
84
+ const Eigen::Ref< const Eigen:: VectorXd> & x,
85
+ const Eigen::Ref< const Eigen:: VectorXd> & y,
86
86
const double test_eps = 1e-4 ,
87
87
const std::string& msg = " compare_gradient " );
88
88
@@ -97,8 +97,8 @@ bool compare_gradient(
97
97
* @return A boolean for if x and y are close to the same value.
98
98
*/
99
99
bool compare_jacobian (
100
- const Eigen::MatrixXd& x,
101
- const Eigen::MatrixXd& y,
100
+ const Eigen::Ref< const Eigen:: MatrixXd> & x,
101
+ const Eigen::Ref< const Eigen:: MatrixXd> & y,
102
102
const double test_eps = 1e-4 ,
103
103
const std::string& msg = " compare_jacobian " );
104
104
@@ -113,15 +113,15 @@ bool compare_jacobian(
113
113
* @return A boolean for if x and y are close to the same value.
114
114
*/
115
115
bool compare_hessian (
116
- const Eigen::MatrixXd& x,
117
- const Eigen::MatrixXd& y,
116
+ const Eigen::Ref< const Eigen:: MatrixXd> & x,
117
+ const Eigen::Ref< const Eigen:: MatrixXd> & y,
118
118
const double test_eps = 1e-4 ,
119
119
const std::string& msg = " compare_hessian " );
120
120
121
121
// / @brief Flatten the matrix rowwise
122
- Eigen::VectorXd flatten (const Eigen::MatrixXd& X);
122
+ Eigen::VectorXd flatten (const Eigen::Ref< const Eigen:: MatrixXd> & X);
123
123
124
124
// / @brief Unflatten rowwise
125
- Eigen::MatrixXd unflatten (const Eigen::VectorXd& x, int dim);
125
+ Eigen::MatrixXd unflatten (const Eigen::Ref< const Eigen:: VectorXd> & x, int dim);
126
126
127
127
} // namespace fd
0 commit comments