std::shared_ptr< VectorSpace > extractSubSpaceImpl( const VectorSpace& space, unsigned global_id ) { if ( is< ProductSpace::VectorCreator >( space.creator() ) ) { const auto& product_space_creator = cast_ref< ProductSpace::VectorCreator >( space.creator() ); const auto& subSpaces = product_space_creator.subSpaces(); std::shared_ptr< VectorSpace > result; for ( auto i = 0u; i < subSpaces.size(); ++i ) { if ( product_space_creator.inverseIdMap( i ) == global_id && !is< ProductSpace::VectorCreator >( subSpaces[ i ]->creator() ) ) return subSpaces[ i ]; if ( is< ProductSpace::VectorCreator >( subSpaces[ i ]->creator() ) ) { auto result = extractSubSpaceImpl( *subSpaces[ i ], global_id ); if ( result ) return result; } } } return nullptr; }
LinearOperatorCreator::LinearOperatorCreator( const VectorSpace& X, const VectorSpace& Y ) : Generic::LinearOperatorCreator< LinearOperator >( [&X, &Y]( const VectorSpace* space ) { return LinearOperator( ::Eigen::MatrixXd::Zero( cast_ref< VectorCreator >( X.creator() ).dim(), cast_ref< VectorCreator >( Y.creator() ).dim() ), *space, X, Y ); }, X, Y ) { }