Drake
drake::systems::detail Namespace Reference

Classes

class  ModelValues
 Represents models for a sequence of AbstractValues (usually a sequence of either input or output ports). More...
 
class  ODESystem
 A LeafSystem subclass used to describe parameterized ODE systems i.e. More...
 

Functions

template<typename S >
MatrixX< doubleExtractDoublesOrThrow (const MatrixX< S > &input_matrix)
 Converts a matrix with scalar type S elements to a matrix with double type elements, failing at runtime if the type cannot be converted. More...
 
template<typename S >
std::vector< doubleExtractDoublesOrThrow (const std::vector< S > &input_vector)
 Converts an STL vector of scalar type S elements to an STL vector of double type elements, failing at runtime if the type cannot be converted. More...
 
template<typename S >
std::vector< MatrixX< double > > ExtractDoublesOrThrow (const std::vector< MatrixX< S >> &input_vector)
 Converts an STL vector of matrices with scalar type S elements to an STL vector of matrices with double type elements, failing at runtime if the type cannot be converted. More...
 
template<typename T >
void CheckBasicVectorInvariants (const BasicVector< T > *basic_vector)
 Checks some BasicVector invariants on basic_vector. More...
 
template<typename T >
void CheckVectorValueInvariants (const AbstractValue *abstract_value)
 If abstract_value is a Value<BasicVector<T>>, then checks some BasicVector invariants. More...
 

Function Documentation

◆ CheckBasicVectorInvariants()

void drake::systems::detail::CheckBasicVectorInvariants ( const BasicVector< T > *  basic_vector)

Checks some BasicVector invariants on basic_vector.

Because this function uses shady implementation tricks, it should ONLY be called from within DRAKE_ASSERT_VOID or unit test code.

This function is likely to be expensive (on the order of a full copy), so should be used sparingly. In particular, only a few select locations within the Systems Framework itself should likely call this function.

Exceptions
std::exceptionif invariants are violated or basic_vector is nullptr

◆ CheckVectorValueInvariants()

void drake::systems::detail::CheckVectorValueInvariants ( const AbstractValue abstract_value)

If abstract_value is a Value<BasicVector<T>>, then checks some BasicVector invariants.

Otherwise, does nothing.

Because this function uses shady implementation tricks, it should ONLY be called from within DRAKE_ASSERT_VOID or unit test code.

This function is likely to be expensive (on the order of a full copy), so should be used sparingly. In particular, only a few select locations within the Systems Framework itself should likely call this function.

Template Parameters
Tthe supposed element type of the Value<BasicVector<T>> that has been erased into an AbstractValue
Exceptions
std::exceptionif invariants are violated or abstract_value is nullptr

◆ ExtractDoublesOrThrow() [1/3]

MatrixX<double> drake::systems::detail::ExtractDoublesOrThrow ( const MatrixX< S > &  input_matrix)

Converts a matrix with scalar type S elements to a matrix with double type elements, failing at runtime if the type cannot be converted.

See also
ExtractDoubleOrThrow(const T&)
Template Parameters
SA valid Eigen scalar type.

◆ ExtractDoublesOrThrow() [2/3]

std::vector<double> drake::systems::detail::ExtractDoublesOrThrow ( const std::vector< S > &  input_vector)

Converts an STL vector of scalar type S elements to an STL vector of double type elements, failing at runtime if the type cannot be converted.

See also
ExtractDoubleOrThrow(const T&)
Template Parameters
SA valid Eigen scalar type.

◆ ExtractDoublesOrThrow() [3/3]

std::vector<MatrixX<double> > drake::systems::detail::ExtractDoublesOrThrow ( const std::vector< MatrixX< S >> &  input_vector)

Converts an STL vector of matrices with scalar type S elements to an STL vector of matrices with double type elements, failing at runtime if the type cannot be converted.

See also
ExtractDoublesOrThrow(const MatrixX<T>&)
Template Parameters
SA valid Eigen scalar type.