When representing 2^n x 2^n matrices using quadtrees

461 views Asked by At

I've just found the definition on my textbook and can't imagine what nexp is supposed to do/mean:

data (Eq a, Show a) => QT a = C a | Q (QT a) (QT a) (QT a) (QT a)
    deriving (Eq, Show)

data (Eq a, Num a, Show a) => Mat a = Mat {
    nexp :: Int,
    mat :: QT a}
    deriving (Eq,Show)

What is the purpose of nexp :: Int?

1

There are 1 answers

1
Dan Burton On BEST ANSWER

My best guess is that nexp is just the n used in the exp-onent to define how large the matrix is (2^n x 2^n).