Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
82fac618
Commit
82fac618
authored
Feb 27, 2020
by
Rohan Budhiraja
Browse files
[cppad] fix return type of constant_pi and add support of isfinite
parent
f14c5bb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/autodiff/cppad.hpp
View file @
82fac618
...
...
@@ -28,7 +28,14 @@ namespace boost
namespace
detail
{
template
<
typename
Scalar
>
struct
constant_pi
<
CppAD
::
AD
<
Scalar
>
>
:
constant_pi
<
Scalar
>
{};
struct
constant_pi
<
CppAD
::
AD
<
Scalar
>
>
:
constant_pi
<
Scalar
>
{
template
<
int
N
>
static
inline
CppAD
::
AD
<
Scalar
>
get
(
const
mpl
::
int_
<
N
>&
n
)
{
return
CppAD
::
AD
<
Scalar
>
(
constant_pi
<
Scalar
>::
get
(
n
));
}
};
}
}
}
...
...
src/codegen/cppadcg.hpp
View file @
82fac618
...
...
@@ -25,7 +25,13 @@ namespace boost
namespace
detail
{
template
<
typename
Scalar
>
struct
constant_pi
<
CppAD
::
cg
::
CG
<
Scalar
>
>
:
constant_pi
<
Scalar
>
{};
struct
constant_pi
<
CppAD
::
cg
::
CG
<
Scalar
>
>
:
constant_pi
<
Scalar
>
{
template
<
int
N
>
static
inline
CppAD
::
cg
::
CG
<
Scalar
>
get
(
const
mpl
::
int_
<
N
>&
n
)
{
return
CppAD
::
cg
::
CG
<
Scalar
>
(
constant_pi
<
Scalar
>::
get
(
n
));
}
};
}
}
}
...
...
@@ -50,6 +56,15 @@ namespace Eigen
}
}
// namespace Eigen
namespace
CppAD
{
template
<
class
Scalar
>
bool
isfinite
(
const
cg
::
CG
<
Scalar
>
&
x
)
{
return
std
::
isfinite
(
x
.
getValue
());
}
template
<
class
Scalar
>
bool
isfinite
(
const
AD
<
Scalar
>
&
x
)
{
return
isfinite
(
Value
(
x
));
}
}
namespace
pinocchio
{
template
<
typename
Scalar
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment