src/HOL/Matrix_LP/FloatSparseMatrixBuilder.ML
changeset 52049 156e12d5cb92
parent 47455 26315a545e26
child 59058 a78612c67ec0
equal deleted inserted replaced
52048:9003b293e775 52049:156e12d5cb92
   261 
   261 
   262 fun v_elem_at v i = Inttab.lookup v i
   262 fun v_elem_at v i = Inttab.lookup v i
   263 fun m_elem_at m i = Inttab.lookup m i
   263 fun m_elem_at m i = Inttab.lookup m i
   264 
   264 
   265 fun v_only_elem v =
   265 fun v_only_elem v =
   266     case Inttab.min_key v of
   266     case Inttab.min v of
   267         NONE => NONE
   267         NONE => NONE
   268       | SOME vmin => (case Inttab.max_key v of
   268       | SOME (vmin, _) => (case Inttab.max v of
   269                           NONE => SOME vmin
   269                           NONE => SOME vmin
   270                         | SOME vmax => if vmin = vmax then SOME vmin else NONE)
   270                         | SOME (vmax, _) => if vmin = vmax then SOME vmin else NONE)
   271 
   271 
   272 fun v_fold f = Inttab.fold f;
   272 fun v_fold f = Inttab.fold f;
   273 fun m_fold f = Inttab.fold f;
   273 fun m_fold f = Inttab.fold f;
   274 
   274 
   275 fun indices_of_vector v = Inttab.keys v
   275 fun indices_of_vector v = Inttab.keys v