Drake
Adder< T > Class Template Reference

An adder for arbitrarily many inputs of equal length. More...

#include <drake/systems/framework/primitives/adder.h>

Inheritance diagram for Adder< T >:
Collaboration diagram for Adder< T >:

Public Member Functions

 Adder (int num_inputs, int length)
 
std::unique_ptr< Context< T > > CreateDefaultContext () const override
 Allocates the number of input ports specified in the constructor. More...
 
std::unique_ptr< SystemOutput< T > > AllocateOutput () const override
 Allocates one output port of the width specified in the constructor. More...
 
void EvalOutput (const Context< T > &context, SystemOutput< T > *output) const override
 Sums the input ports into the output port. More...
 
std::string get_name () const override
 TODO(david-german-tri): Make this configurable in the constructor. More...
 
- Public Member Functions inherited from SystemInterface< T >
virtual T EvalPotentialEnergy (const Context< T > &context) const
 Return the potential energy currently stored in the configuration provided in the given Context. More...
 
virtual T EvalKineticEnergy (const Context< T > &context) const
 Return the kinetic energy currently present in the motion provided in the given Context. More...
 
- Public Member Functions inherited from AbstractSystemInterface
virtual ~AbstractSystemInterface ()
 

Additional Inherited Members

- Protected Member Functions inherited from SystemInterface< T >
 SystemInterface ()
 
- Protected Member Functions inherited from AbstractSystemInterface
 AbstractSystemInterface ()
 

Detailed Description

template<typename T>
class drake::systems::Adder< T >

An adder for arbitrarily many inputs of equal length.

Template Parameters
TThe type of mathematical object being added.

Constructor & Destructor Documentation

Adder ( int  num_inputs,
int  length 
)
Parameters
num_inputsis the number of input ports to be added.
lengthis the size of each input port.

Member Function Documentation

std::unique_ptr< SystemOutput< T > > AllocateOutput ( ) const
overridevirtual

Allocates one output port of the width specified in the constructor.

Implements SystemInterface< T >.

std::unique_ptr< Context< T > > CreateDefaultContext ( ) const
overridevirtual

Allocates the number of input ports specified in the constructor.

Allocates no state.

Implements SystemInterface< T >.

void EvalOutput ( const Context< T > &  context,
SystemOutput< T > *  output 
) const
overridevirtual

Sums the input ports into the output port.

If the input ports are not of number num_inputs_ or size length_, std::runtime_error will be thrown.

Implements SystemInterface< T >.

Here is the call graph for this function:

std::string get_name ( ) const
inlineoverridevirtual

TODO(david-german-tri): Make this configurable in the constructor.

Implements AbstractSystemInterface.


The documentation for this class was generated from the following files: