Skip to content

Commit 2350455

Browse files
committed
replace constant upper bound with LED buffer
1 parent 8db081b commit 2350455

File tree

1 file changed

+12
-0
lines changed
  • src/commonMain/kotlin/ai/hypergraph/kaliningraph/automata

1 file changed

+12
-0
lines changed

src/commonMain/kotlin/ai/hypergraph/kaliningraph/automata/FSA.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ open class FSA constructor(open val Q: TSA, open val init: Set<Σᐩ>, open val
6969
aps
7070
}
7171

72+
open val adjMatrix: IntArray by lazy {
73+
val adj = IntArray(numStates * numStates)
74+
75+
for ((fromLabel, _, toLabel) in Q) {
76+
val i = stateMap[fromLabel]!!
77+
val j = stateMap[toLabel]!!
78+
adj[i*numStates + j] = 1
79+
}
80+
81+
adj
82+
}
83+
7284
open val midpoints: List<List<List<Int>>> by lazy { TODO() }
7385

7486
val finalIdxs by lazy { final.map { stateMap[it]!! }.filter { 0 < idsToCoords[it]!!.second } }

0 commit comments

Comments
 (0)