// Copyright (C) 1996 DIMACS Center, Rutgers, The State University of New Jersey
// Author(s): Patricia K. Fasel (Los Alamos Nat. Lab.), Jonathan Berry

// This software is copyrighted by the DIMACS Center at Rutgers, The State
// University of New Jersey.  IT IS PROVIDED AS IS, AND THE AUTHORS, DIMACS, AND
// RUTGERS, THE STATE UNIVERSITY OF NEW JERSEY  DISCLAIM
// ALL LIABILITY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
// DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

// THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
// IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
// NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
// MODIFICATIONS.

// The authors hereby grant permission to use, copy, modify, distribute,
// and license this software and its documentation for any purpose, provided
// that existing copyright notices are retained in all copies and that this
// notice is included verbatim in any distributions. No written agreement,
// license, or royalty fee is required for any of the authorized uses.
// Modifications to this software may be copyrighted by their authors
// and need not follow the licensing terms described here, provided that
// the new terms are clearly indicated on the first page of each file where
// they apply.

// Last File Update: 31-Jul-1996
// 

#ifdef __GNUC__

#include <LINK/basic/List.h>

#define DEFINE_TEMPLATE

#include <LINK/basic/Container.h>
#include <LINK/basic/BinaryHeap.h>
#include <LINK/basic/Deque.h>
#include <LINK/basic/Queue.h>
#include <LINK/basic/randomPermutation.h>
#include <LINK/graph/Attribute.h>

#undef DEFINE_TEMPLATE


#include <LINK/basic/Set.h>
#include <LINK/basic/DJSet.h>
#include <LINK/basic/Sequence.h>
#include <LINK/graph/Vertex.h>
#include <LINK/graph/Edge.h>


template class Dictionary<double,Edge*>;
template class BinaryHeapNode<double,Edge*>;
template class BinaryHeap<double,Edge*>;

template class Deque<Vertex*>;
template class Queue<Vertex*>;
template ostream& operator<<(ostream&, const Deque<Vertex*>&);



#include <LINK/basic/DList.h>
#include <LINK/graph/Graph.h>


/*
template class Attribute<int>;
template class Attribute<float>;
template class Attribute<double>;
template class Attribute<char>;
template class Attribute<String>;
template class Attribute<GraphObject*>;
template class Attribute<Graph*>;
template class Attribute<Vertex*>;
template class Attribute<Edge*>;
template class Attribute<List<Vertex*>*>;
template class Attribute<DList<Vertex*>*>;
template class Attribute<ContainerNode*>;
*/

template class AttributeElementOps<int>;
template class AttributeElementOps<char>;
template class AttributeElementOps<GraphObject*>;
template class AttributeElementOps<Graph*>;
template class AttributeElementOps<Vertex*>;
template class AttributeElementOps<Edge*>;
template class AttributeElementOps<List<Vertex*>*>;
template class AttributeElementOps<DList<Vertex*>*>;
template class AttributeElementOps<ContainerNode*>;
template class AttributeElementOps<DJSet*>;

template void randomPermutation(Sequence<Vertex*>*, int);
template void randomPermutation(Set<Vertex*>*, int);
template void randomPermutation(Vertex**, int);



ostream& AttributeElementOps<float>::displayItem(ostream& os,
                                                  const float& e) const
{
        os.setf(ios::showpoint);
        os << e << "f";
        return os;
}

ostream& AttributeElementOps<double>::displayItem(ostream& os,
                                                  const double& e) const
{
        os.setf(ios::showpoint);
        os << e;
        return os;
}

ostream& AttributeElementOps<String>::displayItem(ostream& os,
                                                  const String& e) const
{
        os << "\"" << e << "\"";
        return os;
}

typedef Vertex *VertexPtr;
ostream& AttributeElementOps<VertexPtr>::displayItem(ostream& os,
                                                const VertexPtr& v) const
{
	cout << "AttributeElementOps<V*>::display" << endl;
	if (v) {
		os << *v;
	} else
		os << 0;
        return os;
}

typedef Edge *EdgePtr;
ostream& AttributeElementOps<EdgePtr>::displayItem(ostream& os,
                                                const EdgePtr& e) const
{
	if (e) {
        	os << *e;
	} else
		os << 0;
        return os;
}

#endif
