11mutable struct DiscreteSystem
22 probability:: Vector{Vector{Int64}}
33 table:: Vector{Array{Float64, N} where N}
4- jacobian :: SparseMatrixCSC{Float64,Int64}
5- jacobianTranspose :: SparseMatrixCSC{Float64,Int64}
4+ incidence :: SparseMatrixCSC{Float64,Int64}
5+ incidenceTranspose :: SparseMatrixCSC{Float64,Int64}
66 data:: String
77end
88
@@ -82,9 +82,9 @@ function readDiscreteArguments(args)
8282 table = args[2 ]
8383 end
8484
85- jacobian, jacobianTranspose = incidenceMatrix (probability)
85+ incidence, incidenceTranspose = incidenceMatrix (probability)
8686
87- return DiscreteSystem (probability, table, jacobian, jacobianTranspose , " noname" )
87+ return DiscreteSystem (probability, table, incidence, incidenceTranspose , " noname" )
8888end
8989
9090# ######### Load from HDF5 or XLSX files ##########
@@ -152,12 +152,12 @@ function readDiscreteFile(args)
152152 error (" The input data is not a valid format." )
153153 end
154154
155- jacobian, jacobianTranspose = incidenceMatrix (probability)
155+ incidence, incidenceTranspose = incidenceMatrix (probability)
156156
157- return DiscreteSystem (probability, table, jacobian, jacobianTranspose , dataname)
157+ return DiscreteSystem (probability, table, incidence, incidenceTranspose , dataname)
158158end
159159
160- # ######### Form incidence matrix ##########
160+ # ######### Incidence matrix ##########
161161function incidenceMatrix (probabilities)
162162 row = Int64[]; col = Int64[]
163163
@@ -167,16 +167,16 @@ function incidenceMatrix(probabilities)
167167 push! (col, variable)
168168 end
169169 end
170- jacobian = sparse (row, col, 1 )
171- jacobianTranspose = sparse (col, row, 1 )
170+ incidence = sparse (row, col, 1 )
171+ incidenceTranspose = sparse (col, row, 1 )
172172
173- return jacobian, jacobianTranspose
173+ return incidence, incidenceTranspose
174174end
175175
176176# ######### Produce the graphical model ##########
177177function makeDiscreteTreeGraph (system, virtualMessage, root)
178178 # ## Number of factor and variable nodes
179- Nfactor, Nvariable = size (system. jacobian )
179+ Nfactor, Nvariable = size (system. incidence )
180180
181181 # ## Pass through probabilities
182182 Nlink = 0
0 commit comments