Skip to content

Commit 7f565de

Browse files
author
Benjamin Chrétien
committed
Do not return *_ref objects.
This would return references to temporary local Eigen::Ref objects.
1 parent b1a6aad commit 7f565de

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

include/roboptim/core/plugin/cminpack.hh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,25 @@ namespace roboptim {
7575
}
7676

7777
/// Get parameter
78-
argument_ref parameter ()
78+
argument_t& parameter ()
7979
{
8080
return parameter_;
8181
}
8282

83-
const_argument_ref parameter () const
83+
const argument_t& parameter () const
8484
{
8585
return parameter_;
8686
}
8787

8888
/// Get value
89-
const_argument_ref value () const
89+
const argument_t& value () const
9090
{
9191
(*cost_)(value_, parameter_);
9292
return value_;
9393
}
9494

9595
/// Get Jacobian
96-
const_gradient_ref jacobianRow (size_type iRow) const
96+
const gradient_t& jacobianRow (size_type iRow) const
9797
{
9898
(*cost_).gradient (jacobianRow_, parameter_, iRow);
9999
return jacobianRow_;

0 commit comments

Comments
 (0)