2013-11-27 13:17:21 +01:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
--
|
|
|
|
-- Module : DCB
|
|
|
|
-- Copyright :
|
|
|
|
-- License : AllRightsReserved
|
|
|
|
--
|
|
|
|
-- Maintainer :
|
|
|
|
-- Stability :
|
|
|
|
-- Portability :
|
|
|
|
--
|
|
|
|
-- |
|
|
|
|
--
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
module DCB where
|
|
|
|
|
2013-11-29 15:30:09 +01:00
|
|
|
import Prelude hiding((++))
|
|
|
|
import qualified Prelude ((++))
|
2013-11-27 23:34:22 +01:00
|
|
|
|
2013-11-29 15:30:09 +01:00
|
|
|
import Control.Monad.Par
|
|
|
|
import qualified Prelude ((++))
|
|
|
|
import Data.Array.Repa (Z(..),DIM1,DIM2,Array,(!),(++),(+^),(-^),(*^),(/^))
|
|
|
|
import qualified Data.Array.Repa as A
|
|
|
|
import Data.Int
|
2013-11-27 13:17:21 +01:00
|
|
|
|
2013-11-29 15:30:09 +01:00
|
|
|
type Vector r e = Array r DIM1 e
|
|
|
|
type Matrix r e = Array r DIM2 e
|
|
|
|
|
|
|
|
type Attr = Matrix A.U Double
|
2013-11-27 13:17:21 +01:00
|
|
|
-- Adjecency-Matrix
|
2013-11-29 15:30:09 +01:00
|
|
|
type Adj = Matrix A.U Int8
|
|
|
|
type Constraints = (Vector A.U Int, Matrix A.U Double)
|
2013-11-27 13:17:21 +01:00
|
|
|
-- Graph consists of a Vector denoting which colums of the matrix represents wich originating
|
|
|
|
-- column in the global adjencency-matrix, the reduces adjencency-matrix of the graph, a
|
|
|
|
-- matrix of constraints and a scalar denoting the density
|
2013-11-29 15:30:09 +01:00
|
|
|
type Density = Double
|
2013-11-27 13:17:21 +01:00
|
|
|
|
|
|
|
-- Graph
|
2013-11-29 15:30:09 +01:00
|
|
|
type Graph = (Vector A.U Int, Constraints, Density)
|
2013-11-27 13:17:21 +01:00
|
|
|
|
2013-11-27 23:34:22 +01:00
|
|
|
|
2013-11-29 15:30:09 +01:00
|
|
|
expand :: Adj -> Attr -> [Graph] -> [Graph]
|
|
|
|
expand adj attr g = undefined
|
2013-11-27 13:17:21 +01:00
|
|
|
|
|
|
|
-- constraint gets a Graph and an Attribute-Matrix and yields true, if the Graph still fulfills
|
|
|
|
-- all constraints defined via the Attribute-Matrix.
|
2013-11-29 15:30:09 +01:00
|
|
|
constraint :: Adj -> Attr -> Graph -> Int -> Maybe Bool
|
|
|
|
constraint adj attr g newNode = undefined
|
2013-11-27 13:17:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
-- addPoint gets a graph and a tuple of an adjecancy-Vector with an int wich column of the
|
|
|
|
-- Adjacency-Matrix the Vector should represent to generate further Graphs
|
2013-11-29 15:30:09 +01:00
|
|
|
addPoint :: Adj -> Attr -> Density -> Graph -> Int -> Maybe Graph
|
|
|
|
addPoint adj attr g c = undefined
|
2013-11-27 13:17:21 +01:00
|
|
|
|
2013-11-27 16:50:35 +01:00
|
|
|
-- addablePoints yields all valid addititons to a Graph
|
2013-11-29 15:30:09 +01:00
|
|
|
addablePoints :: Adj -> Graph -> Vector A.U Int
|
|
|
|
addablePoints adj g = undefined
|