<commit_before>#include <iostream>
#include <map>

#include "drakeGeometryUtil.h"
#include "RigidBodyManipulator.h"
#include "DrakeJoint.h"
#include "FixedJoint.h"
#include "drakeUtil.h"

#include <algorithm>
#include <string>
#include <regex>
#include <stdexcept>
#include <limits>
#include "RigidBodyConstraint.h"
//DEBUG
//#include <stdexcept>
//END_DEBUG

using namespace std;

std::set<int> emptyIntSet;


template <typename T>
void getFiniteIndexes(T const & v, std::vector<int> &finite_indexes)
{
  finite_indexes.clear();
  const size_t n = v.size();
  for (int x = 0; x < n; x++)
  {
    if (std::isfinite<double>(static_cast<double>(v[x]))) {
      finite_indexes.push_back(x);
    }
  }
}

std::ostream& operator<<(std::ostream& os, const RigidBodyLoop& obj)
{
  os << "loop connects pt " << obj.ptA.transpose() << " on " << obj.bodyA->linkname << " to pt " << obj.ptB.transpose() << " on " << obj.bodyB->linkname << std::endl;
  return os;
}

RigidBodyManipulator::RigidBodyManipulator(int ndof, int num_rigid_body_objects, int num_rigid_body_frames) :
    collision_model(DrakeCollision::newModel())
{
  num_positions = 0;
  num_bodies = 0;
  num_frames = 0;
  a_grav << 0, 0, 0, 0, 0, -9.81;
  resize(ndof, num_rigid_body_objects, num_rigid_body_frames);
}<commit_msg>bad call to isfinite<commit_after>#include <iostream>
#include <map>

#include "drakeGeometryUtil.h"
#include "RigidBodyManipulator.h"
#include "DrakeJoint.h"
#include "FixedJoint.h"
#include "drakeUtil.h"

#include <algorithm>
#include <string>
#include <regex>
#include <stdexcept>
#include <limits>
#include "RigidBodyConstraint.h"
//DEBUG
//#include <stdexcept>
//END_DEBUG

using namespace std;

std::set<int> emptyIntSet;


template <typename T>
void getFiniteIndexes(T const & v, std::vector<int> &finite_indexes)
{
  finite_indexes.clear();
  const size_t n = v.size();
  for (int x = 0; x < n; x++)
  {
    if (std::isfinite(static_cast<double>(v[x]))) {
      finite_indexes.push_back(x);
    }
  }
}

std::ostream& operator<<(std::ostream& os, const RigidBodyLoop& obj)
{
  os << "loop connects pt " << obj.ptA.transpose() << " on " << obj.bodyA->linkname << " to pt " << obj.ptB.transpose() << " on " << obj.bodyB->linkname << std::endl;
  return os;
}

RigidBodyManipulator::RigidBodyManipulator(int ndof, int num_rigid_body_objects, int num_rigid_body_frames) :
    collision_model(DrakeCollision::newModel())
{
  num_positions = 0;
  num_bodies = 0;
  num_frames = 0;
  a_grav << 0, 0, 0, 0, 0, -9.81;
  resize(ndof, num_rigid_body_objects, num_rigid_body_frames);
}
{'fraction_non_alphanumeric': 0.16230979321108077, 'fraction_numerical': 0.009364026531408505, 'mean_word_length': 4.990654205607477, 'pattern_counts': {'":': 0, '<': 74, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2970339', 'n_tokens_mistral': 1033, 'n_tokens_neox': 997, 'n_words': 209}