PyTrilinos::Epetra::Operator Class Reference

Inheritance diagram for PyTrilinos::Epetra::Operator:

Inheritance graph
[legend]
Collaboration diagram for PyTrilinos::Epetra::Operator:

Collaboration graph
[legend]

List of all members.

Public Member Functions

def SetUseTranspose
def Apply
def ApplyInverse
def NormInf
def Label
def UseTranspose
def HasNormInf
def Comm
def OperatorDomainMap
def OperatorRangeMap
def __init__
def __disown__
def SetUseTranspose
def Apply
def ApplyInverse
def NormInf
def Label
def UseTranspose
def HasNormInf
def Comm
def OperatorDomainMap
def OperatorRangeMap
def __init__
def __disown__

Public Attributes

 this


Detailed Description

For cross-language polymorphism to work in python, you must call this
constructor::

    from PyTrilinos import Epetra
    class MyOperator(Epetra.Operator):
        def __init__(self):
            Epetra.Operator.__init__(self)

Other than that, the Epetra.Operator class is much more forgiving than
its C++ counterpart.  Often, you can override just the Label() and
Apply() methods.


Member Function Documentation

def PyTrilinos::Epetra::Operator::__init__ (   self,
  args 
)

def PyTrilinos::Epetra::Operator::__init__ (   self,
  args 
)

def PyTrilinos::Epetra::Operator::Apply (   self,
  args 
)

Apply(self, MultiVector x, MultiVector y) -> int

In C++, the Apply() method is pure virtual, thus intended to be
overridden by derived classes.  In python, cross-language polymorphism
is supported, and you are expected to derive classes from this base
class and redefine the Apply() method.  C++ code (e.g., AztecOO
solvers) can call back to your Apply() method as needed.  You must
support two arguments, labeled here MultiVector x and MultiVector y.
These will be converted from Epetra_MultiVector C++ objects to
numpy-hybrid Epetra.MultiVector objects before they are passed to you.
Thus, it is legal to use slice indexing and other numpy features to
compute y from x.

If application of your operator is successful, return 0; else return
some non-zero error code.

It is strongly suggested that you prevent Apply() from raising any
exceptions.  Accidental errors can be prevented by wrapping your code
in a try block:

    try:
# Your code goes here...
    except Exception, e:
print 'A python exception was raised by method Apply:'
print e
return -1

By returning a -1, you inform the calling routine that Apply() was
unsuccessful.


virtual int
Epetra_Operator::Apply(const Epetra_MultiVector &X, Epetra_MultiVector
&Y) const =0

Returns the result of a Epetra_Operator applied to a
Epetra_MultiVector X in Y.

Parameters:
-----------

In:  X - A Epetra_MultiVector of dimension NumVectors to multiply with
matrix.

Out:  Y -A Epetra_MultiVector of dimension NumVectors containing
result.

Integer error code, set to 0 if successful. 

Reimplemented in PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, PyTrilinos::ML::EpetraBaseOperator, PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, and PyTrilinos::ML::EpetraBaseOperator.

def PyTrilinos::Epetra::Operator::Apply (   self,
  args 
)

Apply(self, MultiVector x, MultiVector y) -> int

In C++, the Apply() method is pure virtual, thus intended to be
overridden by derived classes.  In python, cross-language polymorphism
is supported, and you are expected to derive classes from this base
class and redefine the Apply() method.  C++ code (e.g., AztecOO
solvers) can call back to your Apply() method as needed.  You must
support two arguments, labeled here MultiVector x and MultiVector y.
These will be converted from Epetra_MultiVector C++ objects to
numpy-hybrid Epetra.MultiVector objects before they are passed to you.
Thus, it is legal to use slice indexing and other numpy features to
compute y from x.

If application of your operator is successful, return 0; else return
some non-zero error code.

It is strongly suggested that you prevent Apply() from raising any
exceptions.  Accidental errors can be prevented by wrapping your code
in a try block:

    try:
# Your code goes here...
    except Exception, e:
print 'A python exception was raised by method Apply:'
print e
return -1

By returning a -1, you inform the calling routine that Apply() was
unsuccessful.


virtual int
Epetra_Operator::Apply(const Epetra_MultiVector &X, Epetra_MultiVector
&Y) const =0

Returns the result of a Epetra_Operator applied to a
Epetra_MultiVector X in Y.

Parameters:
-----------

In:  X - A Epetra_MultiVector of dimension NumVectors to multiply with
matrix.

Out:  Y -A Epetra_MultiVector of dimension NumVectors containing
result.

Integer error code, set to 0 if successful. 

Reimplemented in PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, PyTrilinos::ML::EpetraBaseOperator, PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, and PyTrilinos::ML::EpetraBaseOperator.

def PyTrilinos::Epetra::Operator::ApplyInverse (   self,
  args 
)

ApplyInverse(self, MultiVector x, MultiVector y) -> int

In C++, the ApplyInverse() method is pure virtual, thus intended to be
overridden by derived classes.  In python, cross-language polymorphism
is supported, and you are expected to derive classes from this base
class and redefine the ApplyInverse() method.  C++ code (e.g., AztecOO
solvers) can call back to your ApplyInverse() method as needed.  You
must support two arguments, labeled here MultiVector x and MultiVector
y.  These will be converted from Epetra_MultiVector C++ objects to
numpy-hybrid Epetra.MultiVector objects before they are passed to you.
Thus, it is legal to use slice indexing and other numpy features to
compute y from x.

If application of your operator is successful, return 0; else return
some non-zero error code.

It is strongly suggested that you prevent ApplyInverse() from raising
any exceptions.  Accidental errors can be prevented by wrapping your
code in a try block:

    try:
# Your code goes here...
    except Exception, e:
print 'A python exception was raised by method ApplyInverse:'
print e
return -1

By returning a -1, you inform the calling routine that ApplyInverse()
was unsuccessful.


virtual int
Epetra_Operator::ApplyInverse(const Epetra_MultiVector &X,
Epetra_MultiVector &Y) const =0

Returns the result of a Epetra_Operator inverse applied to an
Epetra_MultiVector X in Y.

Parameters:
-----------

In:  X - A Epetra_MultiVector of dimension NumVectors to solve for.

Out:  Y -A Epetra_MultiVector of dimension NumVectors containing
result.

Integer error code, set to 0 if successful.

WARNING:  In order to work with AztecOO, any implementation of this
method must support the case where X and Y are the same object. 

Reimplemented in PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::Preconditioner, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, PyTrilinos::ML::EpetraBaseOperator, PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::Preconditioner, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, and PyTrilinos::ML::EpetraBaseOperator.

def PyTrilinos::Epetra::Operator::ApplyInverse (   self,
  args 
)

ApplyInverse(self, MultiVector x, MultiVector y) -> int

In C++, the ApplyInverse() method is pure virtual, thus intended to be
overridden by derived classes.  In python, cross-language polymorphism
is supported, and you are expected to derive classes from this base
class and redefine the ApplyInverse() method.  C++ code (e.g., AztecOO
solvers) can call back to your ApplyInverse() method as needed.  You
must support two arguments, labeled here MultiVector x and MultiVector
y.  These will be converted from Epetra_MultiVector C++ objects to
numpy-hybrid Epetra.MultiVector objects before they are passed to you.
Thus, it is legal to use slice indexing and other numpy features to
compute y from x.

If application of your operator is successful, return 0; else return
some non-zero error code.

It is strongly suggested that you prevent ApplyInverse() from raising
any exceptions.  Accidental errors can be prevented by wrapping your
code in a try block:

    try:
# Your code goes here...
    except Exception, e:
print 'A python exception was raised by method ApplyInverse:'
print e
return -1

By returning a -1, you inform the calling routine that ApplyInverse()
was unsuccessful.


virtual int
Epetra_Operator::ApplyInverse(const Epetra_MultiVector &X,
Epetra_MultiVector &Y) const =0

Returns the result of a Epetra_Operator inverse applied to an
Epetra_MultiVector X in Y.

Parameters:
-----------

In:  X - A Epetra_MultiVector of dimension NumVectors to solve for.

Out:  Y -A Epetra_MultiVector of dimension NumVectors containing
result.

Integer error code, set to 0 if successful.

WARNING:  In order to work with AztecOO, any implementation of this
method must support the case where X and Y are the same object. 

Reimplemented in PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::Preconditioner, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, PyTrilinos::ML::EpetraBaseOperator, PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::Preconditioner, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, and PyTrilinos::ML::EpetraBaseOperator.

def PyTrilinos::Epetra::Operator::Comm (   self,
  args 
)

def PyTrilinos::Epetra::Operator::Comm (   self,
  args 
)

def PyTrilinos::Epetra::Operator::HasNormInf (   self,
  args 
)

def PyTrilinos::Epetra::Operator::HasNormInf (   self,
  args 
)

def PyTrilinos::Epetra::Operator::Label (   self,
  args 
)

def PyTrilinos::Epetra::Operator::Label (   self,
  args 
)

def PyTrilinos::Epetra::Operator::NormInf (   self,
  args 
)

def PyTrilinos::Epetra::Operator::NormInf (   self,
  args 
)

def PyTrilinos::Epetra::Operator::OperatorDomainMap (   self,
  args 
)

def PyTrilinos::Epetra::Operator::OperatorDomainMap (   self,
  args 
)

def PyTrilinos::Epetra::Operator::OperatorRangeMap (   self,
  args 
)

def PyTrilinos::Epetra::Operator::OperatorRangeMap (   self,
  args 
)

def PyTrilinos::Epetra::Operator::SetUseTranspose (   self,
  args 
)

SetUseTranspose(self, bool UseTranspose) -> int

virtual int
Epetra_Operator::SetUseTranspose(bool UseTranspose)=0

If set true, transpose of this operator will be applied.

This flag allows the transpose of the given operator to be used
implicitly. Setting this flag affects only the Apply() and
ApplyInverse() methods. If the implementation of this interface does
not support transpose use, this method should return a value of -1.

Parameters:
-----------

In:  UseTranspose -If true, multiply by the transpose of operator,
otherwise just use operator.

Integer error code, set to 0 if successful. Set to -1 if this
implementation does not support transpose. 

Reimplemented in PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, PyTrilinos::ML::EpetraBaseOperator, PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, and PyTrilinos::ML::EpetraBaseOperator.

def PyTrilinos::Epetra::Operator::SetUseTranspose (   self,
  args 
)

SetUseTranspose(self, bool UseTranspose) -> int

virtual int
Epetra_Operator::SetUseTranspose(bool UseTranspose)=0

If set true, transpose of this operator will be applied.

This flag allows the transpose of the given operator to be used
implicitly. Setting this flag affects only the Apply() and
ApplyInverse() methods. If the implementation of this interface does
not support transpose use, this method should return a value of -1.

Parameters:
-----------

In:  UseTranspose -If true, multiply by the transpose of operator,
otherwise just use operator.

Integer error code, set to 0 if successful. Set to -1 if this
implementation does not support transpose. 

Reimplemented in PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, PyTrilinos::ML::EpetraBaseOperator, PyTrilinos::Anasazi::EpetraGenOp, PyTrilinos::Anasazi::EpetraSymOp, PyTrilinos::Epetra::InvOperator, PyTrilinos::Epetra::BasicRowMatrix, PyTrilinos::Epetra::CrsMatrix, PyTrilinos::Epetra::VbrMatrix, PyTrilinos::IFPACK::IC, PyTrilinos::IFPACK::ICT, PyTrilinos::IFPACK::ILU, PyTrilinos::IFPACK::ILUT, PyTrilinos::IFPACK::PointRelaxation, PyTrilinos::IFPACK::Amesos, PyTrilinos::ML::MultiLevelPreconditioner, and PyTrilinos::ML::EpetraBaseOperator.

def PyTrilinos::Epetra::Operator::UseTranspose (   self,
  args 
)

def PyTrilinos::Epetra::Operator::UseTranspose (   self,
  args 
)


The documentation for this class was generated from the following files:

Generated on Thu Dec 17 11:00:21 2009 for PyTrilinos by  doxygen 1.5.9