# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _matrix
else:
    import _matrix

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

_swig_new_instance_method = _matrix.SWIG_PyInstanceMethod_New
_swig_new_static_method = _matrix.SWIG_PyStaticMethod_New

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


import weakref

import mfem._par.vector
import mfem._par.array
import mfem._par.mem_manager
import mfem._par.operators
class Matrix(mfem._par.operators.Operator):
    r"""Proxy of C++ mfem::Matrix class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def IsSquare(self):
        r"""IsSquare(Matrix self) -> bool"""
        return _matrix.Matrix_IsSquare(self)
    IsSquare = _swig_new_instance_method(_matrix.Matrix_IsSquare)

    def Elem(self, *args):
        r"""
        Elem(Matrix self, int i, int j) -> double
        Elem(Matrix self, int i, int j) -> double const &
        """
        return _matrix.Matrix_Elem(self, *args)
    Elem = _swig_new_instance_method(_matrix.Matrix_Elem)

    def Inverse(self):
        r"""Inverse(Matrix self) -> MatrixInverse"""
        return _matrix.Matrix_Inverse(self)
    Inverse = _swig_new_instance_method(_matrix.Matrix_Inverse)

    def Finalize(self, arg2):
        r"""Finalize(Matrix self, int arg2)"""
        return _matrix.Matrix_Finalize(self, arg2)
    Finalize = _swig_new_instance_method(_matrix.Matrix_Finalize)
    __swig_destroy__ = _matrix.delete_Matrix

    def Print(self, *args):
        r"""
        Print(Matrix self, std::ostream & out=mfem::out, int width_=4)
        Print(Matrix self, char const * file, int precision=8)
        """
        return _matrix.Matrix_Print(self, *args)
    Print = _swig_new_instance_method(_matrix.Matrix_Print)

# Register Matrix in _matrix:
_matrix.Matrix_swigregister(Matrix)

class MatrixInverse(mfem._par.operators.Solver):
    r"""Proxy of C++ mfem::MatrixInverse class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _matrix.delete_MatrixInverse

# Register MatrixInverse in _matrix:
_matrix.MatrixInverse_swigregister(MatrixInverse)

class AbstractSparseMatrix(Matrix):
    r"""Proxy of C++ mfem::AbstractSparseMatrix class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def NumNonZeroElems(self):
        r"""NumNonZeroElems(AbstractSparseMatrix self) -> int"""
        return _matrix.AbstractSparseMatrix_NumNonZeroElems(self)
    NumNonZeroElems = _swig_new_instance_method(_matrix.AbstractSparseMatrix_NumNonZeroElems)

    def GetRow(self, row, cols, srow):
        r"""GetRow(AbstractSparseMatrix self, int const row, intArray cols, Vector srow) -> int"""
        return _matrix.AbstractSparseMatrix_GetRow(self, row, cols, srow)
    GetRow = _swig_new_instance_method(_matrix.AbstractSparseMatrix_GetRow)

    def EliminateZeroRows(self, threshold=1e-12):
        r"""EliminateZeroRows(AbstractSparseMatrix self, double const threshold=1e-12)"""
        return _matrix.AbstractSparseMatrix_EliminateZeroRows(self, threshold)
    EliminateZeroRows = _swig_new_instance_method(_matrix.AbstractSparseMatrix_EliminateZeroRows)

    def Mult(self, x, y):
        r"""Mult(AbstractSparseMatrix self, Vector x, Vector y)"""
        return _matrix.AbstractSparseMatrix_Mult(self, x, y)
    Mult = _swig_new_instance_method(_matrix.AbstractSparseMatrix_Mult)

    def AddMult(self, x, y, val=1.):
        r"""AddMult(AbstractSparseMatrix self, Vector x, Vector y, double const val=1.)"""
        return _matrix.AbstractSparseMatrix_AddMult(self, x, y, val)
    AddMult = _swig_new_instance_method(_matrix.AbstractSparseMatrix_AddMult)

    def MultTranspose(self, x, y):
        r"""MultTranspose(AbstractSparseMatrix self, Vector x, Vector y)"""
        return _matrix.AbstractSparseMatrix_MultTranspose(self, x, y)
    MultTranspose = _swig_new_instance_method(_matrix.AbstractSparseMatrix_MultTranspose)

    def AddMultTranspose(self, x, y, val=1.):
        r"""AddMultTranspose(AbstractSparseMatrix self, Vector x, Vector y, double const val=1.)"""
        return _matrix.AbstractSparseMatrix_AddMultTranspose(self, x, y, val)
    AddMultTranspose = _swig_new_instance_method(_matrix.AbstractSparseMatrix_AddMultTranspose)
    __swig_destroy__ = _matrix.delete_AbstractSparseMatrix

# Register AbstractSparseMatrix in _matrix:
_matrix.AbstractSparseMatrix_swigregister(AbstractSparseMatrix)



