Skip to content

Commit

Permalink
Started to move towards 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pariterre committed Jul 8, 2021
1 parent b19ce44 commit 21b77ed
Show file tree
Hide file tree
Showing 91 changed files with 17,510 additions and 20,514 deletions.
18 changes: 14 additions & 4 deletions addons/benchmark/SampleData.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct SampleData {
qdot = new RigidBodyDynamics::Math::VectorNd[count];
qddot = new RigidBodyDynamics::Math::VectorNd[count];
tau = new RigidBodyDynamics::Math::VectorNd[count];
durations = data.durations;

for (int si = 0; si < count; si++) {
q[si] = data.q[si];
Expand All @@ -36,25 +37,32 @@ struct SampleData {
RigidBodyDynamics::Math::VectorNd *qdot;
RigidBodyDynamics::Math::VectorNd *qddot;
RigidBodyDynamics::Math::VectorNd *tau;
RigidBodyDynamics::Math::VectorNd durations;

void deleteData() {
count = 0;

if (q)
if (q) {
delete[] q;
}
q = NULL;

if (qdot)
if (qdot) {
delete[] qdot;
}
qdot = NULL;

if (qddot)
if (qddot) {
delete[] qddot;
}
qddot = NULL;

if (tau)
if (tau) {
delete[] tau;
}
tau = NULL;

durations.resize(0);
}

void fillRandom (int dof_count, int sample_count) {
Expand All @@ -79,6 +87,8 @@ struct SampleData {
tau[si][i] = (static_cast<double>(rand()) / static_cast<double>(RAND_MAX)) * 2. -1.;
}
}

durations = RigidBodyDynamics::Math::VectorNd::Zero(count);
}
};

Expand Down
Loading

0 comments on commit 21b77ed

Please sign in to comment.