Re: matrix with custom elements
Irek Szczesniak <[email protected]> Mon, 08 May 2006 15:15:13 -0700
| Newsgroups | gmane.comp.lib.mtl.devel |
|---|---|
| Message-ID | <[email protected]> |
Irek Szczesniak wrote:
> (...)
>
> The code compiles if I don't use the print_all_matrix function.
>
> I defined the << operator for the polynomial type, but it didn't
> help. It would be great if someone could write me how to fix my
> problem.
I defined the << operator this way (i.e. I wrote "const
Mat::value_type &p" instead of "const polynomial &p"):
ostream &operator << (ostream &out, const Mat::value_type &p)
{
out << "(";
for(polynomial::const_iterator i = p.begin(); i != p.end(); i++)
out << "(" << i->first << ", " << i->second << ")";
out << ")";
return out;
}
It didn't help.
Best,
Irek
_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/