#include <serializer.hpp>
Definition at line 173 of file serializer.hpp.
|
enum | SerializationType {
SERIALIZED_SPARSITY
, SERIALIZED_MX
, SERIALIZED_DM
, SERIALIZED_SX
,
SERIALIZED_LINSOL
, SERIALIZED_FUNCTION
, SERIALIZED_GENERICTYPE
, SERIALIZED_INT
,
SERIALIZED_DOUBLE
, SERIALIZED_STRING
, SERIALIZED_SPARSITY_VECTOR
, SERIALIZED_MX_VECTOR
,
SERIALIZED_DM_VECTOR
, SERIALIZED_SX_VECTOR
, SERIALIZED_LINSOL_VECTOR
, SERIALIZED_FUNCTION_VECTOR
,
SERIALIZED_GENERICTYPE_VECTOR
, SERIALIZED_INT_VECTOR
, SERIALIZED_DOUBLE_VECTOR
, SERIALIZED_STRING_VECTOR
} |
|
◆ SerializationType
Enumerator |
---|
SERIALIZED_SPARSITY | |
SERIALIZED_MX | |
SERIALIZED_DM | |
SERIALIZED_SX | |
SERIALIZED_LINSOL | |
SERIALIZED_FUNCTION | |
SERIALIZED_GENERICTYPE | |
SERIALIZED_INT | |
SERIALIZED_DOUBLE | |
SERIALIZED_STRING | |
SERIALIZED_SPARSITY_VECTOR | |
SERIALIZED_MX_VECTOR | |
SERIALIZED_DM_VECTOR | |
SERIALIZED_SX_VECTOR | |
SERIALIZED_LINSOL_VECTOR | |
SERIALIZED_FUNCTION_VECTOR | |
SERIALIZED_GENERICTYPE_VECTOR | |
SERIALIZED_INT_VECTOR | |
SERIALIZED_DOUBLE_VECTOR | |
SERIALIZED_STRING_VECTOR | |
Definition at line 78 of file serializer.hpp.
◆ StringSerializer()
casadi::StringSerializer::StringSerializer |
( |
const Dict & |
opts = Dict() | ) |
|
This class is intended for advanced users that want to circumvent the restrictions of standard pickling/matlab save load, ie no raw SX/MX symbols allowed.
x = SX.sym('x');
s = StringSerializer();
s.pack(x);
s.pack(sin(x));
data = s.encode();
s = StringDeserializer(data);
a = s.unpack();
b = s.unpack();
Note: Saving SX/MX objects individually has a substantial overhead (both time and length of encoded string). You are encouraged to use the vector/list variants of 'save' for SX/MX to reduce the overhead.
- See also
- Function::save, Function::serialize, StringDeserializer, FileSerializer
Extra doc: https://github.com/casadi/casadi/wiki/L_7o
◆ ~StringSerializer()
casadi::StringSerializer::~StringSerializer |
( |
| ) |
|
◆ connect()
◆ encode()
std::string casadi::StringSerializer::encode |
( |
| ) |
|
◆ pack() [1/20]
void casadi::SerializerBase::pack |
( |
const casadi_int & |
e | ) |
|
|
inherited |
◆ pack() [2/20]
void casadi::SerializerBase::pack |
( |
const double & |
e | ) |
|
|
inherited |
◆ pack() [3/20]
void casadi::SerializerBase::pack |
( |
const Function & |
e | ) |
|
|
inherited |
◆ pack() [4/20]
void casadi::SerializerBase::pack |
( |
const GenericType & |
e | ) |
|
|
inherited |
◆ pack() [5/20]
void casadi::SerializerBase::pack |
( |
const Linsol & |
e | ) |
|
|
inherited |
◆ pack() [6/20]
void casadi::SerializerBase::pack |
( |
const Matrix< double > & |
e | ) |
|
|
inherited |
◆ pack() [7/20]
void casadi::SerializerBase::pack |
( |
const Matrix< SXElem > & |
e | ) |
|
|
inherited |
◆ pack() [8/20]
void casadi::SerializerBase::pack |
( |
const MX & |
e | ) |
|
|
inherited |
◆ pack() [9/20]
void casadi::SerializerBase::pack |
( |
const Sparsity & |
e | ) |
|
|
inherited |
◆ pack() [10/20]
void casadi::SerializerBase::pack |
( |
const std::string & |
e | ) |
|
|
inherited |
◆ pack() [11/20]
void casadi::SerializerBase::pack |
( |
const std::vector< casadi_int > & |
e | ) |
|
|
inherited |
◆ pack() [12/20]
void casadi::SerializerBase::pack |
( |
const std::vector< double > & |
e | ) |
|
|
inherited |
◆ pack() [13/20]
void casadi::SerializerBase::pack |
( |
const std::vector< Function > & |
e | ) |
|
|
inherited |
◆ pack() [14/20]
void casadi::SerializerBase::pack |
( |
const std::vector< GenericType > & |
e | ) |
|
|
inherited |
◆ pack() [15/20]
void casadi::SerializerBase::pack |
( |
const std::vector< Linsol > & |
e | ) |
|
|
inherited |
◆ pack() [16/20]
void casadi::SerializerBase::pack |
( |
const std::vector< Matrix< double > > & |
e | ) |
|
|
inherited |
◆ pack() [17/20]
void casadi::SerializerBase::pack |
( |
const std::vector< Matrix< SXElem > > & |
e | ) |
|
|
inherited |
◆ pack() [18/20]
void casadi::SerializerBase::pack |
( |
const std::vector< MX > & |
e | ) |
|
|
inherited |
◆ pack() [19/20]
void casadi::SerializerBase::pack |
( |
const std::vector< Sparsity > & |
e | ) |
|
|
inherited |
◆ pack() [20/20]
void casadi::SerializerBase::pack |
( |
const std::vector< std::string > & |
e | ) |
|
|
inherited |
◆ reset()
void casadi::SerializerBase::reset |
( |
| ) |
|
|
inherited |
◆ serializer()
◆ type_to_string()
◆ serializer_
◆ sstream_
std::unique_ptr<std::ostream> casadi::SerializerBase::sstream_ |
|
protectedinherited |
The documentation for this class was generated from the following file: