<commit_before>/*    Copyright (c) 2010-2017, Delft University of Technology
 *    All rigths reserved
 *
 *    This file is part of the Tudat. Redistribution and use in source and
 *    binary forms, with or without modification, are permitted exclusively
 *    under the terms of the Modified BSD license. You should have received
 *    a copy of the license with this file. If not, please or visit:
 *    http://tudat.tudelft.nl/LICENSE.
 */

#define BOOST_TEST_MAIN


#include <limits>

#include <boost/test/unit_test.hpp>

#include "Tudat/Astrodynamics/OrbitDetermination/UnitTests/orbitDeterminationTestCases.h"


namespace tudat
{
namespace unit_tests
{
BOOST_AUTO_TEST_SUITE( test_estimation_from_positions )



//! This test checks, for double states/observables and double time, if the orbit determination correctly converges
//! when simulating data, perturbing the dynamical parameters, and then retrieving the original parameters
BOOST_AUTO_TEST_CASE( test_EstimationFromPosition )
{
    for( int simulationType = 0; simulationType < 5; simulationType++ )
    {

        std::cout<<"=============================================== Running Case: "<<simulationType<<std::endl;

        // Simulate estimated parameter error.
        Eigen::VectorXd totalError;

        totalError = executePlanetaryParameterEstimation< double, double >( simulationType ).second;

        // Adjust tolerance based on simulation settings
        double toleranceMultiplier = 20.0;

        // Check error.
        for( unsigned int j = 0; j < 3; j++ )
        {
            BOOST_CHECK_SMALL( totalError( j ), toleranceMultiplier * 5.0E-3 );
        }

        for( unsigned int j = 0; j < 3; j++ )
        {
            BOOST_CHECK_SMALL( totalError( j + 3 ), toleranceMultiplier * 1.0E-7 );
        }

        BOOST_CHECK_SMALL( totalError( 6 ), toleranceMultiplier * 1.0E3 );
        std::cout<<totalError.transpose( )<<std::endl;
    }

    std::pair< boost::shared_ptr< simulation_setup::PodOutput< double > >,
<<<<<<< HEAD
    boost::shared_ptr< simulation_setup::PodInput< double, double > > > podDataOutput;
    Eigen::VectorXd estimationError = tudat::unit_tests::executeEarthOrbiterParameterEstimation< double, double >(
                 podDataOutput );
=======
    boost::shared_ptr< simulation_setup::PodInput< double, double > > > podDataPair;
    Eigen::VectorXd estimationError = tudat::unit_tests::executeEarthOrbiterParameterEstimation< double, double >(
                 podDataPair );
>>>>>>> TidalLoveNumberEstimation

    for( unsigned int i = 0; i < 3; i++ )
    {
        BOOST_CHECK_SMALL( std::fabs( estimationError( i ) ), 5.0E-3 );
        BOOST_CHECK_SMALL( std::fabs( estimationError( i + 3 ) ), 5.0E-7 );
        BOOST_CHECK_SMALL( std::fabs( estimationError( i + 18 ) ), 2.0E-4 );
    }

    BOOST_CHECK_SMALL( std::fabs( estimationError( 6 ) ), 5.0E-6 );
    BOOST_CHECK_SMALL( std::fabs( estimationError( 7 ) ), 5.0E-6 );
    BOOST_CHECK_SMALL( std::fabs( estimationError( 8 ) ), 5.0E-6 );

    BOOST_CHECK_SMALL( std::fabs( estimationError( 9 ) ), 5.0E-11 );
    BOOST_CHECK_SMALL( std::fabs( estimationError( 10 ) ), 5.0E-11 );
    BOOST_CHECK_SMALL( std::fabs( estimationError( 11 ) ), 5.0E-11 );

    for( unsigned int i = 0; i < 6; i++ )
    {
        BOOST_CHECK_SMALL( std::fabs( estimationError( i + 11 ) ), 5.0E-12 );
    }

}

BOOST_AUTO_TEST_SUITE_END( )

}<commit_msg>Fixed wrong merge conflict resolution<commit_after>/*    Copyright (c) 2010-2017, Delft University of Technology
 *    All rigths reserved
 *
 *    This file is part of the Tudat. Redistribution and use in source and
 *    binary forms, with or without modification, are permitted exclusively
 *    under the terms of the Modified BSD license. You should have received
 *    a copy of the license with this file. If not, please or visit:
 *    http://tudat.tudelft.nl/LICENSE.
 */

#define BOOST_TEST_MAIN


#include <limits>

#include <boost/test/unit_test.hpp>

#include "Tudat/Astrodynamics/OrbitDetermination/UnitTests/orbitDeterminationTestCases.h"


namespace tudat
{
namespace unit_tests
{
BOOST_AUTO_TEST_SUITE( test_estimation_from_positions )



//! This test checks, for double states/observables and double time, if the orbit determination correctly converges
//! when simulating data, perturbing the dynamical parameters, and then retrieving the original parameters
BOOST_AUTO_TEST_CASE( test_EstimationFromPosition )
{
    for( int simulationType = 0; simulationType < 5; simulationType++ )
    {

        std::cout<<"=============================================== Running Case: "<<simulationType<<std::endl;

        // Simulate estimated parameter error.
        Eigen::VectorXd totalError;

        totalError = executePlanetaryParameterEstimation< double, double >( simulationType ).second;

        // Adjust tolerance based on simulation settings
        double toleranceMultiplier = 20.0;

        // Check error.
        for( unsigned int j = 0; j < 3; j++ )
        {
            BOOST_CHECK_SMALL( totalError( j ), toleranceMultiplier * 5.0E-3 );
        }

        for( unsigned int j = 0; j < 3; j++ )
        {
            BOOST_CHECK_SMALL( totalError( j + 3 ), toleranceMultiplier * 1.0E-7 );
        }

        BOOST_CHECK_SMALL( totalError( 6 ), toleranceMultiplier * 1.0E3 );
        std::cout<<totalError.transpose( )<<std::endl;
    }

    std::pair< boost::shared_ptr< simulation_setup::PodOutput< double > >,
    boost::shared_ptr< simulation_setup::PodInput< double, double > > > podDataOutput;
    Eigen::VectorXd estimationError = tudat::unit_tests::executeEarthOrbiterParameterEstimation< double, double >(
                 podDataOutput );

    for( unsigned int i = 0; i < 3; i++ )
    {
        BOOST_CHECK_SMALL( std::fabs( estimationError( i ) ), 5.0E-3 );
        BOOST_CHECK_SMALL( std::fabs( estimationError( i + 3 ) ), 5.0E-7 );
        BOOST_CHECK_SMALL( std::fabs( estimationError( i + 18 ) ), 2.0E-4 );
    }

    BOOST_CHECK_SMALL( std::fabs( estimationError( 6 ) ), 5.0E-6 );
    BOOST_CHECK_SMALL( std::fabs( estimationError( 7 ) ), 5.0E-6 );
    BOOST_CHECK_SMALL( std::fabs( estimationError( 8 ) ), 5.0E-6 );

    BOOST_CHECK_SMALL( std::fabs( estimationError( 9 ) ), 5.0E-11 );
    BOOST_CHECK_SMALL( std::fabs( estimationError( 10 ) ), 5.0E-11 );
    BOOST_CHECK_SMALL( std::fabs( estimationError( 11 ) ), 5.0E-11 );

    for( unsigned int i = 0; i < 6; i++ )
    {
        BOOST_CHECK_SMALL( std::fabs( estimationError( i + 11 ) ), 5.0E-12 );
    }

}

BOOST_AUTO_TEST_SUITE_END( )

}
{'fraction_non_alphanumeric': 0.12986418434304897, 'fraction_numerical': 0.024111094155348695, 'mean_word_length': 3.3061760840998686, 'pattern_counts': {'":': 0, '<': 61, '<?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': '6445213', 'n_tokens_mistral': 2211, 'n_tokens_neox': 2016, 'n_words': 529}