# Path: megaman/geometry/adjacency.py
# def compute_adjacency_matrix(X, method='auto', **kwargs):
#     """Compute an adjacency matrix with the given method"""
#     if method == 'auto':
#         if X.shape[0] > 10000:
#             method = 'cyflann'
#         else:
#             method = 'kd_tree'
#     return Adjacency.init(method, **kwargs).adjacency_graph(X.astype('float'))


    import matplotlib
    import matplotlib.pyplot as plt
import sys, time
import numpy as np
from numpy import polyfit
from megaman.geometry.adjacency import compute_adjacency_matrix
#!/usr/bin/env python
from __future__ import division
try:
    MATPLOTLIB_LOADED = True
    matplotlib.use('Agg')
except ImportError:
    MATPLOTLIB_LOADED = False




def compute_largest_radius_distance(X, rad, adjacency_method, adjacency_kwds):
    print('computing distance matrix...')
    adjacency_kwds['radius'] = rad
    t0 = time.time()

# Path: megaman/geometry/adjacency.py
# def compute_adjacency_matrix(X, method='auto', **kwargs):
#     """Compute an adjacency matrix with the given method"""
#     if method == 'auto':
#         if X.shape[0] > 10000:
#             method = 'cyflann'
#         else:
#             method = 'kd_tree'
#     return Adjacency.init(method, **kwargs).adjacency_graph(X.astype('float'))


# Path: megaman/utils/analyze_dimension_and_radius.py
    import matplotlib
    import matplotlib.pyplot as plt
import sys, time
import numpy as np
from numpy import polyfit
from megaman.geometry.adjacency import compute_adjacency_matrix

#!/usr/bin/env python
from __future__ import division
try:
    MATPLOTLIB_LOADED = True
    matplotlib.use('Agg')
except ImportError:
    MATPLOTLIB_LOADED = False




def compute_largest_radius_distance(X, rad, adjacency_method, adjacency_kwds):
    print('computing distance matrix...')
    adjacency_kwds['radius'] = rad
    t0 = time.time()

    dists = compute_adjacency_matrix(X,adjacency_method,**adjacency_kwds)