1 #ifndef SimTK_SimTKCOMMON_SERIALIZE_H_
2 #define SimTK_SimTKCOMMON_SERIALIZE_H_
75 template <
class T>
inline void
81 template <
class T>
inline void
87 template <
class T>
inline void
93 template <
class T>
inline void
101 template <
int M,
class E,
int S>
inline void
103 for (
int i=0; i < M; ++i) {
104 if (i != 0) o <<
" ";
111 template <
int N,
class E,
int S>
inline void
118 template <
int M,
int N,
class E,
int CS,
int RS>
inline void
120 for (
int i=0; i < M; ++i) {
121 if (i != 0) o << std::endl;
129 template <
int M,
class E,
int RS>
inline void
131 for (
int i=0; i < M; ++i) {
132 if (i != 0) o << std::endl;
161 if (!in.good()) {in.setstate(std::ios::failbit);
return false;}
164 if (!in.good()) {in.setstate(std::ios::failbit);
return false;}
165 in >> token;
if (in.fail())
return false;
166 if (token.empty()) {in.setstate(std::ios_base::failbit);
return false;}
175 template <
class T>
inline bool
180 { in.setstate(std::ios::failbit);
return false; }
185 template <
class T>
inline bool
193 template <
class T>
inline bool
203 template <
class T>
inline bool
211 template <>
inline bool
219 template <
int M,
class E,
int S>
inline bool
221 for (
int i=0; i < M; ++i)
229 template <
int N,
class E,
int S>
inline bool
235 template <
int M,
int N,
class E,
int CS,
int RS>
inline bool
237 for (
int i=0; i < M; ++i)
248 template <
int M,
class E,
int RS>
inline bool
252 in.setstate(std::ios::failbit);
285 template <
class T>
inline void
308 template <
class T>
inline bool
This file contains macros which are convenient to use for sprinkling error checking around liberally ...
Mandatory first inclusion for any Simbody source or header file.
This class represents a small matrix whose size is known at compile time, containing elements of any ...
Definition: Mat.h:97
bool isNumericallySymmetric(double tol=getDefaultTolerance()) const
A Matrix is symmetric (actually Hermitian) if it is square and each element (i,j) is the Hermitian tr...
Definition: Mat.h:1174
This is a fixed-length row vector designed for no-overhead inline computation.
Definition: Row.h:132
SimTK::String is a plug-compatible std::string replacement (plus some additional functionality) inten...
Definition: String.h:65
bool tryConvertTo(T &out) const
Attempt to convert this String to an object of type T, returning a status value to indicate success o...
Definition: String.h:475
This is a small, fixed-size symmetric or Hermitian matrix designed for no-overhead inline computation...
Definition: SymMat.h:87
SymMat & setFromSymmetric(const Mat< M, M, EE, CSS, RSS > &m)
Create a new SymMat of this type from a square Mat of the right size, that is expected to be symmetri...
Definition: SymMat.h:317
This is a fixed-length column vector designed for no-overhead inline computation.
Definition: Vec.h:184
SimTK::conjugate<R> should be instantiated only for float, double.
Definition: conjugate.h:178
negator<N>, where N is a number type (real, complex, conjugate), is represented in memory identically...
Definition: negator.h:75
bool readUnformatted< String >(std::istream &in, String &v)
Specialization for SimTK::String (just read token).
Definition: Serialize.h:212
bool readUnformatted(std::istream &in, Row< N, E, S > &v)
Specialize for Row<N,E,S> to delegate to element type E, with spaces separating the elements; format ...
Definition: Serialize.h:230
bool readUnformatted(std::istream &in, SymMat< M, E, RS > &v)
Specialize for SymMat<M,E,RS>.
Definition: Serialize.h:249
bool readUnformatted(std::istream &in, T &v)
The default implementation of readUnformatted<T> reads in the next whitespace-separated token and the...
Definition: Serialize.h:176
bool readUnformatted(std::istream &in, Vec< M, E, S > &v)
Specialize for Vec<M,E,S> to delegate to element type E, with spaces separating the elements.
Definition: Serialize.h:220
bool readOneTokenUnformatted(std::istream &in, String &token)
Read in the next whitespace-delimited token as a String, ignoring leading whitespace.
Definition: Serialize.h:159
bool readUnformatted(std::istream &in, Mat< M, N, E, CS, RS > &v)
Specialize for Mat<M,N,E,CS,RS> delegating to Row<N,E,RS>.
Definition: Serialize.h:236
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
const negator< float > & imag(const conjugate< float > &c)
Definition: conjugate.h:483
const float & real(const conjugate< float > &c)
Definition: conjugate.h:482