# Path: Echobase/Common/errors.py
# def check_dims(arr, nd):
# def check_type(obj, typ):
# def check_function(obj):
# def check_path(path):
# def make_path(path):
# def check_path_overwrite(path):
# def check_has_key(dictionary, key_ref):


import numpy as np
from ...Common import errors
Measurements of global network topology

Created by: Ankit Khambhati

Change Log
----------
2016/03/10 - Implemented DegrCentral, EvecCentral, SyncCentral pipes
"""

from __future__ import division



def synchronizability(adj):
    """
    Function for computing synchronizability given the network topology

    Parameters
    ----------
        adj: ndarray, shape (N, N)
            Undirected, symmetric adjacency matrix with N nodes

    Returns
    -------
        sync: float
            Synchronizability of the adjacency matrix (lambda_2 / lambda_max)
    """

    # Standard param checks
    errors.check_type(adj, np.ndarray)

# Path: Echobase/Common/errors.py
# def check_dims(arr, nd):
# def check_type(obj, typ):
# def check_function(obj):
# def check_path(path):
# def make_path(path):
# def check_path_overwrite(path):
# def check_has_key(dictionary, key_ref):


# Path: Echobase/Network/Metrics/globaltopo.py
import numpy as np
from ...Common import errors

Measurements of global network topology

Created by: Ankit Khambhati

Change Log
----------
2016/03/10 - Implemented DegrCentral, EvecCentral, SyncCentral pipes
"""

from __future__ import division



def synchronizability(adj):
    """
    Function for computing synchronizability given the network topology

    Parameters
    ----------
        adj: ndarray, shape (N, N)
            Undirected, symmetric adjacency matrix with N nodes

    Returns
    -------
        sync: float
            Synchronizability of the adjacency matrix (lambda_2 / lambda_max)
    """

    # Standard param checks
    errors.check_type(adj, np.ndarray)

    errors.check_dims(adj, 2)