Lodestar
An integrated real-time control package in C++
|
|
5 #ifndef LODESTAR_UNARYMEANBLOCK_HPP
6 #define LODESTAR_UNARYMEANBLOCK_HPP
8 #include <Lodestar/blocks/Block.hpp>
9 #include <Lodestar/aux/TemplateTools.hpp>
14 #define OUTPUT_UNARYMEANBLOCK() \
15 typename ::std::conditional<ls::aux::TemplateTraits::BinaryOperators::parseMatrixLike<TInput>::value, typename ls::aux::TemplateTraits::BinaryOperators::parseMatrixLike<TInput>::scalar, TInput>::type
17 template<
typename TInput>
21 ::std::tuple<OUTPUT_UNARYMEANBLOCK()>,
28 ::std::tuple<OUTPUT_UNARYMEANBLOCK()>,
33 static_assert(InputTrait::value,
"Input must be matrix-like; otherwise same value would be returned.");
35 using OutputType = OUTPUT_UNARYMEANBLOCK();
46 this->equation = [](
Base &b) ->
void {
47 b.template o<0>() = b.template i<0>().object.mean();
53 template<
typename TInput>
70 static const ::std::array<::std::string, kIns>
inTypes;
71 static const ::std::array<::std::string, kOuts>
outTypes;
72 static const ::std::array<::std::string, kPars>
parTypes;
77 template<
typename TInput>
79 {demangle(
typeid(TInput).name())};
81 template<
typename TInput>
82 const ::std::array<::std::string, BlockTraits<std::UnaryMeanBlock<TInput>>::kOuts> BlockTraits<std::UnaryMeanBlock<TInput>>::outTypes =
83 {demangle(
typeid(
typename std::UnaryMeanBlock<TInput>::OutputType).name())};
85 template<
typename TInput>
86 const ::std::array<::std::string, BlockTraits<std::UnaryMeanBlock<TInput>>::kPars> BlockTraits<std::UnaryMeanBlock<TInput>>::parTypes =
89 template<
typename TInput>
90 const ::std::array<::std::string, 1> BlockTraits<std::UnaryMeanBlock<TInput>>::templateTypes =
91 {demangle(
typeid(TInput).name())};
95 #undef OUTPUT_UNARYMEANBLOCK
97 #endif //LODESTAR_UNARYMEANBLOCK_HPP
static constexpr const bool directFeedthrough
Whether or not the block has direct feedthrough.
Definition: BlockTraits.hpp:44
A traits object that exposes information about TBlock.
Definition: BlockTraits.hpp:37
static const ::std::array<::std::string, kIns > inTypes
Input types (as strings).
Definition: BlockTraits.hpp:59
BlockType
Block type information.
Definition: BlockType.hpp:25
Extracts data from matrix-like types.
Definition: TemplateTraits.hpp:114
Main Lodestar code.
Definition: BilinearTransformation.hpp:12
static const ::std::array<::std::string, kOuts > outTypes
Output types (as strings).
Definition: BlockTraits.hpp:61
static constexpr const BlockType blockType
Block type.
Definition: BlockTraits.hpp:42
static const ::std::array<::std::string, 1 > templateTypes
Template parameter types (as strings).
Definition: BlockTraits.hpp:66
Generic base template class for all tuple-based Block instances.
Definition: Block.hpp:45
static const constexpr int kIns
Number of input slots.
Definition: BlockTraits.hpp:52
@ UnaryMeanBlock
Unary mean value block.
Definition: UnaryMeanBlock.hpp:18
static const ::std::array<::std::string, kPars > parTypes
Parameter types (as strings).
Definition: BlockTraits.hpp:63
static const constexpr int kPars
Number of parameters.
Definition: BlockTraits.hpp:56
static const constexpr int kOuts
Number of output slots.
Definition: BlockTraits.hpp:54