List of all members | Public Member Functions | Public Attributes
casadi::Node Struct Reference

Metadata for one graph tensor (graph input or output) More...

#include <graph_builder_internal.hpp>

Detailed Description

The format-neutral GraphBuilder analogue of DaeBuilder's Variable.

Extra doc: https://github.com/casadi/casadi/wiki/L_2ju

Definition at line 42 of file graph_builder_internal.hpp.

Inheritance diagram for casadi::Node:
Inheritance graph
[legend]
Collaboration diagram for casadi::Node:
Collaboration graph
[legend]

Public Member Functions

std::string type_name () const
 
void disp (std::ostream &stream, bool more=false) const
 
std::string get_str (bool more=false) const
 

Public Attributes

std::string name
 Tensor name. More...
 
std::string io
 "input" or "output" More...
 
std::string dtype
 Element type name (FLOAT, INT64, ...) More...
 
std::vector< casadi_int > dimension
 Declared shape, -1 for dynamic dimensions. More...
 
std::vector< std::string > dim_params
 Symbolic name per axis ("" if static) More...
 
std::vector< double > value
 Baked value (optional) More...
 
bool baked = false
 True if a fixed value was set() for this input. More...
 

Member Function Documentation

◆ disp()

void casadi::Node::disp ( std::ostream &  stream,
bool  more = false 
) const

Definition at line 33 of file graph_builder.cpp.

33  {
34  (void)more;
35  stream << io << " " << name << ": " << dtype << "[";
36  for (size_t k = 0; k < dimension.size(); ++k) {
37  if (k) stream << "x";
38  if (dimension[k] >= 0) stream << dimension[k];
39  else
40  stream << (dim_params[k].empty() ? "?" : dim_params[k]);
41  }
42  stream << "]";
43  if (baked) stream << " (baked)";
44  }
std::vector< casadi_int > dimension
Declared shape, -1 for dynamic dimensions.
std::string name
Tensor name.
std::string io
"input" or "output"
std::string dtype
Element type name (FLOAT, INT64, ...)
std::vector< std::string > dim_params
Symbolic name per axis ("" if static)
bool baked
True if a fixed value was set() for this input.

References baked, dim_params, dimension, dtype, io, and name.

Referenced by get_str().

◆ get_str()

std::string casadi::Node::get_str ( bool  more = false) const

Definition at line 46 of file graph_builder.cpp.

46  {
47  std::stringstream ss;
48  disp(ss, more);
49  return ss.str();
50  }
void disp(std::ostream &stream, bool more=false) const

References disp().

◆ type_name()

std::string casadi::Node::type_name ( ) const
inline

Definition at line 52 of file graph_builder_internal.hpp.

52 { return "Node"; }

Member Data Documentation

◆ baked

bool casadi::Node::baked = false

Definition at line 50 of file graph_builder_internal.hpp.

Referenced by disp().

◆ dim_params

std::vector<std::string> casadi::Node::dim_params

◆ dimension

std::vector<casadi_int> casadi::Node::dimension

◆ dtype

std::string casadi::Node::dtype

Definition at line 46 of file graph_builder_internal.hpp.

Referenced by disp(), and casadi::io_node().

◆ io

std::string casadi::Node::io

◆ name

std::string casadi::Node::name

◆ value

std::vector<double> casadi::Node::value

Definition at line 49 of file graph_builder_internal.hpp.


The documentation for this struct was generated from the following files: