|
template<typename Archive , typename VT , bool TF> |
void | serialize (Archive &archive, const Vector< VT, TF > &vec) |
| Serializes the given vector and writes it to the archive. More...
|
|
template<typename Archive , typename VT > |
void | serializeHeader (Archive &archive, const VT &vec) |
| Serializes all meta information about the given vector. More...
|
|
template<typename Archive , typename VT , bool TF> |
void | serializeVector (Archive &archive, const DenseVector< VT, TF > &vec) |
| Serializes the elements of a dense vector. More...
|
|
template<typename Archive , typename VT , bool TF> |
void | serializeVector (Archive &archive, const SparseVector< VT, TF > &vec) |
| Serializes the elements of a sparse vector. More...
|
|
|
template<typename Archive , typename VT , bool TF> |
void | deserialize (Archive &archive, Vector< VT, TF > &vec) |
| Deserializes a vector from the given archive. More...
|
|
template<typename Archive , typename VT > |
void | deserializeHeader (Archive &archive, const VT &vec) |
| Deserializes all meta information about the given vector. More...
|
|
template<typename VT , bool TF> |
DisableIf_< IsResizable< VT > > | prepareVector (DenseVector< VT, TF > &vec) |
| Prepares the given non-resizable dense vector for the deserialization process. More...
|
|
template<typename VT , bool TF> |
DisableIf_< IsResizable< VT > > | prepareVector (SparseVector< VT, TF > &vec) |
| Prepares the given non-resizable sparse vector for the deserialization process. More...
|
|
template<typename VT > |
EnableIf_< IsResizable< VT > > | prepareVector (VT &vec) |
| Prepares the given resizable vector for the deserialization process. More...
|
|
template<typename Archive , typename VT > |
void | deserializeVector (Archive &archive, VT &vec) |
| Deserializes a vector from the archive. More...
|
|
template<typename Archive , typename VT , bool TF> |
DisableIfTrue< VT::simdEnabled >::Type | deserializeDenseVector (Archive &archive, DenseVector< VT, TF > &vec) |
|
template<typename Archive , typename VT , bool TF> |
EnableIfTrue_< VT::simdEnabled > | deserializeDenseVector (Archive &archive, DenseVector< VT, TF > &vec) |
| Deserializes a dense vector from the archive. More...
|
|
template<typename Archive , typename VT , bool TF> |
void | deserializeDenseVector (Archive &archive, SparseVector< VT, TF > &vec) |
| Deserializes a dense vector from the archive. More...
|
|
template<typename Archive , typename VT , bool TF> |
void | deserializeSparseVector (Archive &archive, DenseVector< VT, TF > &vec) |
| Deserializes a sparse vector from the archive. More...
|
|
template<typename Archive , typename VT , bool TF> |
void | deserializeSparseVector (Archive &archive, SparseVector< VT, TF > &vec) |
| Deserializes a sparse vector from the archive. More...
|
|
Serializer for dense and sparse vectors.
The VectorSerializer implements the necessary logic to serialize dense and sparse vectors, i.e. to convert them into a portable, binary representation. The following example demonstrates the (de-)serialization process of vectors:
{
archive << d << s;
}
{
archive >> d1;
archive >> d2
}
Note that it is even possible to (de-)serialize vectors with vector or matrix elements:
{
archive << vec;
}
{
archive >> vec;
}
As the examples demonstrates, the vector serialization offers an enormous flexibility. However, several actions result in errors:
- vectors cannot be reconstituted as matrices (and vice versa)
- the element type of the serialized and reconstituted vector must match, which means that on the source and destination platform the general type (signed/unsigned integral or floating point) and the size of the type must be exactly the same
- when reconstituting a StaticVector, its size must match the size of the serialized vector
In case an error is encountered during (de-)serialization, a std::runtime_exception is thrown.
template<typename Archive , typename VT , bool TF>
Deserializes a dense vector from the archive.
- Parameters
-
archive | The archive to be read from. |
vec | The dense vector to be reconstituted. |
- Returns
- void
- Exceptions
-
std::runtime_error | Dense vector could not be deserialized. |
This function deserializes a dense vector from the archive and reconstitutes the given dense vector. In case any error is detected during the deserialization process, a std::runtime_error is thrown.
template<typename Archive , typename VT , bool TF>
void blaze::VectorSerializer::deserializeDenseVector |
( |
Archive & |
archive, |
|
|
SparseVector< VT, TF > & |
vec |
|
) |
| |
|
private |
Deserializes a dense vector from the archive.
- Parameters
-
archive | The archive to be read from. |
vec | The sparse vector to be reconstituted. |
- Returns
- void
- Exceptions
-
std::runtime_error | Sparse vector could not be deserialized. |
This function deserializes a dense vector from the archive and reconstitutes the given sparse vector. In case any error is detected during the deserialization process, a std::runtime_error is thrown.
template<typename Archive , typename VT , bool TF>
Deserializes a dense vector from the archive.
- Parameters
-
archive | The archive to be read from. |
vec | The dense vector to be reconstituted. |
- Returns
- void
- Exceptions
-
std::runtime_error | Dense vector could not be deserialized. |
This function deserializes a dense vector from the archive and reconstitutes the given dense vector. In case any error is detected during the deserialization process, a std::runtime_error is thrown.
template<typename Archive , typename VT >
void blaze::VectorSerializer::deserializeHeader |
( |
Archive & |
archive, |
|
|
const VT & |
vec |
|
) |
| |
|
private |
Deserializes all meta information about the given vector.
- Parameters
-
archive | The archive to be read from. |
vec | The vector to be deserialized. |
- Returns
- void
- Exceptions
-
std::runtime_error | Error during deserialization. |
This function deserializes all meta information about the given vector contained in the header of the given archive. In case any error is detected during the deserialization process (for instance an invalid type of vector, element type, element size, or vector size) a std::runtime_error is thrown.
template<typename Archive , typename VT , bool TF>
void blaze::VectorSerializer::deserializeSparseVector |
( |
Archive & |
archive, |
|
|
DenseVector< VT, TF > & |
vec |
|
) |
| |
|
private |
Deserializes a sparse vector from the archive.
- Parameters
-
archive | The archive to be read from. |
vec | The dense vector to be reconstituted. |
- Returns
- void
- Exceptions
-
std::runtime_error | Dense vector could not be deserialized. |
This function deserializes a sparse vector from the archive and reconstitutes the given dense vector. In case any error is detected during the deserialization process, a std::runtime_error is thrown.
template<typename Archive , typename VT , bool TF>
void blaze::VectorSerializer::deserializeSparseVector |
( |
Archive & |
archive, |
|
|
SparseVector< VT, TF > & |
vec |
|
) |
| |
|
private |
Deserializes a sparse vector from the archive.
- Parameters
-
archive | The archive to be read from. |
vec | The sparse vector to be reconstituted. |
- Returns
- void
- Exceptions
-
std::runtime_error | Sparse vector could not be deserialized. |
This function deserializes a sparse vector from the archive and reconstitutes the given sparse vector. In case any error is detected during the deserialization process, a std::runtime_error is thrown.
template<typename Archive , typename VT , bool TF>
void blaze::VectorSerializer::serialize |
( |
Archive & |
archive, |
|
|
const Vector< VT, TF > & |
vec |
|
) |
| |
Serializes the given vector and writes it to the archive.
- Parameters
-
archive | The archive to be written. |
vec | The vector to be serialized. |
- Returns
- void
- Exceptions
-
std::runtime_error | Error during serialization. |
This function serializes the given vector and writes it to the given archive. In case any error is detected during the serialization, a std::runtime_error is thrown.