1#ifndef CARTESIAN_GRAPH_UNIT_TEST_HPP
2#define CARTESIAN_GRAPH_UNIT_TEST_HPP
4#include "Graph/CartesianGraphFactory.hpp"
5#include "Graph/map_graph.hpp"
18 typedef boost::fusion::vector<size_t,size_t,size_t>
type;
23 static const std::string name[];
34 static const unsigned int memory = 2;
39const std::string node_cp::attributes::name[] = {
"communication",
"computation",
"memory"};
41BOOST_AUTO_TEST_SUITE( CartesianGraphFactory_test )
43BOOST_AUTO_TEST_CASE( CartesianGraphFactory_use_np)
50 size_t sz[3] = {GS_SIZE,GS_SIZE,GS_SIZE};
56 size_t bc[] = {NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
61 BOOST_REQUIRE_EQUAL(g.
getNVertex(),(
size_t)GS_SIZE*GS_SIZE*GS_SIZE);
64 BOOST_REQUIRE_EQUAL(g.
getNEdge(),(
size_t)3*8+4*(GS_SIZE-2)*12+6*(GS_SIZE-2)*(GS_SIZE-2)*5+(GS_SIZE-2)*(GS_SIZE-2)*(GS_SIZE-2)*6);
67BOOST_AUTO_TEST_CASE( CartesianGraphFactory_use_p)
74 size_t sz[3] = {GS_SIZE,GS_SIZE,GS_SIZE};
80 size_t bc[] = {PERIODIC,PERIODIC,PERIODIC};
85 BOOST_REQUIRE_EQUAL(g.
getNVertex(),(
size_t)GS_SIZE*GS_SIZE*GS_SIZE);
88 BOOST_REQUIRE_EQUAL(g.
getNEdge(),(
size_t)(GS_SIZE)*(GS_SIZE)*(GS_SIZE)*6);
91BOOST_AUTO_TEST_SUITE_END()
This class represent an N-dimensional box.
This class construct a cartesian graph.
static Graph construct(const size_t(&sz)[dim], Box< dim, T > &dom, const size_t(&bc)[dim])
Construct a cartesian graph, with V and E edge properties.
Structure that store a graph in CSR format or basically in compressed adjacency matrix format.
size_t getNEdge() const
Return the number of edges.
size_t getNVertex() const
Return the number of the vertex.
Test structure used for several test.
static const unsigned int communication
communication property id in boost::fusion::vector
static const unsigned int max_prop
total number of properties boost::fusion::vector
static const unsigned int computation
computation property id in boost::fusion::vector
boost::fusion::vector< size_t, size_t, size_t > type
The node contain 3 unsigned long integer for comunication computation and memory.