Template Class Var#
Defined in File Var.h
Inheritance Relationships#
Base Type#
public Karana::Core::NumericVar< T >(Template Class NumericVar)
Class Documentation#
-
template<typename T, Karana::Math::Quantity quantity = Karana::Math::Quantity::none>
class Var : public Karana::Core::NumericVar<T># A callable value with an optional compile-time physical quantity.
- Template Parameters:
T – Value returned by the callable.
quantity – Physical quantity, or none for ordinary values.
Public Functions
-
inline Var(std::string_view name, const NumericVar<T> &other, std::string_view description)#
Rename constructor. Create a new Var with the same callable as
other, but a different name and description.
-
template<class F>
inline Var(std::string_view name, const F &f, int vector_size, std::string_view description, std::string_view units = "")# Construct a dynamic vector Var and resolve its units.
- Template Parameters:
F – Callable returning T.
- Parameters:
-
template<class F>
inline Var(std::string_view name, const F &f, int matrix_rows, int matrix_cols, std::string_view description, std::string_view units = "")# Construct a dynamic matrix Var and resolve its units.
- Template Parameters:
F – Callable returning T.
- Parameters:
name – Name of the new Var.
f – Callable supplying a matrix of the declared shape.
matrix_rows – Number of rows, fixed for the callable’s lifetime.
matrix_cols – Number of columns, fixed for the callable’s lifetime.
description – Description of the new Var.
units – Explicit units, or empty for defaults when a quantity is declared.
Public Static Functions
-
template<class F>
static inline Karana::Core::ks_ptr<Var> create(std::string_view name, const F &f, int vector_size, std::string_view description, std::string_view units = "")# Create a new instance of Var<km::Vec>.
- Template Parameters:
F – Templated callable type that produces km::Vec.
- Parameters:
name – The name of the new Var<km::Vec>
f – The callable that produces km::Vec.
vector_size – The size of the km::Vec that the callable produces. This must always be the same size.
description – A description of the Var.
units – The units of the Var.
- Returns:
The newly created instance of Var<km::Vec>.
-
template<class F>
static inline Karana::Core::ks_ptr<Var> create(std::string_view name, const F &f, int vector_size, std::string_view description, std::string_view units = "") Create a new instance of Var<km::VecInt>.
- Template Parameters:
F – Templated callable type that produces km::VecInt.
- Parameters:
name – The name of the new Var<km::VecInt>
f – The callable that produces km::VecInt.
vector_size – The size of the km::VecInt that the callable produces. This must always be the same size.
description – A description of the Var.
units – The units of the Var.
- Returns:
The newly created instance of Var<km::VecInt>.
-
template<class F>
static inline Karana::Core::ks_ptr<Var> create(std::string_view name, const F &f, int matrix_rows, int matrix_cols, std::string_view description, std::string_view units = "")# Create a new instance of Var<km::Mat>.
- Template Parameters:
F – Templated callable type that produces km::Mat.
- Parameters:
name – The name of the Var<km::Mat>
f – The callable that produces km::Mat.
matrix_rows – The number of rows in the km::Mat that the callable produces. The matrix that the callable produces must always be the same size.
matrix_cols – The number of cols in the km::Mat that the callable produces. The matrix that the callable produces must always be the same size.
description – A description of the Var.
units – The units of the Var.
- Returns:
The newly created instance of Var<km::Mat>.
-
template<class F>
static inline Karana::Core::ks_ptr<Var> create(std::string_view name, const F &f, std::string_view description, std::string_view units = "")# Create a new instance of Var<T>.
-
static inline Karana::Core::ks_ptr<Var> create(std::string_view name, const Karana::Core::ks_ptr<NumericVar<T>> &other, std::string_view description)#
Rename Var constructor.
This constructor keeps the same function, size, etc., but takes a new name and description.
-
static inline ks_ptr<Var> create(std::string_view name, const NumericVar<T> &other, std::string_view description)#
Create a new Var with the same callable as
other, but a new name and description.