codac 2.0.0
Loading...
Searching...
No Matches
codac2::symbolic::detail::FlatSymbolTable Class Reference

Symbol table associated with a flattened analytic input domain. More...

#include <codac2_sympy_bridge.h>

Public Member Functions

 FlatSymbolTable (const FunctionArgsList &args)
 Builds the symbol table associated with a function argument list.
pybind11::object by_flat_index (Index k) const
 Returns the SymPy symbol associated with a flat input index.
ScalarExpr codac_expr_by_name (const std::string &name) const
 Returns the Codac scalar expression associated with a symbol name.
Index size () const
 Returns the number of scalar entries in the flattened input domain.
pybind11::object for_scalar_var (const ScalarVar &x) const
 Returns the SymPy symbol associated with a scalar variable.
pybind11::object for_vector_component (const VectorVar &x, Index i) const
 Returns the SymPy symbol associated with a vector component.
pybind11::object for_matrix_component (const MatrixVar &x, Index i, Index j) const
 Returns the SymPy symbol associated with a matrix component.

Detailed Description

Symbol table associated with a flattened analytic input domain.

This class maps each scalar entry of a function input domain to a dedicated SymPy symbol, and provides the reverse mapping from such symbols to Codac scalar expressions.

Constructor & Destructor Documentation

◆ FlatSymbolTable()

codac2::symbolic::detail::FlatSymbolTable::FlatSymbolTable ( const FunctionArgsList & args)
explicit

Builds the symbol table associated with a function argument list.

Parameters
argsFunction argument list.

Member Function Documentation

◆ by_flat_index()

pybind11::object codac2::symbolic::detail::FlatSymbolTable::by_flat_index ( Index k) const

Returns the SymPy symbol associated with a flat input index.

Parameters
kFlat input index.
Returns
SymPy symbol associated with k.

◆ codac_expr_by_name()

ScalarExpr codac2::symbolic::detail::FlatSymbolTable::codac_expr_by_name ( const std::string & name) const

Returns the Codac scalar expression associated with a symbol name.

Parameters
nameSymPy symbol name.
Returns
Corresponding Codac scalar expression.

◆ size()

Index codac2::symbolic::detail::FlatSymbolTable::size ( ) const

Returns the number of scalar entries in the flattened input domain.

Returns
Flattened input domain size.

◆ for_scalar_var()

pybind11::object codac2::symbolic::detail::FlatSymbolTable::for_scalar_var ( const ScalarVar & x) const

Returns the SymPy symbol associated with a scalar variable.

Parameters
xScalar variable.
Returns
Corresponding SymPy symbol.

◆ for_vector_component()

pybind11::object codac2::symbolic::detail::FlatSymbolTable::for_vector_component ( const VectorVar & x,
Index i ) const

Returns the SymPy symbol associated with a vector component.

Parameters
xVector variable.
iComponent index.
Returns
Corresponding SymPy symbol.

◆ for_matrix_component()

pybind11::object codac2::symbolic::detail::FlatSymbolTable::for_matrix_component ( const MatrixVar & x,
Index i,
Index j ) const

Returns the SymPy symbol associated with a matrix component.

Parameters
xMatrix variable.
iRow index.
jColumn index.
Returns
Corresponding SymPy symbol.

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