Boost logo

Ublas :

Subject: Re: [ublas] poll: what's your uBLAS I/O usage ?
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2010-05-31 17:59:40

Hello Jesse,

Am Sunday 30 May 2010 schrieb Jesse Perla:

> ublas::matrix<double> M(2,2); //fill it
> ublas::vector<double> v(2); //fill it
> std::ofstream ofs("my.mat");
> {
> boost::archive::matlab_binary_archive arch(ofs);
> arch << matlab_named("matrix1", M) << matlab_named("vector1", v);
> } //Since the arch goes out of scope, this would call the .close()

I'd like using the serialization this way (or using the funny "&"
notation). I see a the big advantage, that it is a) easy to provide a
working serialization for each uBlas container and b) easy to provide
different format. One could even imagine to provide a "console_archive"
for pretty printing matrices to std::out.

This way the serialization (which is internal part of uBlas) and the
output are clearly separated.