Module: RbMetis
- Defined in:
- lib/rbmetis/lib.rb,
lib/rbmetis/main.rb,
lib/rbmetis/version.rb
Defined Under Namespace
Classes: MetisError
Constant Summary collapse
- METIS_OK =
Returned normally
1
- METIS_ERROR_INPUT =
Returned due to erroneous inputs and/or options
-2 # Returned due to insufficient memory
- METIS_ERROR_MEMORY =
Returned due to insufficient memory
-3 # Some other errors
- METIS_ERROR =
Some other errors
-4
- NOPTIONS =
40
- DBG_INFO =
/*! Debug Levels */
1
- DBG_TIME =
2
- DBG_COARSEN =
4
- DBG_REFINE =
8
- DBG_IPART =
16
- DBG_MOVEINFO =
32
- DBG_SEPINFO =
64
- DBG_CONNINFO =
128
- DBG_CONTIGINFO =
256
- DBG_MEMORY =
2048
- VERSION =
"0.0.4"
Class Method Summary collapse
-
.default_options ⇒ Array
Initializes the options array into its default values.
-
.part_graph_kway(xadj, adjncy, npart, opts = {}) ⇒ Array
partition a graph into k parts using multilevel k-way partitioning.
-
.part_graph_recursive(xadj, adjncy, npart, opts = {}) ⇒ Array
partition a graph into k parts using multilevel recursive bisection.
Class Method Details
.default_options ⇒ Array
Initializes the options array into its default values. It’s size is METIS_NOPTIONS.
253 254 255 256 257 |
# File 'lib/rbmetis/main.rb', line 253 def = Lib.alloc_idx_ary([0]*40) Lib.METIS_SetDefaultOptions() Lib.read_idx_ary(,40) end |
.part_graph_kway(xadj, adjncy, npart, opts = {}) ⇒ Array
partition a graph into k parts using multilevel k-way partitioning.
237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/rbmetis/main.rb', line 237 def part_graph_kway(xadj, adjncy, npart, opts={}) # args = [ nvtxs, ncon, xadj, adjncy, vwgt, vsize, adjwgt, nparts, # tpwgts, ubvec, options, objval, part ] args = Lib.part_graph_preprocess(xadj, adjncy, npart, opts) retval = Lib.METIS_PartGraphKway(*args) Lib.postprocess(retval) part = args.last nv = xadj.size - 1 #p read_idx(objval) return Lib.read_idx_ary(part,nv) end |
.part_graph_recursive(xadj, adjncy, npart, opts = {}) ⇒ Array
partition a graph into k parts using multilevel recursive bisection.
190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/rbmetis/main.rb', line 190 def part_graph_recursive(xadj, adjncy, npart, opts={}) # args = [ nvtxs, ncon, xadj, adjncy, vwgt, vsize, adjwgt, nparts, # tpwgts, ubvec, options, objval, part ] args = Lib.part_graph_preprocess(xadj, adjncy, npart, opts) retval = Lib.METIS_PartGraphRecursive(*args) Lib.postprocess(retval) part = args.last nv = xadj.size - 1 #p read_idx(objval) return Lib.read_idx_ary(part,nv) end |