Tudat/Astrodynamics/OrbitDetermination/RotationalDynamicsPartials/inertialTorquePartial.cpp
//! Function for setting up and retrieving a function returning a partial w.r.t. a double parameter.

Function for setting up and retrieving a function returning a partial w.r.t. a double parameter.
Function for setting up and retrieving a function returning a partial w . r . t . a double parameter .
std::pair< std::function< void( Eigen::MatrixXd& ) >, int >
InertialTorquePartial::getParameterPartialFunction( std::shared_ptr< estimatable_parameters::EstimatableParameter< double > > parameter )
{
    using namespace estimatable_parameters;
    std::pair< std::function< void( Eigen::MatrixXd& ) >, int >  partialFunction = std::make_pair(
                std::function< void( Eigen::MatrixXd& ) >( ), 0 );
    if( parameter->getParameterName( ).second.first == bodyUndergoingTorque_ )
    {
        switch( parameter->getParameterName( ).first )
        {
        case gravitational_parameter:
        {
            if( bodyGravitationalParameterFunction_ == nullptr )
            {
                throw std::runtime_error( "Error when getting partial of inertial torque w.r.t. gravitational parameter, gravitational parameter function not found." );
            }
            partialFunction = std::make_pair(
                        std::bind( &InertialTorquePartial::wrtGravitationalParameter, this, std::placeholders::_1 ), 1 );
            break;
        }
        case mean_moment_of_inertia:
        {
            if( getInertiaTensorNormalizationFactor_ == nullptr )
            {
                throw std::runtime_error( "Error when getting partial of inertial torque w.r.t. mean moment of inertia, inertia tensor normalization function not found." );
            }
            partialFunction = std::make_pair(
                        std::bind( &InertialTorquePartial::wrtMeanMomentOfInertia, this, std::placeholders::_1 ), 1 );
            break;
        }
        default:
            break;
        }
    }
    return partialFunction;
}
std :: pair < std :: function < void ( Eigen :: MatrixXd & ) > , int > InertialTorquePartial :: getParameterPartialFunction ( std :: shared_ptr < estimatable_parameters :: EstimatableParameter < double > > parameter ) { using namespace estimatable_parameters ; std :: pair < std :: function < void ( Eigen :: MatrixXd & ) > , int > partialFunction = std :: make_pair ( std :: function < void ( Eigen :: MatrixXd & ) > ( ) , 0 ) ; if ( parameter -> getParameterName ( ) . second . first == bodyUndergoingTorque_ ) { switch ( parameter -> getParameterName ( ) . first ) { case gravitational_parameter : { if ( bodyGravitationalParameterFunction_ == nullptr ) { throw std :: runtime_error ( " " ) ; } partialFunction = std :: make_pair ( std :: bind ( & InertialTorquePartial :: wrtGravitationalParameter , this , std :: placeholders :: _1 ) , 1 ) ; break ; } case mean_moment_of_inertia : { if ( getInertiaTensorNormalizationFactor_ == nullptr ) { throw std :: runtime_error ( " " ) ; } partialFunction = std :: make_pair ( std :: bind ( & InertialTorquePartial :: wrtMeanMomentOfInertia , this , std :: placeholders :: _1 ) , 1 ) ; break ; } default : break ; } } return partialFunction ; }
Function for setting up and retrieving a function returning a partial w.r.t.
Function for setting up and retrieving a function returning a partial w . r . t .