creativity  v1.3.0
Agent-based model of creativity and piracy
Public Member Functions | Static Public Member Functions | List of all members
creativity::data::Logarithm Class Reference

Takes a natural logarithm of a Variable's values. More...

#include <creativity/data/Variable.hpp>

Public Member Functions

virtual void populate (Eigen::Ref< Eigen::VectorXd > column, unsigned int offset=0, unsigned int trim=0) const override
 Calculates and stores the logarithm values.
 
virtual std::string name () const override
 Returns a string representation of the variable, which is log(name), where name is the name of the variable being log'ed.
 
virtual std::string nameBracketed (const std::string &="(", const std::string &=")") const override
 Returns a name for this variable, but with surrounding brackets if this variable needs it–for example, for a multiplication of two variables. More...
 
- Public Member Functions inherited from creativity::data::UnaryExpr
virtual unsigned int size () const override
 Returns the size of the unary expression, if the variable has a size. More...
 
- Public Member Functions inherited from creativity::data::Variable
virtual ~Variable ()=default
 Virtual destructor.
 
Eigen::VectorXd values (unsigned int rows=0, unsigned int offset=0, unsigned int trim=0) const
 Shortcut wrapper around populate that creates a new column of the given size, calls populate() with it, then returns it. More...
 

Static Public Member Functions

template<class... Args>
static std::shared_ptr< Logarithmcreate (Args... args)
 Forwards arguments to the protected constructor and returns a shared_ptr to the created object.
 

Additional Inherited Members

- Protected Member Functions inherited from creativity::data::UnaryExpr
 UnaryExpr ()=delete
 Not default-constructible.
 
 UnaryExpr (const std::shared_ptr< const Variable > &var)
 Constructs a unary variable.
 
- Protected Attributes inherited from creativity::data::UnaryExpr
std::shared_ptr< const Variablevar_
 The underlying unary variable.
 

Detailed Description

Takes a natural logarithm of a Variable's values.

Member Function Documentation

§ nameBracketed()

virtual std::string creativity::data::Logarithm::nameBracketed ( const std::string &  bracketL = "(",
const std::string &  bracketR = ")" 
) const
overridevirtual

Returns a name for this variable, but with surrounding brackets if this variable needs it–for example, for a multiplication of two variables.

For simple variables and constants, and some non-simple variables such as Logarithm, the brackets are not needed.

Parameters
bracketLthe left bracket; defaults to a left parenthesis
bracketRthe right bracket; defaults to a right parenthesis

Reimplemented from creativity::data::Variable.

Inheritance diagram for creativity::data::Logarithm:
[legend]
Collaboration diagram for creativity::data::Logarithm:
[legend]

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