开发者

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

开发者 https://www.devze.com 2023-02-09 06:49 出处:网络
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)

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?


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消