Skip to content

sam::Parameter

An abstract representation of a random variable parameter. More...

#include <Parameter.h>

Inherits from arma::Row< T >

Public Functions

Name
Parameter()
Parameter(const arma::Row< T > & X)
Parameter(std::initializer_list< T > l)
Parameter(const json & j, size_t size)
Constructs a parameter based on the given JSON object.
operator T()
Returns the first element of the array.
Parameter< T > & operator()()
Randomizes and returns the save Parameter.
bool isDist()
Returns true if a distribution is assigned to the Parameter.

Detailed Description

template <typename T >
class sam::Parameter;

An abstract representation of a random variable parameter.

Template Parameters:

  • T Type of the parameter

Attention: Parameter is inherited from arma::Row. This is quite useful and essential because I can pass it around easily, and use all the overloaded operators of the arma::Row

This is designed to account for those setting parameters that can be configured in either of the following ways:

  • An array of size n, with similar values
  • An array of size n, with different values
  • An array of size n, with values drawn from a distribution. This is the case where Parameter can loosely resemble a random variable.

Public Functions Documentation

function Parameter

inline Parameter()

function Parameter

inline explicit Parameter(
    const arma::Row< T > & X
)

function Parameter

inline Parameter(
    std::initializer_list< T > l
)

function Parameter

Parameter(
    const json & j,
    size_t size
)

Constructs a parameter based on the given JSON object.

Parameters:

  • j The configuration of the parameter
  • size The size of the array

Template Parameters:

  • T The type of the Parameter, a.k.a, the type of armadillo vector

This constructs and initializes the Parameter object based on the given JSON object.

function operator T

inline explicit operator T()

Returns the first element of the array.

Todo: Implement a copy constructor

function operator()

inline Parameter< T > & operator()()

Randomizes and returns the save Parameter.

function isDist

inline bool isDist()

Returns true if a distribution is assigned to the Parameter.


Updated on 29 June 2021 at 16:13:46 CEST


Last update: 2021-09-18