class_docstr: Define basic tools for triangular mesh analysis and improvement.
  
  A TriAnalizer encapsulates a :class:`~matplotlib.tri.Triangulation`
  object and provides basic tools for mesh analysis and mesh improvement.
  
  Parameters
  ----------
  triangulation : :class:`~matplotlib.tri.Triangulation` object
      The encapsulated triangulation to analyze.
  
  Attributes
  ----------
  `scale_factors`
class_docstr_tok: ["Define","basic","tools","for","triangular","mesh","analysis","and","improvement",".","A","TriAnalizer","encapsulates","a",":","class",":","`","~matplotlib.tri.Triangulation","`","object","and","provides","basic","tools","for","mesh","analysis","and","mesh","improvement",".","Parameters","--","--","--","--","--","triangulation",":",":","class",":","`","~matplotlib.tri.Triangulation","`","object","The","encapsulated","triangulation","to","analyze",".","Attributes","--","--","--","--","--","`","scale_factors","`"]
docstr: Parameters
  ----------
  mask : 1d boolean array or None
      mask
  n : integer
      length of the mask. Useful only id mask can be None
  
  Returns
  -------
  renum : integer array
      array so that (`valid_array` being a compressed array
      based on a `masked_array` with mask *mask*) :
  
            - For all i such as mask[i] = False:
              valid_array[renum[i]] = masked_array[i]
            - For all i such as mask[i] = True:
              renum[i] = -1 (invalid value)
docstr_tok: ["Parameters","--","--","--","--","--","mask",":","1d","boolean","array","or","None","mask","n",":","integer","length","of","the","mask",".","Useful","only","id","mask","can","be","None","Returns","--","--","--","-","renum",":","integer","array","array","so","that","(","`","valid_array","`","being","a","compressed","array","based","on","a","`","masked_array","`","with","mask","*","mask","*",")",":","-","For","all","i","such","as","mask","[","i","]","=","False",":","valid_array","[","renum","[","i","]","]","=","masked_array","[","i","]","-","For","all","i","such","as","mask","[","i","]","=","True",":","renum","[","i","]","=","-1","(","invalid","value",")"]
code: def _total_to_compress_renum(mask, n=None):
      """
      Parameters
      ----------
      mask : 1d boolean array or None
          mask
      n : integer
          length of the mask. Useful only id mask can be None
  
      Returns
      -------
      renum : integer array
          array so that (`valid_array` being a compressed array
          based on a `masked_array` with mask *mask*) :
  
                - For all i such as mask[i] = False:
                  valid_array[renum[i]] = masked_array[i]
                - For all i such as mask[i] = True:
                  renum[i] = -1 (invalid value)
  
      """
      if n is None:
          n = np.size(mask)
      if mask is not None:
          renum = -np.ones(n, dtype=np.int32)  # Default num is -1
          valid = np.arange(n, dtype=np.int32).compress(~mask, axis=0)
          renum[valid] = np.arange(np.size(valid, 0), dtype=np.int32)
          return renum
      else:
          return np.arange(n, dtype=np.int32)
  
file_path: catboost/contrib/python/matplotlib/py2/matplotlib/tri/tritools.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  from matplotlib.tri import Triangulation
  import numpy
label_desc: Use image node_id 6 for calling the TriAnalyzer obj's underlying member method code with example usage: obj._total_to_compress_renum(mask, n) and returns: renum, np