<commit_before>/**
 * @file KeyPoint.cpp
 *
 * @brief Class to handle the key points.
 *
 * @author <NAME> <<EMAIL>>
 **/


//! Global includes
#include <iostream>
#include <math.h>


//! Local includes
#include "KeyPoint.h"
#include "../Utilities/Memory.h"
#include "../Utilities/Utilities.h"
#include "../LibSSE/LibSSE.h"


using namespace std;


//! Default constructor
KeyPoint::KeyPoint() :

  m_x(0.f),
  m_y(0.f),
  m_sigma(0.f),
  m_theta(0.f),

  m_o(0),
  m_s(0),
  m_i(0),
  m_j(0),

  m_val(0.f),
  m_edgeResp(0.f),
  m_nbHist(0),
  m_nbOri(0),
  m_descriptors(NULL),

  m_nbBins(0),
  m_oriHist(NULL) {
}


//! Copy constructor.
KeyPoint::KeyPoint(
  const KeyPoint& i_keyPoint) :

  m_x(i_keyPoint.m_x),
  m_y(i_keyPoint.m_y),
  m_sigma(i_keyPoint.m_sigma),
  m_theta(i_keyPoint.m_theta),

  m_o(i_keyPoint.m_o),
  m_s(i_keyPoint.m_s),
  m_i(i_keyPoint.m_i),
  m_j(i_keyPoint.m_j),

  m_val(i_keyPoint.m_val),
  m_edgeResp(i_keyPoint.m_edgeResp),
  m_nbHist(i_keyPoint.m_nbHist),
  m_nbOri(i_keyPoint.m_nbOri),
  m_descriptors((float*) memalloc(16, m_nbOri * m_nbHist * m_nbHist * sizeof(float))),

  m_nbBins(i_keyPoint.m_nbBins),
  m_oriHist((float*) memalloc(16, m_nbBins * sizeof(float))) {

  //! Copy the data
  for (size_t n = 0; n < m_nbOri * m_nbHist * m_nbHist; n++) {
    m_descriptors[n] = i_keyPoint.m_descriptors[n];
  }

  for (size_t n = 0; n < m_nbBins; n++) {
    m_oriHist[n] = i_keyPoint.m_oriHist[n];
  }
}<commit_msg>[sift] BUG fix off-by-one error in malloc (Rhaaaa Marc you stole my morning!)<commit_after>/**
 * @file KeyPoint.cpp
 *
 * @brief Class to handle the key points.
 *
 * @author <NAME> <<EMAIL>>
 **/


//! Global includes
#include <iostream>
#include <math.h>


//! Local includes
#include "KeyPoint.h"
#include "../Utilities/Memory.h"
#include "../Utilities/Utilities.h"
#include "../LibSSE/LibSSE.h"


using namespace std;


//! Default constructor
KeyPoint::KeyPoint() :

  m_x(0.f),
  m_y(0.f),
  m_sigma(0.f),
  m_theta(0.f),

  m_o(0),
  m_s(0),
  m_i(0),
  m_j(0),

  m_val(0.f),
  m_edgeResp(0.f),
  m_nbHist(0),
  m_nbOri(0),
  m_descriptors(NULL),

  m_nbBins(0),
  m_oriHist(NULL) {
}


//! Copy constructor.
KeyPoint::KeyPoint(
  const KeyPoint& i_keyPoint) :

  m_x(i_keyPoint.m_x),
  m_y(i_keyPoint.m_y),
  m_sigma(i_keyPoint.m_sigma),
  m_theta(i_keyPoint.m_theta),

  m_o(i_keyPoint.m_o),
  m_s(i_keyPoint.m_s),
  m_i(i_keyPoint.m_i),
  m_j(i_keyPoint.m_j),

  m_val(i_keyPoint.m_val),
  m_edgeResp(i_keyPoint.m_edgeResp),
  m_nbHist(i_keyPoint.m_nbHist),
  m_nbOri(i_keyPoint.m_nbOri),
  m_descriptors((float*) memalloc(16, m_nbOri * (m_nbHist + 1) * (m_nbHist + 1) * sizeof(float))),

  m_nbBins(i_keyPoint.m_nbBins),
  m_oriHist((float*) memalloc(16, m_nbBins * sizeof(float))) {

  //! Copy the data
  for (size_t n = 0; n < m_nbOri * m_nbHist * m_nbHist; n++) {
    m_descriptors[n] = i_keyPoint.m_descriptors[n];
  }

  for (size_t n = 0; n < m_nbBins; n++) {
    m_oriHist[n] = i_keyPoint.m_oriHist[n];
  }
}
{'fraction_non_alphanumeric': 0.17538564721663313, 'fraction_numerical': 0.01341381623071764, 'mean_word_length': 3.930578512396694, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, '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': '6785462', 'n_tokens_mistral': 1449, 'n_tokens_neox': 1404, 'n_words': 218}