<commit_before>/*
 * Copyright (c) 2016 <NAME> (<EMAIL>)
 * Distributed under the MIT License.
 * See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT
 */

#include <cstdlib>
#include <iostream>
#include <sstream>
#include <fstream>

#include "NAOS/ellipsoidSurfacePoints.hpp"
#include "NAOS/cubicRoot.hpp"
#include "NAOS/constants.hpp"
#include "NAOS/ellipsoidGravitationalAcceleration.hpp"

int main( const int numberOfInputs, const char* inputArguments[ ] )
{
    // Generate points for the surface of an ellipsoid.
    std::ostringstream ellipsoidSurfacePointsFile;
    ellipsoidSurfacePointsFile << "../../data/ellipsoidSurfacePoints.csv";
    naos::computeEllipsoidSurfacePoints( 12.0, 8.0, 5.0, 10.0, 10.0 , ellipsoidSurfacePointsFile );

    // Test functionality of the maximum real root for a cubic polynomial, compare results with
    // wolfram alpha.
    const double maxRealRootTest1 = naos::computeMaxRealCubicRoot( -7.0, 4.0, 12.0 );
    std::cout << "max Real Root Test 1 = " << maxRealRootTest1 << std::endl;
    const double maxRealRootTest2 = naos::computeMaxRealCubicRoot( ( 3.0 / 2.0 ),
                                                                   ( -11.0 / 2.0 ),
                                                                   ( -3.0 ) );
    std::cout << "max Real Root Test 2 = " << maxRealRootTest2 << std::endl;

    // Test evaluate gravitational acceleration using previously computed surface points.


    return EXIT_SUCCESS;
}<commit_msg>add test snippet to read numeric data from a CSV file<commit_after>/*
 * Copyright (c) 2016 <NAME> (<EMAIL>)
 * Distributed under the MIT License.
 * See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT
 */

#include <cstdlib>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>

#include "NAOS/ellipsoidSurfacePoints.hpp"
#include "NAOS/cubicRoot.hpp"
#include "NAOS/constants.hpp"
#include "NAOS/ellipsoidGravitationalAcceleration.hpp"

int main( const int numberOfInputs, const char* inputArguments[ ] )
{
    // Generate points for the surface of an ellipsoid.
    std::ostringstream ellipsoidSurfacePointsFile;
    ellipsoidSurfacePointsFile << "../../data/ellipsoidSurfacePoints.csv";
    naos::computeEllipsoidSurfacePoints( 12.0, 8.0, 5.0, 10.0, 10.0 , ellipsoidSurfacePointsFile );

    // Test functionality of the maximum real root for a cubic polynomial, compare results with
    // wolfram alpha.
    const double maxRealRootTest1 = naos::computeMaxRealCubicRoot( -7.0, 4.0, 12.0 );
    std::cout << "max Real Root Test 1 = " << maxRealRootTest1 << std::endl;
    const double maxRealRootTest2 = naos::computeMaxRealCubicRoot( ( 3.0 / 2.0 ),
                                                                   ( -11.0 / 2.0 ),
                                                                   ( -3.0 ) );
    std::cout << "max Real Root Test 2 = " << maxRealRootTest2 << std::endl;

    // Test evaluate gravitational acceleration using previously computed surface points.
    std::ifstream ellipsoidSurfacePoints;
    ellipsoidSurfacePoints.open( "../../data/ellipsoidSurfacePoints.csv" );
    std::string headers;
    std::getline( ellipsoidSurfacePoints, headers );
    std::cout << headers << std::endl;
    double xCoordinate = 0.0;
    std::string numberString;
    std::getline( ellipsoidSurfacePoints, numberString, ',' );
    xCoordinate = std::stod( numberString );
    std::cout << xCoordinate << std::endl;

    return EXIT_SUCCESS;
}
{'fraction_non_alphanumeric': 0.11806543385490754, 'fraction_numerical': 0.023897581792318635, 'mean_word_length': 2.87651598676957, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6089185', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1034, 'n_words': 280}