34 requires std::is_trivially_copyable_v<T>
37 f.write(
reinterpret_cast<const char*
>(&x),
sizeof(T));
54 requires std::is_trivially_copyable_v<T>
57 f.read(
reinterpret_cast<char*
>(&x),
sizeof(T));
109 template<
typename T,
int R=-1,
int C=-1>
110 inline void serialize(std::ostream& f,
const Eigen::Matrix<T,R,C>& x)
112 Index r = x.rows(), c = x.cols();
115 for(Index i = 0 ; i < r ; i++)
116 for(Index j = 0 ; j < c ; j++)
131 template<
typename T,
int R=-1,
int C=-1>
138 if constexpr(R == -1 && C == -1)
140 else if constexpr(R == -1 || C == -1)
141 x.resize(std::max(r,c));
144 assert_release(R == r && C == c);
147 for(Index i = 0 ; i < r ; i++)
148 for(Index j = 0 ; j < c ; j++)
164 template <
typename T>
165 inline void serialize(std::ostream& f,
const SampledTraj<T>& x)
167 Index size = x.nb_samples();
170 for(
const auto& [ti, xi] : x)
187 template <
typename T>
194 for(Index i = 0 ; i < size ; i++)
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
double ub() const
Returns the upper bound of this.
Definition codac2_Interval_impl.h:115
double lb() const
Returns the lower bound of this.
Definition codac2_Interval_impl.h:110
auto lb() const
Returns a matrix containing the lower bounds of each interval element.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:91
auto ub() const
Returns a matrix containing the upper bounds of each interval element.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:103
Definition codac2_OctaSym.h:21
void deserialize(std::istream &f, T &x)
Reads the binary representation of a trivially copyable object from the given input stream.
Definition codac2_serialization.h:55
void serialize(std::ostream &f, const T &x)
Writes the binary representation of a trivially copyable object to the given output stream.
Definition codac2_serialization.h:35