FRWGraph.C 2.29 KB
Newer Older
Franjo's avatar
Franjo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | cfMesh: A library for mesh generation
   \\    /   O peration     |
    \\  /    A nd           | Author: Franjo Juretic (franjo.juretic@c-fields.com)
     \\/     M anipulation  | Copyright (C) Creative Fields, Ltd.
-------------------------------------------------------------------------------
License
    This file is part of cfMesh.

    cfMesh is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 3 of the License, or (at your
    option) any later version.

    cfMesh is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with cfMesh.  If not, see <http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#include "FRWGraph.H"

// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //

template<class T, Foam::label width>
Foam::Ostream& Foam::operator<<
(
    Foam::Ostream& os,
    const Foam::FRWGraph<T, width>& DL
)
{
37 38
    os << DL.size() << "(" << nl;

39
    for(label i=0;i<DL.size();++i)
Franjo's avatar
Franjo committed
40 41
    {
        os << width << "(";
42

Franjo's avatar
Franjo committed
43
        for(label j=0;j<width;++j)
44 45 46 47 48 49 50 51 52 53
        {
            if( j )
            {
                os << " ";
            }

            os << DL(i, j);
        }

        os << ")" << nl;
Franjo's avatar
Franjo committed
54
    }
55

Franjo's avatar
Franjo committed
56
    os << ")";
57 58 59 60 61 62 63 64

    // Check state of IOstream
    os.check
    (
        "template<class T, Foam::label width>Foam::Ostream& Foam::operator<<"
        "(Foam::Ostream& os, const Foam::FRWGraph<T, width>&)"
    );

Franjo's avatar
Franjo committed
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
    return os;
}

/*
template<class T, Foam::label width>
Foam::Istream& Foam::operator>>
(
    Foam::Istream& is,
    Foam::FRWGraph<T, width>& DL
)
{
    label size;
    T e;
    is >> size;
    DL.setSize(size);
    for(IndexType i=0;i<size;++i)
    {
        is >> e;
        DL[i] = e;
    }

    return is;
}
*/

// ************************************************************************* //