<commit_before>// $Id$
//
//  Copyright (C) 2004-2006 Rational Discovery LLC
//
//   @@ All Rights Reserved  @@
//
#define PY_ARRAY_UNIQUE_SYMBOL rdalignment_array_API
#include <boost/python.hpp>
#include <boost/python/numeric.hpp>
#include "Numeric/arrayobject.h"

#include <RDBoost/PySequenceHolder.h>
#include <RDBoost/Wrap.h>

#include <Numerics/Alignment/AlignPoints.h>

namespace python = boost::python;

namespace RDNumeric {
  namespace Alignments {
    void GetPointsFromPythonSequence(python::object &points,
				     RDGeom::Point3DConstPtrVect &pts){
      PyObject *pyObj=points.ptr();
      unsigned int nrows, ncols;
      double *data;
      if (PyArray_Check(pyObj)) {
        // get the dimensions of the array
        PyArrayObject *ptsMat = reinterpret_cast<PyArrayObject *>(pyObj);
        nrows = ptsMat->dimensions[0];
        ncols = ptsMat->dimensions[1];
        
        if (ncols != 3) 
          throw_value_error("Wrong dimension for the points array");
        
        data = reinterpret_cast<double *>(ptsMat->data);

        for (unsigned int i = 0; i < nrows; i++) {
          RDGeom::Point3D *rpt = new RDGeom::Point3D(data[i*3],
						     data[i*3+1],
						     data[i*3+2]);
          pts.push_back(rpt);
        }
      } else if(PySequence_Check(pyObj)) {
	nrows = PySequence_Size(pyObj);<commit_msg>All typedefs based on points move to point.h - depencies updated here<commit_after>// $Id$
//
//  Copyright (C) 2004-2006 Rational Discovery LLC
//
//   @@ All Rights Reserved  @@
//
#define PY_ARRAY_UNIQUE_SYMBOL rdalignment_array_API
#include <boost/python.hpp>
#include <boost/python/numeric.hpp>
#include "Numeric/arrayobject.h"

#include <RDBoost/PySequenceHolder.h>
#include <RDBoost/Wrap.h>
#include <Geometry/point.h>

#include <Numerics/Alignment/AlignPoints.h>

namespace python = boost::python;

namespace RDNumeric {
  namespace Alignments {
    void GetPointsFromPythonSequence(python::object &points,
				     RDGeom::Point3DConstPtrVect &pts){
      PyObject *pyObj=points.ptr();
      unsigned int nrows, ncols;
      double *data;
      if (PyArray_Check(pyObj)) {
        // get the dimensions of the array
        PyArrayObject *ptsMat = reinterpret_cast<PyArrayObject *>(pyObj);
        nrows = ptsMat->dimensions[0];
        ncols = ptsMat->dimensions[1];
        
        if (ncols != 3) 
          throw_value_error("Wrong dimension for the points array");
        
        data = reinterpret_cast<double *>(ptsMat->data);

        for (unsigned int i = 0; i < nrows; i++) {
          RDGeom::Point3D *rpt = new RDGeom::Point3D(data[i*3],
						     data[i*3+1],
						     data[i*3+2]);
          pts.push_back(rpt);
        }
      } else if(PySequence_Check(pyObj)) {
	nrows = PySequence_Size(pyObj);
{'fraction_non_alphanumeric': 0.1282514450867052, 'fraction_numerical': 0.014450867052023121, 'mean_word_length': 2.9557142857142855, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 24, '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': '4032236', 'n_tokens_mistral': 992, 'n_tokens_neox': 919, 'n_words': 197}