class_docstr: Bipartite graph class
  
  A graph for which there are two types of nodes, such that
  edges can exist only between nodes of type 1 and type 2 (not within)
  fields of this class:
  V (int, > 0) the number of type 1 vertices
  W (int, > 0) the number of type 2 vertices
  E: (int) the number of edges
  edges: array of shape (self.E, 2) reprensenting pairwise neighbors
  weights, array of shape (self.E), +1/-1 for scending/descending links
class_docstr_tok: ["Bipartite","graph","class","A","graph","for","which","there","are","two","types","of","nodes",",","such","that","edges","can","exist","only","between","nodes","of","type","1","and","type","2","(","not","within",")","fields","of","this","class",":","V","(","int",",",">","0",")","the","number","of","type","1","vertices","W","(","int",",",">","0",")","the","number","of","type","2","vertices","E",":","(","int",")","the","number","of","edges","edges",":","array","of","shape","(","self.E",",","2",")","reprensenting","pairwise","neighbors","weights",",","array","of","shape","(","self.E",")",",","+1\/-1","for","scending\/descending","links"]
docstr: Set edges to graph
  
  sets self.edges=edges if
       1. edges has a correct size
       2. edges take values in [0..V-1]*[0..W-1]
  
  Parameters
  ----------
  edges: array of shape(self.E, 2): set of candidate edges
docstr_tok: ["Set","edges","to","graph","sets","self.edges=edges","if","1.","edges","has","a","correct","size","2.","edges","take","values","in","[","0","..","V-1","]","*","[","0","..","W-1","]","Parameters","--","--","--","--","--","edges",":","array","of","shape","(","self.E",",","2",")",":","set","of","candidate","edges"]
code: def set_edges(self, edges):
      """Set edges to graph
  
      sets self.edges=edges if
           1. edges has a correct size
           2. edges take values in [0..V-1]*[0..W-1]
  
      Parameters
      ----------
      edges: array of shape(self.E, 2): set of candidate edges
      """
      if np.shape(edges) != np.shape(self.edges):
          raise ValueError("Incompatible size of the edge matrix")
  
      if np.size(edges) > 0:
          if edges.max(0)[0] + 1 > self.V:
              raise ValueError("Incorrect edge specification")
          if edges.max(0)[1] + 1 > self.W:
              raise ValueError("Incorrect edge specification")
      self.edges = edges
  
file_path: nipy/nipy/algorithms/graph/bipartite_graph.py
imports: import numpy
label_desc: Use image node_id 3 for calling the BipartiteGraph obj's underlying member method code with example usage: obj.set_edges(edges) without return types