<commit_before>#include <aleph/containers/PointCloud.hh>

#include <tests/Base.hh>

#include <iostream>
#include <string>
#include <vector>

using namespace aleph::containers;
using namespace aleph;

template <class T> void testFormats()
{
  ALEPH_TEST_BEGIN( "Point cloud formats" );

  using PointCloud = PointCloud<T>;

  std::vector<PointCloud> pointClouds;
  pointClouds.reserve( 4 );

  pointClouds.emplace_back( load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_colon_separated.txt" ) ) );
  pointClouds.emplace_back( load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_comma_separated.txt" ) ) );
  pointClouds.emplace_back( load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_space_separated.txt" ) ) );
  pointClouds.emplace_back( load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_tab_separated.txt"   ) ) );

  for( auto&& pc : pointClouds )
  {
    ALEPH_ASSERT_THROW( pc.size()      == 150 );
    ALEPH_ASSERT_THROW( pc.dimension() == 4 );
    ALEPH_ASSERT_THROW( pc.empty()     == false );
  }

  for( auto&& pc1 : pointClouds )
    for( auto&& pc2 : pointClouds )
      ALEPH_ASSERT_THROW( pc1 == pc2 );

  ALEPH_TEST_END();
}

template <class T> void testAccess()
{
  ALEPH_TEST_BEGIN( "Point cloud access" );

  auto pc
    = load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_comma_separated.txt" ) );

  {
    std::vector<T> actual;
    std::vector<T> expected = { static_cast<T>( 5.9 ),
                                static_cast<T>( 3.0 ),
                                static_cast<T>( 5.1 ),
                                static_cast<T>( 1.8 ) };

    pc.get( 149, std::back_inserter( actual ) );

    ALEPH_ASSERT_THROW( actual == expected );
  }

  {
    std::vector<T> p = { T(1), T(2), T(3), T(4) };<commit_msg>Updated point cloud test<commit_after>#include <aleph/containers/PointCloud.hh>

#include <tests/Base.hh>

#include <iostream>
#include <string>
#include <vector>

using namespace aleph::containers;
using namespace aleph;

template <class T> void testFormats()
{
  ALEPH_TEST_BEGIN( "Point cloud formats" );

  using PointCloud = PointCloud<T>;

  std::vector<PointCloud> pointClouds;
  pointClouds.reserve( 4 );

  pointClouds.emplace_back( load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_colon_separated.txt" ) ) );
  pointClouds.emplace_back( load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_comma_separated.txt" ) ) );
  pointClouds.emplace_back( load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_space_separated.txt" ) ) );
  pointClouds.emplace_back( load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_tab_separated.txt"   ) ) );

  for( auto&& pc : pointClouds )
  {
    ALEPH_ASSERT_EQUAL( pc.size(),      150 );
    ALEPH_ASSERT_EQUAL( pc.dimension(),   4 );
    ALEPH_ASSERT_THROW( pc.empty() == false );
  }

  for( auto&& pc1 : pointClouds )
    for( auto&& pc2 : pointClouds )
      ALEPH_ASSERT_THROW( pc1 == pc2 );

  ALEPH_TEST_END();
}

template <class T> void testAccess()
{
  ALEPH_TEST_BEGIN( "Point cloud access" );

  auto pc
    = load<T>( CMAKE_SOURCE_DIR + std::string( "/tests/input/Iris_comma_separated.txt" ) );

  {
    std::vector<T> actual;
    std::vector<T> expected = { static_cast<T>( 5.9 ),
                                static_cast<T>( 3.0 ),
                                static_cast<T>( 5.1 ),
                                static_cast<T>( 1.8 ) };

    pc.get( 149, std::back_inserter( actual ) );

    ALEPH_ASSERT_THROW( actual == expected );
  }

  {
    std::vector<T> p = { T(1), T(2), T(3), T(4) };
{'fraction_non_alphanumeric': 0.1531153953618329, 'fraction_numerical': 0.013411567476948869, 'mean_word_length': 3.272076372315036, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, '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': '4908611', 'n_tokens_mistral': 1370, 'n_tokens_neox': 1277, 'n_words': 237}