Skip to content

Commit 2682f7b

Browse files
committed
Add entity IntegratorEulerVectorDouble
1 parent f3bdd37 commit 2682f7b

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

include/sot/core/integrator-euler-impl.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
namespace dynamicgraph {
5959
namespace sot {
6060
DECLARE_SPECIFICATION(IntegratorEulerVectorMatrix,dg::Vector,dg::Matrix)
61+
DECLARE_SPECIFICATION(IntegratorEulerVectorDouble,dg::Vector,double)
6162
}
6263
}
6364

include/sot/core/integrator-euler.hh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public:
119119
// End of step 1. Here, sum is b_0 X
120120

121121
// Step 2
122-
int numsize = num.size();
122+
int numsize = (int)num.size();
123123
for(int i = 1; i < numsize; ++i)
124124
{
125125
tmp2 = inputMemory[i-1] - tmp1;
@@ -131,7 +131,7 @@ public:
131131
// End of step 2. Here, sum is b_m * d(m)X / dt^m + ... - b_0 X
132132

133133
// Step 3
134-
int denomsize = denom.size() - 1;
134+
int denomsize = (int)denom.size() - 1;
135135
for(int i = 0; i < denomsize; ++i)
136136
{
137137
sum -= (denom[i] * outputMemory[i]);
@@ -161,6 +161,7 @@ public:
161161

162162
SOUT.recompute(time);
163163
res = outputMemory[1];
164+
return res;
164165
}
165166

166167
void setSamplingPeriod (const double& period)

src/matrix/integrator-euler.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#ifdef WIN32
2929
IntegratorEulerVectorMatrix::IntegratorEulerVectorMatrix( const std::string& name ) :
3030
IntegratorEuler<Vector,Matrix>(name) {}
31-
std::string IntegratorEulerVectorMatrix::getTypeName( void ) { return "double"; }
31+
std::string IntegratorEulerVectorMatrix::getTypeName( void ) { return "IntegratorEulerVectorMatrix"; }
32+
33+
IntegratorEulerVectorDouble::IntegratorEulerVectorDouble( const std::string& name ) :
34+
IntegratorEuler<Vector,double>(name) {}
35+
std::string IntegratorEulerVectorDouble::getTypeName( void ) { return "IntegratorEulerVectorDouble"; }
3236
#endif // WIN32
3337

src/matrix/integrator-euler.t.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,21 @@ using namespace dynamicgraph;
3434
const std::string& sotClassType<sotSigType,sotCoefType>:: \
3535
getClassName( void ) const { return CLASS_NAME; } \
3636
extern "C" { \
37-
Entity *regFunction##_##sotSigType( const std::string& objname ) \
37+
Entity *regFunction##_##sotSigType##_##sotCoefType( const std::string& objname ) \
3838
{ \
3939
return new sotClassType<sotSigType,sotCoefType>( objname ); \
4040
} \
4141
EntityRegisterer \
42-
regObj##_##sotSigType(sotClassType<sotSigType,sotCoefType>::CLASS_NAME, \
43-
&regFunction##_##sotSigType ); \
42+
regObj##_##sotSigType##_##sotCoefType(sotClassType<sotSigType,sotCoefType>::CLASS_NAME, \
43+
&regFunction##_##sotSigType##_##sotCoefType ); \
4444
}
4545

4646
using namespace std;
4747
namespace dynamicgraph {
4848
namespace sot {
4949
SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_EULER(IntegratorEuler,Vector,Matrix,
5050
"IntegratorEulerVectorMatrix")
51+
SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_EULER(IntegratorEuler,Vector,double,
52+
"IntegratorEulerVectorDouble")
5153
} // namespace sot
5254
} // namespace dynamicgraph

0 commit comments

Comments
 (0)