{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In LAPACK, the naming convention is that all functions start with a type prefix, which depends on the type of the principal matrix. These can be one of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "{'s', 'd', 'c', 'z'}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for the NumPy types "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "{float32, float64, complex64, complex128}"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " respectively, and are stored in attribute "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "typecode"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of the returned functions."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "RuntimeError",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If the requested LP64/ILP64 variant is not available."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "funcs",
              "annotation": "list",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "List containing the found function(s)."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Return available LAPACK function objects from names."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "names",
              "annotation": "str or sequence of str",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Name(s) of LAPACK functions without type prefix."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "arrays",
              "annotation": "sequence of ndarrays, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Arrays can be given to determine optimal prefix of LAPACK routines. If not given, double-precision routines will be used, otherwise the most generic type in arrays will be used."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "dtype",
              "annotation": "str or dtype, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Data-type specifier. Not used if "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "arrays"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is non-empty."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "ilp64",
              "annotation": "{True, False, 'preferred'}, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Whether to return ILP64 routine variant. Choosing 'preferred' returns ILP64 routine if available, and otherwise the 32-bit routine. Default: "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "'preferred'"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Arrays are used to determine the optimal prefix of LAPACK routines."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/linalg/lapack.py",
  "item_line": 951,
  "item_type": "function",
  "aliases": [
    "scipy.linalg.get_lapack_funcs"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Suppose we would like to use '?lange' routine which computes the selected\nnorm of an array. We pass our array in order to get the correct 'lange'\nflavor.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nimport scipy.linalg as LA\nrng = np.random.default_rng()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "a = rng.random((3, 2))\nx_lange = LA.get_lapack_funcs('lange', (a,))\nx_lange.typecode\nx_lange = LA.get_lapack_funcs('lange', (a*1j,))\nx_lange.typecode\n",
        "execution_status": "success",
        "out": "'z'\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nIf you want to select a specific LAPACK variant instead of relying on array types,\nuse the ``dtype=`` argument:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "LA.get_lapack_funcs('lange', dtype=np.float32)\n",
        "execution_status": "success",
        "out": "<fortran function slange>\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe ``int_dtype`` attribute stores whether the routine is ILP64 (integer arguments\nand outputs are 64-bit) or LP64 (integer arguments and outputs are 32-bit):\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "x_lange.int_dtype\n",
        "execution_status": "failure",
        "out": "dtype('int32')\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n**Work size computations**\n\nSeveral LAPACK routines work best when its internal WORK array has\nthe optimal size (big enough for fast computation and small enough to\navoid waste of memory). This size is determined also by a dedicated query\nto the function which is often wrapped as a standalone function and\ncommonly denoted as ``###_lwork``. Below is an example for ``?sysv``\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "a = rng.random((1000, 1000))\nb = rng.random((1000, 1)) * 1j\n# We pick up zsysv and zsysv_lwork due to b array\nxsysv, xlwork = LA.get_lapack_funcs(('sysv', 'sysv_lwork'), (a, b))\nopt_lwork, _ = xlwork(a.shape[0])  # returns a complex for 'z' prefix\nudut, ipiv, x, info = xsysv(a, b, lwork=int(opt_lwork.real))\n",
        "execution_status": "success",
        "out": ""
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "scipy.linalg.blas.get_blas_funcs",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.linalg.blas:get_blas_funcs"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A similar routine for selecting BLAS functions."
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "names",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "arrays",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "()"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "dtype",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "ilp64",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "preferred"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "get_lapack_funcs"
  },
  "references": null,
  "qa": "scipy.linalg.lapack:get_lapack_funcs",
  "arbitrary": [],
  "local_refs": [
    "arrays",
    "dtype",
    "funcs",
    "ilp64",
    "names"
  ]
}