geomfum.numerics package#

Submodules#

geomfum.numerics.eig module#

class geomfum.numerics.eig.ScipyEigsh(spectrum_size=6, sigma=None, which='LM')[source]#

Bases: object

geomfum.numerics.graph module#

Routines for working with graphs.

geomfum.numerics.graph.single_source_partial_dijkstra_path_length(graph, source, k, weight='weight')[source]#

Compute shortest-path distances from a source node to the k closest nodes.

Based on cumulative path cost, using an early-stopped Dijkstra’s algorithm.

The search terminates once k nodes (including the source itself) have been reached.

Parameters:
  • graph (networkx.Graph) – The input graph. Can be directed or undirected. Edge weights must be non-negative.

  • source (node) – The starting node for paths.

  • k (int) – Number of nodes to find distances to (including the source itself).

Returns:

length (dict) – Dict keyed by node to shortest path length from source.

geomfum.numerics.optimization module#

Optimization routines.

class geomfum.numerics.optimization.ScipyMinimize(method='L-BFGS-B', bounds=None, constraints=(), tol=None, callback=None, options=None, save_result=False)[source]#

Bases: object

Wrapper for scipy.optimize.minimize.

minimize(fun, x0, fun_jac=None, fun_hess=None, hessp=None)[source]#

Minimize objective function.

Parameters:
  • fun (callable) – The objective function to be minimized.

  • x0 (array-like) – Initial guess.

  • fun_jac (callable) – Jacobian of fun.

  • fun_hess (callable) – Hessian of fun.

  • hessp (callable)

Module contents#