{-# LINE 1 "src/IGraph/Internal/Data.chs" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module IGraph.Internal.Data
( Vector(..)
, withVector
, igraphVectorNew
, fromList
, toList
, igraphVectorNull
, igraphVectorFill
, igraphVectorE
, igraphVectorSet
, igraphVectorTail
, igraphVectorSize
, igraphVectorCopyTo
, VectorPtr(..)
, withVectorPtr
, igraphVectorPtrNew
, fromPtrs
, toLists
, StrVector(..)
, withStrVector
, igraphStrvectorNew
, igraphStrvectorGet
, toStrVector
, BSLen(..)
, BSVector(..)
, withBSVector
, bsvectorNew
, bsvectorSet
, toBSVector
, Matrix(..)
, withMatrix
, igraphMatrixNew
, igraphMatrixNull
, igraphMatrixFill
, igraphMatrixE
, igraphMatrixSet
, igraphMatrixCopyTo
, igraphMatrixNrow
, igraphMatrixNcol
, fromRowLists
, toRowLists
, toColumnLists
) where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.ForeignPtr as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import qualified Foreign.Storable as C2HSImp
import qualified System.IO.Unsafe as C2HSImp
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Foreign
import Foreign.C.Types
import Foreign.C.String
import System.IO.Unsafe (unsafePerformIO)
import Data.List (transpose)
import Data.List.Split (chunksOf)
newtype Vector = Vector (C2HSImp.ForeignPtr (Vector))
withVector :: Vector -> (C2HSImp.Ptr Vector -> IO b) -> IO b
withVector (Vector fptr) = C2HSImp.withForeignPtr fptr
{-# LINE 67 "src/IGraph/Internal/Data.chs" #-}
igraphVectorNew :: (Int) -> IO ((Vector))
igraphVectorNew a2 =
C2HSImp.mallocForeignPtrBytes 24 >>= \a1'' -> C2HSImp.withForeignPtr a1'' $ \a1' ->
let {a2' = fromIntegral a2} in
igraphVectorNew'_ a1' a2' >>
return (Vector a1'')
{-# LINE 71 "src/IGraph/Internal/Data.chs" #-}
igraphVectorInitCopy :: (Ptr CDouble) -> (Int) -> IO ((Vector))
igraphVectorInitCopy a2 a3 =
C2HSImp.mallocForeignPtrBytes 24 >>= \a1'' -> C2HSImp.withForeignPtr a1'' $ \a1' ->
let {a2' = id a2} in
let {a3' = fromIntegral a3} in
igraphVectorInitCopy'_ a1' a2' a3' >>
return (Vector a1'')
{-# LINE 73 "src/IGraph/Internal/Data.chs" #-}
fromList :: [Double] -> IO Vector
fromList xs = withArrayLen (map realToFrac xs) $ \n ptr ->
igraphVectorInitCopy ptr n
{-# INLINE fromList #-}
toList :: Vector -> IO [Double]
toList vec = do
n <- igraphVectorSize vec
allocaArray n $ \ptr -> do
igraphVectorCopyTo vec ptr
liftM (map realToFrac) $ peekArray n ptr
{-# INLINE toList #-}
igraphVectorNull :: (Vector) -> IO ()
igraphVectorNull a1 =
(withVector) a1 $ \a1' ->
igraphVectorNull'_ a1' >>
return ()
{-# LINE 90 "src/IGraph/Internal/Data.chs" #-}
igraphVectorFill :: (Vector) -> (Double) -> IO ()
igraphVectorFill a1 a2 =
(withVector) a1 $ \a1' ->
let {a2' = realToFrac a2} in
igraphVectorFill'_ a1' a2' >>
return ()
{-# LINE 92 "src/IGraph/Internal/Data.chs" #-}
igraphVectorE :: (Vector) -> (Int) -> (Double)
igraphVectorE a1 a2 =
C2HSImp.unsafePerformIO $
(withVector) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
igraphVectorE'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 97 "src/IGraph/Internal/Data.chs" #-}
igraphVectorSet :: (Vector) -> (Int) -> (Double) -> IO ()
igraphVectorSet a1 a2 a3 =
(withVector) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = realToFrac a3} in
igraphVectorSet'_ a1' a2' a3' >>
return ()
{-# LINE 99 "src/IGraph/Internal/Data.chs" #-}
igraphVectorTail :: (Vector) -> (Double)
igraphVectorTail a1 =
C2HSImp.unsafePerformIO $
(withVector) a1 $ \a1' ->
igraphVectorTail'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 101 "src/IGraph/Internal/Data.chs" #-}
igraphVectorCopyTo :: (Vector) -> (Ptr CDouble) -> IO ()
igraphVectorCopyTo a1 a2 =
(withVector) a1 $ \a1' ->
let {a2' = id a2} in
igraphVectorCopyTo'_ a1' a2' >>
return ()
{-# LINE 106 "src/IGraph/Internal/Data.chs" #-}
igraphVectorSize :: (Vector) -> IO ((Int))
igraphVectorSize a1 =
(withVector) a1 $ \a1' ->
igraphVectorSize'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
{-# LINE 109 "src/IGraph/Internal/Data.chs" #-}
newtype VectorPtr = VectorPtr (C2HSImp.ForeignPtr (VectorPtr))
withVectorPtr :: VectorPtr -> (C2HSImp.Ptr VectorPtr -> IO b) -> IO b
withVectorPtr (VectorPtr fptr) = C2HSImp.withForeignPtr fptr
{-# LINE 113 "src/IGraph/Internal/Data.chs" #-}
igraphVectorPtrNew :: (Int) -> IO ((VectorPtr))
igraphVectorPtrNew a2 =
C2HSImp.mallocForeignPtrBytes 32 >>= \a1'' -> C2HSImp.withForeignPtr a1'' $ \a1' ->
let {a2' = fromIntegral a2} in
igraphVectorPtrNew'_ a1' a2' >>
return (VectorPtr a1'')
{-# LINE 115 "src/IGraph/Internal/Data.chs" #-}
igraphVectorPtrE :: (VectorPtr) -> (Int) -> IO ((Ptr ()))
igraphVectorPtrE a1 a2 =
(withVectorPtr) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
igraphVectorPtrE'_ a1' a2' >>= \res ->
let {res' = id res} in
return (res')
{-# LINE 117 "src/IGraph/Internal/Data.chs" #-}
igraphVectorPtrSet :: (VectorPtr) -> (Int) -> (Ptr ()) -> IO ()
igraphVectorPtrSet a1 a2 a3 =
(withVectorPtr) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = id a3} in
igraphVectorPtrSet'_ a1' a2' a3' >>
return ()
{-# LINE 118 "src/IGraph/Internal/Data.chs" #-}
igraphVectorPtrSize :: (VectorPtr) -> IO ((Int))
igraphVectorPtrSize a1 =
(withVectorPtr) a1 $ \a1' ->
igraphVectorPtrSize'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
{-# LINE 119 "src/IGraph/Internal/Data.chs" #-}
fromPtrs :: [Ptr ()] -> IO VectorPtr
fromPtrs xs = do
vptr <- igraphVectorPtrNew n
forM_ (zip [0..] xs) $ \(i,x) -> igraphVectorPtrSet vptr i x
return vptr
where
n = length xs
{-# INLINE fromPtrs #-}
toLists :: VectorPtr -> IO [[Double]]
toLists vpptr = do
n <- igraphVectorPtrSize vpptr
forM [0..n-1] $ \i -> do
vptr <- igraphVectorPtrE vpptr i
vec <- newForeignPtr_ $ castPtr vptr
toList $ Vector vec
{-# INLINE toLists #-}
newtype StrVector = StrVector (C2HSImp.ForeignPtr (StrVector))
withStrVector :: StrVector -> (C2HSImp.Ptr StrVector -> IO b) -> IO b
withStrVector (StrVector fptr) = C2HSImp.withForeignPtr fptr
{-# LINE 143 "src/IGraph/Internal/Data.chs" #-}
igraphStrvectorNew :: (Int) -> IO ((StrVector))
igraphStrvectorNew a2 =
C2HSImp.mallocForeignPtrBytes 16 >>= \a1'' -> C2HSImp.withForeignPtr a1'' $ \a1' ->
let {a2' = fromIntegral a2} in
igraphStrvectorNew'_ a1' a2' >>
return (StrVector a1'')
{-# LINE 145 "src/IGraph/Internal/Data.chs" #-}
igraphStrvectorGet :: (StrVector) -> (Int) -> IO ((String))
igraphStrvectorGet a1 a2 =
(withStrVector) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
alloca $ \a3' ->
igraphStrvectorGet'_ a1' a2' a3' >>= \res ->
peekString a3'>>= \a3'' ->
return (a3'')
{-# LINE 151 "src/IGraph/Internal/Data.chs" #-}
peekString :: Ptr CString -> IO String
peekString ptr = peek ptr >>= peekCString
{-# INLINE peekString #-}
igraphStrvectorSet :: (StrVector) -> (Int) -> (CString) -> IO ()
igraphStrvectorSet a1 a2 a3 =
(withStrVector) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = id a3} in
igraphStrvectorSet'_ a1' a2' a3' >>
return ()
{-# LINE 157 "src/IGraph/Internal/Data.chs" #-}
igraphStrvectorSet2 :: (StrVector) -> (Int) -> (CString) -> (Int) -> IO ()
igraphStrvectorSet2 a1 a2 a3 a4 =
(withStrVector) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = id a3} in
let {a4' = fromIntegral a4} in
igraphStrvectorSet2'_ a1' a2' a3' a4' >>
return ()
{-# LINE 158 "src/IGraph/Internal/Data.chs" #-}
toStrVector :: [B.ByteString] -> IO StrVector
toStrVector xs = do
vec <- igraphStrvectorNew n
forM_ (zip [0..] xs) $ \(i,x) -> B.useAsCString x (igraphStrvectorSet vec i)
return vec
where
n = length xs
newtype BSLen = BSLen CStringLen
instance Storable BSLen where
sizeOf _ = 16
{-# LINE 176 "src/IGraph/Internal/Data.chs" #-}
alignment _ = 8
{-# LINE 177 "src/IGraph/Internal/Data.chs" #-}
peek p = do
n <- ((\ptr -> do {C2HSImp.peekByteOff ptr 0 :: IO C2HSImp.CULong}) p)
ptr <- (\ptr -> do {C2HSImp.peekByteOff ptr 8 :: IO (C2HSImp.Ptr C2HSImp.CChar)}) p
return $ BSLen (ptr, fromIntegral n)
poke p (BSLen (ptr, n)) = (\ptr val -> do {C2HSImp.pokeByteOff ptr 0 (val :: C2HSImp.CULong)}) p (fromIntegral n) >>
(\ptr val -> do {C2HSImp.pokeByteOff ptr 8 (val :: (C2HSImp.Ptr C2HSImp.CChar))}) p ptr
newtype BSVector = BSVector (C2HSImp.ForeignPtr (BSVector))
withBSVector :: BSVector -> (C2HSImp.Ptr BSVector -> IO b) -> IO b
withBSVector (BSVector fptr) = C2HSImp.withForeignPtr fptr
{-# LINE 185 "src/IGraph/Internal/Data.chs" #-}
bsvectorNew :: (Int) -> IO ((BSVector))
bsvectorNew a2 =
C2HSImp.mallocForeignPtrBytes 16 >>= \a1'' -> C2HSImp.withForeignPtr a1'' $ \a1' ->
let {a2' = fromIntegral a2} in
bsvectorNew'_ a1' a2' >>
return (BSVector a1'')
{-# LINE 187 "src/IGraph/Internal/Data.chs" #-}
bsvectorSet :: (BSVector) -> (Int) -> (Ptr ()) -> IO ()
bsvectorSet a1 a2 a3 =
(withBSVector) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = id a3} in
bsvectorSet'_ a1' a2' a3' >>
return ()
{-# LINE 198 "src/IGraph/Internal/Data.chs" #-}
toBSVector :: [BSLen] -> IO BSVector
toBSVector xs = do
vec <- bsvectorNew n
forM_ (zip [0..] xs) $ \(i, x) -> with x $ \ptr -> bsvectorSet vec i $ castPtr ptr
return vec
where
n = length xs
newtype Matrix = Matrix (C2HSImp.ForeignPtr (Matrix))
withMatrix :: Matrix -> (C2HSImp.Ptr Matrix -> IO b) -> IO b
withMatrix (Matrix fptr) = C2HSImp.withForeignPtr fptr
{-# LINE 209 "src/IGraph/Internal/Data.chs" #-}
igraphMatrixNew :: (Int) -> (Int) -> IO ((Matrix))
igraphMatrixNew a2 a3 =
C2HSImp.mallocForeignPtrBytes 40 >>= \a1'' -> C2HSImp.withForeignPtr a1'' $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
igraphMatrixNew'_ a1' a2' a3' >>
return (Matrix a1'')
{-# LINE 211 "src/IGraph/Internal/Data.chs" #-}
igraphMatrixNull :: (Matrix) -> IO ()
igraphMatrixNull a1 =
(withMatrix) a1 $ \a1' ->
igraphMatrixNull'_ a1' >>
return ()
{-# LINE 213 "src/IGraph/Internal/Data.chs" #-}
igraphMatrixFill :: (Matrix) -> (Double) -> IO ()
igraphMatrixFill a1 a2 =
(withMatrix) a1 $ \a1' ->
let {a2' = realToFrac a2} in
igraphMatrixFill'_ a1' a2' >>
return ()
{-# LINE 215 "src/IGraph/Internal/Data.chs" #-}
igraphMatrixE :: (Matrix) -> (Int) -> (Int) -> IO ((Double))
igraphMatrixE a1 a2 a3 =
(withMatrix) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
igraphMatrixE'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 217 "src/IGraph/Internal/Data.chs" #-}
igraphMatrixSet :: (Matrix) -> (Int) -> (Int) -> (Double) -> IO ()
igraphMatrixSet a1 a2 a3 a4 =
(withMatrix) a1 $ \a1' ->
let {a2' = fromIntegral a2} in
let {a3' = fromIntegral a3} in
let {a4' = realToFrac a4} in
igraphMatrixSet'_ a1' a2' a3' a4' >>
return ()
{-# LINE 219 "src/IGraph/Internal/Data.chs" #-}
igraphMatrixCopyTo :: (Matrix) -> (Ptr CDouble) -> IO ()
igraphMatrixCopyTo a1 a2 =
(withMatrix) a1 $ \a1' ->
let {a2' = id a2} in
igraphMatrixCopyTo'_ a1' a2' >>
return ()
{-# LINE 221 "src/IGraph/Internal/Data.chs" #-}
igraphMatrixNrow :: (Matrix) -> IO ((Int))
igraphMatrixNrow a1 =
(withMatrix) a1 $ \a1' ->
igraphMatrixNrow'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
{-# LINE 223 "src/IGraph/Internal/Data.chs" #-}
igraphMatrixNcol :: (Matrix) -> IO ((Int))
igraphMatrixNcol a1 =
(withMatrix) a1 $ \a1' ->
igraphMatrixNcol'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
{-# LINE 225 "src/IGraph/Internal/Data.chs" #-}
fromRowLists :: [[Double]] -> IO Matrix
fromRowLists xs
| all (==c) $ map length xs = do
mptr <- igraphMatrixNew r c
forM_ (zip [0..] xs) $ \(i, row) ->
forM_ (zip [0..] row) $ \(j,v) ->
igraphMatrixSet mptr i j v
return mptr
| otherwise = error "Not a matrix."
where
r = length xs
c = length $ head xs
toRowLists :: Matrix -> IO [[Double]]
toRowLists = liftM transpose . toColumnLists
toColumnLists :: Matrix -> IO [[Double]]
toColumnLists mptr = do
r <- igraphMatrixNrow mptr
c <- igraphMatrixNcol mptr
xs <- allocaArray (r*c) $ \ptr -> do
igraphMatrixCopyTo mptr ptr
peekArray (r*c) ptr
return $ chunksOf r $ map realToFrac xs
foreign import ccall "IGraph/Internal/Data.chs.h &igraph_vector_destroy"
igraph_vector_destroy :: C2HSImp.FinalizerPtr Vector
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_init"
igraphVectorNew'_ :: ((C2HSImp.Ptr (Vector)) -> (C2HSImp.CLong -> (IO C2HSImp.CInt)))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_init_copy"
igraphVectorInitCopy'_ :: ((C2HSImp.Ptr (Vector)) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CLong -> (IO C2HSImp.CInt))))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_null"
igraphVectorNull'_ :: ((C2HSImp.Ptr (Vector)) -> (IO ()))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_fill"
igraphVectorFill'_ :: ((C2HSImp.Ptr (Vector)) -> (C2HSImp.CDouble -> (IO ())))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_e"
igraphVectorE'_ :: ((C2HSImp.Ptr (Vector)) -> (C2HSImp.CLong -> (IO C2HSImp.CDouble)))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_set"
igraphVectorSet'_ :: ((C2HSImp.Ptr (Vector)) -> (C2HSImp.CLong -> (C2HSImp.CDouble -> (IO ()))))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_tail"
igraphVectorTail'_ :: ((C2HSImp.Ptr (Vector)) -> (IO C2HSImp.CDouble))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_copy_to"
igraphVectorCopyTo'_ :: ((C2HSImp.Ptr (Vector)) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (IO ())))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_size"
igraphVectorSize'_ :: ((C2HSImp.Ptr (Vector)) -> (IO C2HSImp.CLong))
foreign import ccall "IGraph/Internal/Data.chs.h &igraph_vector_ptr_destroy_all"
igraph_vector_ptr_destroy_all :: C2HSImp.FinalizerPtr VectorPtr
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_ptr_init"
igraphVectorPtrNew'_ :: ((C2HSImp.Ptr (VectorPtr)) -> (C2HSImp.CLong -> (IO C2HSImp.CInt)))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_ptr_e"
igraphVectorPtrE'_ :: ((C2HSImp.Ptr (VectorPtr)) -> (C2HSImp.CLong -> (IO (C2HSImp.Ptr ()))))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_ptr_set"
igraphVectorPtrSet'_ :: ((C2HSImp.Ptr (VectorPtr)) -> (C2HSImp.CLong -> ((C2HSImp.Ptr ()) -> (IO ()))))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_vector_ptr_size"
igraphVectorPtrSize'_ :: ((C2HSImp.Ptr (VectorPtr)) -> (IO C2HSImp.CLong))
foreign import ccall "IGraph/Internal/Data.chs.h &igraph_strvector_destroy"
igraph_strvector_destroy :: C2HSImp.FinalizerPtr StrVector
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_strvector_init"
igraphStrvectorNew'_ :: ((C2HSImp.Ptr (StrVector)) -> (C2HSImp.CLong -> (IO C2HSImp.CInt)))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_strvector_get"
igraphStrvectorGet'_ :: ((C2HSImp.Ptr (StrVector)) -> (C2HSImp.CLong -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_strvector_set"
igraphStrvectorSet'_ :: ((C2HSImp.Ptr (StrVector)) -> (C2HSImp.CLong -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO C2HSImp.CInt))))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_strvector_set2"
igraphStrvectorSet2'_ :: ((C2HSImp.Ptr (StrVector)) -> (C2HSImp.CLong -> ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))))
foreign import ccall "IGraph/Internal/Data.chs.h &bsvector_destroy"
bsvector_destroy :: C2HSImp.FinalizerPtr BSVector
foreign import ccall safe "IGraph/Internal/Data.chs.h bsvector_init"
bsvectorNew'_ :: ((C2HSImp.Ptr (BSVector)) -> (C2HSImp.CLong -> (IO C2HSImp.CInt)))
foreign import ccall safe "IGraph/Internal/Data.chs.h bsvector_set"
bsvectorSet'_ :: ((C2HSImp.Ptr (BSVector)) -> (C2HSImp.CLong -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))))
foreign import ccall "IGraph/Internal/Data.chs.h &igraph_matrix_destroy"
igraph_matrix_destroy :: C2HSImp.FinalizerPtr Matrix
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_matrix_init"
igraphMatrixNew'_ :: ((C2HSImp.Ptr (Matrix)) -> (C2HSImp.CLong -> (C2HSImp.CLong -> (IO C2HSImp.CInt))))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_matrix_null"
igraphMatrixNull'_ :: ((C2HSImp.Ptr (Matrix)) -> (IO ()))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_matrix_fill"
igraphMatrixFill'_ :: ((C2HSImp.Ptr (Matrix)) -> (C2HSImp.CDouble -> (IO ())))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_matrix_e"
igraphMatrixE'_ :: ((C2HSImp.Ptr (Matrix)) -> (C2HSImp.CLong -> (C2HSImp.CLong -> (IO C2HSImp.CDouble))))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_matrix_set"
igraphMatrixSet'_ :: ((C2HSImp.Ptr (Matrix)) -> (C2HSImp.CLong -> (C2HSImp.CLong -> (C2HSImp.CDouble -> (IO ())))))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_matrix_copy_to"
igraphMatrixCopyTo'_ :: ((C2HSImp.Ptr (Matrix)) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (IO ())))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_matrix_nrow"
igraphMatrixNrow'_ :: ((C2HSImp.Ptr (Matrix)) -> (IO C2HSImp.CLong))
foreign import ccall safe "IGraph/Internal/Data.chs.h igraph_matrix_ncol"
igraphMatrixNcol'_ :: ((C2HSImp.Ptr (Matrix)) -> (IO C2HSImp.CLong))