Safe Haskell | None |
---|---|
Language | Haskell2010 |
Extensions |
|
YH数列システム 2.0.1 の定義。
ここでは Data.IntSet と Data.Vector を活用している。
英語では YH sequence system 2.0.1 と呼ぶことにする。短く呼ぶときは YHSS 2.0.1 と呼ぶことにする。
Synopsis
- genVec :: (Ord i, Integral i) => i -> (i -> a) -> Vector a
- newtype Sequence = Sequence {
- unSequence :: Vector Int
- ixSeq :: Sequence -> Int -> Int
- makeSeqFromList :: [Int] -> Sequence
- newtype Difference = Difference {
- unDifference :: Int
- newtype Index = Index {}
- newtype IndexSet = IndexSet {
- unIndexSet :: IntSet
- newtype Depth = Depth {}
- data Mountain = Mountain {}
- ixMtToDiff :: Mountain -> Index -> Depth -> Difference
- ixMtToPaet :: Mountain -> Index -> Depth -> Index
- ixMtToAnce :: Mountain -> Index -> Depth -> IndexSet
- calcDiffOnMtFromSeqWiM :: Mountain -> Sequence -> Index -> Depth -> Difference
- calcPaetOnMtFromSeqWiM :: Mountain -> Index -> Depth -> Index
- calcAnceOnMtFromSeqWiM :: Mountain -> Index -> Depth -> IndexSet
- isAnceAtSh :: Mountain -> Index -> Depth -> Index -> Bool
- calcMtFromSeq :: Sequence -> Mountain
- newtype Class = Class {}
- data CofType
- calcBottom :: Mountain -> Index -> Depth
- calcCofType :: Mountain -> CofType
- data DPN = DPN {}
- ixDpnToDiff :: DPN -> Index -> Difference
- ixDpnToPaet :: DPN -> Index -> Vector Index
- ixDpnToNpth :: DPN -> Index -> Depth
- calcLimitDepth :: Mountain -> Depth
- calcMaxDepth :: Mountain -> Index -> Depth
- calcDiffOnDpn :: Mountain -> Index -> Difference
- calcPaetOnDpn :: Mountain -> Index -> Vector Index
- calcNpthOnDpn :: Mountain -> Index -> Depth
- calcDpn :: Mountain -> DPN
- calcBadRoot :: Mountain -> Index
- calcDiffAtExp :: Mountain -> Index -> Difference
- calcPaetAtExp :: Mountain -> Index -> Vector Index
- calcNpthAtExp :: Mountain -> Index -> Depth
- expandMtAtLim1 :: Mountain -> Int -> DPN
- calcDiffOnMtFromDpnWiM :: Mountain -> DPN -> Index -> Depth -> Difference
- calcPaetOnMtFromDpnWiM :: DPN -> Index -> Depth -> Index
- calcAnceOnMtFromDpnWiM :: Mountain -> Index -> Depth -> IndexSet
- calcMtFromDpn :: DPN -> Mountain
- calcSeqFromMt :: Mountain -> Sequence
- expandSeqAtLim1 :: Sequence -> Int -> Sequence
- data ExpandingError
- expandSeq :: Sequence -> Int -> Either ExpandingError Sequence
- makeListFromSeq :: Sequence -> [Int]
- expandList :: [Int] -> Int -> Either ExpandingError [Int]
Documentation
genVec :: (Ord i, Integral i) => i -> (i -> a) -> Vector a Source #
1 から n までの配列に関数を適用する。
0 が与えられた場合は空の配列を返す。
数列、または列。
makeSeqFromList :: [Int] -> Sequence Source #
リストから数列を作る。
newtype Difference Source #
階差。
数列の階差を取った列を階差列と呼ぶことにする。たとえば (1,2,4,8,16,...) の階差列は (0,1,2,4,8,...) だ。
Instances
Instances
Bounded Index Source # | |
Enum Index Source # | |
Eq Index Source # | |
Integral Index Source # | |
Num Index Source # | |
Ord Index Source # | |
Read Index Source # | |
Real Index Source # | |
Defined in Numeric.YHSeq.V0201 toRational :: Index -> Rational # | |
Show Index Source # | |
Semigroup Index Source # | |
Monoid Index Source # | |
添字の集合。
添字の集合と言っても、たぶん先祖の集合を表すのにしか使わないと思う。
深さ。
YHSS 2.0.1 では、深さは 0 にならない。
Instances
Bounded Depth Source # | |
Enum Depth Source # | |
Eq Depth Source # | |
Integral Depth Source # | |
Num Depth Source # | |
Ord Depth Source # | |
Read Depth Source # | |
Real Depth Source # | |
Defined in Numeric.YHSeq.V0201 toRational :: Depth -> Rational # | |
Show Depth Source # | |
Semigroup Depth Source # | |
Monoid Depth Source # | |
山。
条件として dMt と pMt と aMt の長さはそれぞれ sMt に等しい。
ixMtToDiff :: Mountain -> Index -> Depth -> Difference Source #
山から階差を添字で取得する。
calcDiffOnMtFromSeqWiM :: Mountain -> Sequence -> Index -> Depth -> Difference Source #
メモを参照しながら数列から山の階差の部分を計算する。
calcAnceOnMtFromSeqWiM :: Mountain -> Index -> Depth -> IndexSet Source #
メモを参照しながら数列から山の先祖の集合の部分を計算する。
isAnceAtSh :: Mountain -> Index -> Depth -> Index -> Bool Source #
一つ浅い深さで先祖であるか。
名前は at shallow の略である。
calcMtFromSeq :: Sequence -> Mountain Source #
数列から山を計算する。
クラス。
Instances
Bounded Class Source # | |
Enum Class Source # | |
Eq Class Source # | |
Integral Class Source # | |
Num Class Source # | |
Ord Class Source # | |
Read Class Source # | |
Real Class Source # | |
Defined in Numeric.YHSeq.V0201 toRational :: Class -> Rational # | |
Show Class Source # | |
Semigroup Class Source # | |
Monoid Class Source # | |
共終タイプ。
順序数に対して定義される数学的な共終数ではない。
calcBottom :: Mountain -> Index -> Depth Source #
階差が存在する最も大きい深さを、それぞれの添字について計算する。
ここで 0 の深さが現れているが、深さ 1 での階差が 0 でない限り、最終的な計算結果の深さは 0 にならない。
calcCofType :: Mountain -> CofType Source #
共終タイプを計算する。
DPN 形式。
条件として dDPN と pDPN と nDPN の長さはそれぞれ sDPN に等しい。
ixDpnToDiff :: DPN -> Index -> Difference Source #
DPN 形式から階差を添字で取得する。
calcLimitDepth :: Mountain -> Depth Source #
展開に関わる最も大きい深さを計算する。
calcDiffOnDpn :: Mountain -> Index -> Difference Source #
DPN 形式での階差の部分を計算する。
calcBadRoot :: Mountain -> Index Source #
悪部根を計算する。
calcDiffAtExp :: Mountain -> Index -> Difference Source #
展開する際の階差の部分を計算する。
calcDiffOnMtFromDpnWiM :: Mountain -> DPN -> Index -> Depth -> Difference Source #
メモを参照しながら DPN 形式から山の階差の部分を計算する。
calcAnceOnMtFromDpnWiM :: Mountain -> Index -> Depth -> IndexSet Source #
メモを参照しながら DPN 形式から山の先祖の集合の部分を計算する。
calcMtFromDpn :: DPN -> Mountain Source #
DPN 形式から山を計算する。
calcSeqFromMt :: Mountain -> Sequence Source #
山から数列を計算する。
data ExpandingError Source #
expandSeq
および expandList
におけるエラーを表現する型。
OutOfIndexOnFunSeq | 基本列において範囲から外れている時。 |
OutOfClass | クラスが範囲から外れている時。 |
Instances
makeListFromSeq :: Sequence -> [Int] Source #
数列からリストを作る。
expandList :: [Int] -> Int -> Either ExpandingError [Int] Source #
リストを展開する。