Skip to content

Commit 703a815

Browse files
committed
fixed isTree
1 parent 602a552 commit 703a815

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/treeGBP.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function isTree(gbp::Union{ContinuousModel, ContinuousTreeModel, DiscreteTreeMod
165165

166166
## Pilling the factor graph
167167
hasSingleVariable = true; hasSingleFactor = true;
168-
@inbounds while hasSingleFactor || hasSingleVariable
168+
while hasSingleFactor || hasSingleVariable
169169
for variable in iterateVariable
170170
factor = colptr[variable][1]
171171
for (k, variables) in enumerate(rowptr[factor])
@@ -183,6 +183,14 @@ function isTree(gbp::Union{ContinuousModel, ContinuousTreeModel, DiscreteTreeMod
183183
end
184184
iterateVariable = Int64[]
185185

186+
flag = true
187+
for i in rowptr[iterateFactor]
188+
if !isempty(i)
189+
flag = false
190+
end
191+
end
192+
if flag break end
193+
186194
for factor in iterateFactor
187195
variable = rowptr[factor][1]
188196
for (k, factors) in enumerate(colptr[variable])

0 commit comments

Comments
 (0)