PyTrilinos::Epetra::CrsSingletonFilter Class Reference

Inheritance diagram for PyTrilinos::Epetra::CrsSingletonFilter:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def Analyze
def SingletonsDetected
def ConstructReducedProblem
def UpdateReducedProblem
def ComputeFullSolution
def NumRowSingletons
def NumColSingletons
def NumSingletons
def RatioOfDimensions
def RatioOfNonzeros
def FullProblem
def ReducedProblem
def FullMatrix
def ReducedMatrix
def RowMapColors
def ColMapColors
def ReducedMatrixRowMap
def ReducedMatrixColMap
def ReducedMatrixDomainMap
def ReducedMatrixRangeMap
def __init__
def Analyze
def SingletonsDetected
def ConstructReducedProblem
def UpdateReducedProblem
def ComputeFullSolution
def NumRowSingletons
def NumColSingletons
def NumSingletons
def RatioOfDimensions
def RatioOfNonzeros
def FullProblem
def ReducedProblem
def FullMatrix
def ReducedMatrix
def RowMapColors
def ColMapColors
def ReducedMatrixRowMap
def ReducedMatrixColMap
def ReducedMatrixDomainMap
def ReducedMatrixRangeMap

Public Attributes

 this


Detailed Description

Epetra_CrsSingletonFilter: A class for explicitly eliminating matrix
rows and columns.

The Epetra_CrsSingletonFilter class takes an existing
Epetra_LinearProblem object, analyzes it structure and explicitly
eliminates singleton rows and columns from the matrix and
appropriately modifies the RHS and LHS of the linear problem. The
result of this process is a reduced system of equations that is itself
an Epetra_LinearProblem object. The reduced system can then be solved
using any solver that is understands an Epetra_LinearProblem. The
solution for the full system is obtained by calling
ComputeFullSolution().

Singleton rows are defined to be rows that have a single nonzero entry
in the matrix. The equation associated with this row can be explicitly
eliminated because it involved only one variable. For example if row i
has a single nonzero value in column j, call it A(i,j), we can
explicitly solve for x(j) = b(i)/A(i,j), where b(i) is the ith entry
of the RHS and x(j) is the jth entry of the LHS.

Singleton columns are defined to be columns that have a single nonzero
entry in the matrix. The variable associated with this column is fully
dependent, meaning that the solution for all other variables does not
depend on it. If this entry is A(i,j) then the ith row and jth column
can be removed from the system and x(j) can be solved after the
solution for all other variables is determined.

By removing singleton rows and columns, we can often produce a reduced
system that is smaller and far less dense, and in general having
better numerical properties.

The basic procedure for using this class is as follows: Construct full
problem: Construct and Epetra_LinearProblem containing the "full"
matrix, RHS and LHS. This is done outside of Epetra_CrsSingletonFilter
class. Presumably, you have some reason to believe that this system
may contain singletons.

Construct an Epetra_CrsSingletonFilter instance: Constructor needs no
arguments.

Analyze matrix: Invoke the Analyze() method, passing in the
Epetra_RowMatrix object from your full linear problem mentioned in the
first step above.

Go/No Go decision to construct reduced problem: Query the results of
the Analyze method using the SingletonsDetected() method. This method
returns "true" if there were singletons found in the matrix. You can
also query any of the other methods in the Filter Statistics section
to determine if you want to proceed with the construction of the
reduced system.

Construct reduced problem: If, in the previous step, you determine
that you want to proceed with the construction of the reduced problem,
you should next call the ConstructReducedProblem() method, passing in
the full linear problem object from the first step. This method will
use the information from the Analyze() method to construct a reduce
problem that has explicitly eliminated the singleton rows, solved for
the corresponding LHS values and updated the RHS. This step will also
remove singleton columns from the reduced system. Once the solution of
the reduced problem is is computed (via any solver that understands an
Epetra_LinearProblem), you should call the ComputeFullSolution()
method to compute the LHS values assocaited with the singleton
columns.

Solve reduced problem: Obtain a pointer to the reduced problem using
the ReducedProblem() method. Using the solver of your choice, solve
the reduced system.

Compute solution to full problem: Once the solution the reduced
problem is determined, the ComputeFullSolution() method will place the
reduced solution values into the appropriate locations of the full
solution LHS and then compute the values associated with column
singletons. At this point, you have a complete solution to the
original full problem.

Solve a subsequent full problem that differs from the original problem
only in values: It is often the case that the structure of a problem
will be the same for a sequence of linear problems. In this case, the
UpdateReducedProblem() method can be useful. After going through the
above process one time, if you have a linear problem that is
structural identical to the previous problem, you can minimize memory
and time costs by using the UpdateReducedProblem() method, passing in
the subsequent problem. Once you have called the
UpdateReducedProblem() method, you can then solve the reduce problem
problem as you wish, and then compute the full solution as before. The
pointer generated by ReducedProblem() will not change when
UpdateReducedProblem() is called.

C++ includes: Epetra_CrsSingletonFilter.h 

Member Function Documentation

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

__init__(self) -> CrsSingletonFilter

Epetra_CrsSingletonFilter::Epetra_CrsSingletonFilter()

Epetra_CrsSingletonFilter default constructor. 

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

__init__(self) -> CrsSingletonFilter

Epetra_CrsSingletonFilter::Epetra_CrsSingletonFilter()

Epetra_CrsSingletonFilter default constructor. 

def PyTrilinos::Epetra::CrsSingletonFilter::Analyze (   self,
  args 
)

Analyze(self, RowMatrix FullMatrix) -> int

int
Epetra_CrsSingletonFilter::Analyze(Epetra_RowMatrix *FullMatrix)

Analyze the input matrix, removing row/column pairs that have
singletons.

Analyzes the user's input matrix to determine rows and columns that
should be explicitly eliminated to create the reduced system. Look for
rows and columns that have single entries. These rows/columns can
easily be removed from the problem. The results of calling this method
are two MapColoring objects accessible via RowMapColors() and
ColMapColors() accessor methods. All rows/columns that would be
eliminated in the reduced system have a color of 1 in the
corresponding RowMapColors/ColMapColors object. All kept rows/cols
have a color of 0. 

def PyTrilinos::Epetra::CrsSingletonFilter::Analyze (   self,
  args 
)

Analyze(self, RowMatrix FullMatrix) -> int

int
Epetra_CrsSingletonFilter::Analyze(Epetra_RowMatrix *FullMatrix)

Analyze the input matrix, removing row/column pairs that have
singletons.

Analyzes the user's input matrix to determine rows and columns that
should be explicitly eliminated to create the reduced system. Look for
rows and columns that have single entries. These rows/columns can
easily be removed from the problem. The results of calling this method
are two MapColoring objects accessible via RowMapColors() and
ColMapColors() accessor methods. All rows/columns that would be
eliminated in the reduced system have a color of 1 in the
corresponding RowMapColors/ColMapColors object. All kept rows/cols
have a color of 0. 

def PyTrilinos::Epetra::CrsSingletonFilter::ColMapColors (   self,
  args 
)

ColMapColors(self) -> MapColoring

Epetra_MapColoring* Epetra_CrsSingletonFilter::ColMapColors() const

Returns pointer to Epetra_MapColoring object: color 0 columns are part
of reduced system. 

def PyTrilinos::Epetra::CrsSingletonFilter::ColMapColors (   self,
  args 
)

ColMapColors(self) -> MapColoring

Epetra_MapColoring* Epetra_CrsSingletonFilter::ColMapColors() const

Returns pointer to Epetra_MapColoring object: color 0 columns are part
of reduced system. 

def PyTrilinos::Epetra::CrsSingletonFilter::ComputeFullSolution (   self,
  args 
)

ComputeFullSolution(self) -> int

int Epetra_CrsSingletonFilter::ComputeFullSolution()

Compute a solution for the full problem using the solution of the
reduced problem, put in LHS of FullProblem().

After solving the reduced linear system, this method can be called to
compute the solution to the original problem, assuming the solution
for the reduced system is valid. The solution of the unreduced,
original problem will be in the LHS of the original
Epetra_LinearProblem. 

def PyTrilinos::Epetra::CrsSingletonFilter::ComputeFullSolution (   self,
  args 
)

ComputeFullSolution(self) -> int

int Epetra_CrsSingletonFilter::ComputeFullSolution()

Compute a solution for the full problem using the solution of the
reduced problem, put in LHS of FullProblem().

After solving the reduced linear system, this method can be called to
compute the solution to the original problem, assuming the solution
for the reduced system is valid. The solution of the unreduced,
original problem will be in the LHS of the original
Epetra_LinearProblem. 

def PyTrilinos::Epetra::CrsSingletonFilter::ConstructReducedProblem (   self,
  args 
)

ConstructReducedProblem(self, LinearProblem Problem) -> int

int
Epetra_CrsSingletonFilter::ConstructReducedProblem(Epetra_LinearProblem
*Problem)

Return a reduced linear problem based on results of Analyze().

Creates a new Epetra_LinearProblem object based on the results of the
Analyze phase. A pointer to the reduced problem is obtained via a call
to ReducedProblem().

Error code, set to 0 if no error. 

def PyTrilinos::Epetra::CrsSingletonFilter::ConstructReducedProblem (   self,
  args 
)

ConstructReducedProblem(self, LinearProblem Problem) -> int

int
Epetra_CrsSingletonFilter::ConstructReducedProblem(Epetra_LinearProblem
*Problem)

Return a reduced linear problem based on results of Analyze().

Creates a new Epetra_LinearProblem object based on the results of the
Analyze phase. A pointer to the reduced problem is obtained via a call
to ReducedProblem().

Error code, set to 0 if no error. 

def PyTrilinos::Epetra::CrsSingletonFilter::FullMatrix (   self,
  args 
)

FullMatrix(self) -> RowMatrix

Epetra_RowMatrix* Epetra_CrsSingletonFilter::FullMatrix() const

Returns pointer to Epetra_CrsMatrix from full problem. 

def PyTrilinos::Epetra::CrsSingletonFilter::FullMatrix (   self,
  args 
)

FullMatrix(self) -> RowMatrix

Epetra_RowMatrix* Epetra_CrsSingletonFilter::FullMatrix() const

Returns pointer to Epetra_CrsMatrix from full problem. 

def PyTrilinos::Epetra::CrsSingletonFilter::FullProblem (   self,
  args 
)

FullProblem(self) -> LinearProblem

Epetra_LinearProblem* Epetra_CrsSingletonFilter::FullProblem() const

Returns pointer to the original unreduced Epetra_LinearProblem. 

def PyTrilinos::Epetra::CrsSingletonFilter::FullProblem (   self,
  args 
)

FullProblem(self) -> LinearProblem

Epetra_LinearProblem* Epetra_CrsSingletonFilter::FullProblem() const

Returns pointer to the original unreduced Epetra_LinearProblem. 

def PyTrilinos::Epetra::CrsSingletonFilter::NumColSingletons (   self,
  args 
)

NumColSingletons(self) -> int

int Epetra_CrsSingletonFilter::NumColSingletons() const

Return number of columns that contain a single entry that are not
associated with singleton row, returns -1 if Analysis not performed
yet. 

def PyTrilinos::Epetra::CrsSingletonFilter::NumColSingletons (   self,
  args 
)

NumColSingletons(self) -> int

int Epetra_CrsSingletonFilter::NumColSingletons() const

Return number of columns that contain a single entry that are not
associated with singleton row, returns -1 if Analysis not performed
yet. 

def PyTrilinos::Epetra::CrsSingletonFilter::NumRowSingletons (   self,
  args 
)

NumRowSingletons(self) -> int

int Epetra_CrsSingletonFilter::NumRowSingletons() const

Return number of rows that contain a single entry, returns -1 if
Analysis not performed yet. 

def PyTrilinos::Epetra::CrsSingletonFilter::NumRowSingletons (   self,
  args 
)

NumRowSingletons(self) -> int

int Epetra_CrsSingletonFilter::NumRowSingletons() const

Return number of rows that contain a single entry, returns -1 if
Analysis not performed yet. 

def PyTrilinos::Epetra::CrsSingletonFilter::NumSingletons (   self,
  args 
)

NumSingletons(self) -> int

int
Epetra_CrsSingletonFilter::NumSingletons() const

Return total number of singletons detected, returns -1 if Analysis not
performed yet.

Return total number of singletons detected across all processors. This
method will not return a valid result until after the Analyze() method
is called. The dimension of the reduced system can be computed by
subtracting this number from dimension of full system. WARNING:  This
method returns -1 if Analyze() method has not been called. 

def PyTrilinos::Epetra::CrsSingletonFilter::NumSingletons (   self,
  args 
)

NumSingletons(self) -> int

int
Epetra_CrsSingletonFilter::NumSingletons() const

Return total number of singletons detected, returns -1 if Analysis not
performed yet.

Return total number of singletons detected across all processors. This
method will not return a valid result until after the Analyze() method
is called. The dimension of the reduced system can be computed by
subtracting this number from dimension of full system. WARNING:  This
method returns -1 if Analyze() method has not been called. 

def PyTrilinos::Epetra::CrsSingletonFilter::RatioOfDimensions (   self,
  args 
)

RatioOfDimensions(self) -> double

double Epetra_CrsSingletonFilter::RatioOfDimensions() const

Returns ratio of reduced system to full system dimensions, returns
-1.0 if reduced problem not constructed. 

def PyTrilinos::Epetra::CrsSingletonFilter::RatioOfDimensions (   self,
  args 
)

RatioOfDimensions(self) -> double

double Epetra_CrsSingletonFilter::RatioOfDimensions() const

Returns ratio of reduced system to full system dimensions, returns
-1.0 if reduced problem not constructed. 

def PyTrilinos::Epetra::CrsSingletonFilter::RatioOfNonzeros (   self,
  args 
)

RatioOfNonzeros(self) -> double

double Epetra_CrsSingletonFilter::RatioOfNonzeros() const

Returns ratio of reduced system to full system nonzero count, returns
-1.0 if reduced problem not constructed. 

def PyTrilinos::Epetra::CrsSingletonFilter::RatioOfNonzeros (   self,
  args 
)

RatioOfNonzeros(self) -> double

double Epetra_CrsSingletonFilter::RatioOfNonzeros() const

Returns ratio of reduced system to full system nonzero count, returns
-1.0 if reduced problem not constructed. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrix (   self,
  args 
)

ReducedMatrix(self) -> CrsMatrix

Epetra_CrsMatrix* Epetra_CrsSingletonFilter::ReducedMatrix() const

Returns pointer to Epetra_CrsMatrix from full problem. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrix (   self,
  args 
)

ReducedMatrix(self) -> CrsMatrix

Epetra_CrsMatrix* Epetra_CrsSingletonFilter::ReducedMatrix() const

Returns pointer to Epetra_CrsMatrix from full problem. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrixColMap (   self,
  args 
)

ReducedMatrixColMap(self) -> Map

Epetra_Map* Epetra_CrsSingletonFilter::ReducedMatrixColMap() const

Returns pointer to Epetra_Map describing the reduced system column
distribution. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrixColMap (   self,
  args 
)

ReducedMatrixColMap(self) -> Map

Epetra_Map* Epetra_CrsSingletonFilter::ReducedMatrixColMap() const

Returns pointer to Epetra_Map describing the reduced system column
distribution. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrixDomainMap (   self,
  args 
)

ReducedMatrixDomainMap(self) -> Map

Epetra_Map*
Epetra_CrsSingletonFilter::ReducedMatrixDomainMap() const

Returns pointer to Epetra_Map describing the domain map for the
reduced system. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrixDomainMap (   self,
  args 
)

ReducedMatrixDomainMap(self) -> Map

Epetra_Map*
Epetra_CrsSingletonFilter::ReducedMatrixDomainMap() const

Returns pointer to Epetra_Map describing the domain map for the
reduced system. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrixRangeMap (   self,
  args 
)

ReducedMatrixRangeMap(self) -> Map

Epetra_Map*
Epetra_CrsSingletonFilter::ReducedMatrixRangeMap() const

Returns pointer to Epetra_Map describing the range map for the reduced
system. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrixRangeMap (   self,
  args 
)

ReducedMatrixRangeMap(self) -> Map

Epetra_Map*
Epetra_CrsSingletonFilter::ReducedMatrixRangeMap() const

Returns pointer to Epetra_Map describing the range map for the reduced
system. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrixRowMap (   self,
  args 
)

ReducedMatrixRowMap(self) -> Map

Epetra_Map* Epetra_CrsSingletonFilter::ReducedMatrixRowMap() const

Returns pointer to Epetra_Map describing the reduced system row
distribution. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedMatrixRowMap (   self,
  args 
)

ReducedMatrixRowMap(self) -> Map

Epetra_Map* Epetra_CrsSingletonFilter::ReducedMatrixRowMap() const

Returns pointer to Epetra_Map describing the reduced system row
distribution. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedProblem (   self,
  args 
)

ReducedProblem(self) -> LinearProblem

Epetra_LinearProblem* Epetra_CrsSingletonFilter::ReducedProblem()
const

Returns pointer to the derived reduced Epetra_LinearProblem. 

def PyTrilinos::Epetra::CrsSingletonFilter::ReducedProblem (   self,
  args 
)

ReducedProblem(self) -> LinearProblem

Epetra_LinearProblem* Epetra_CrsSingletonFilter::ReducedProblem()
const

Returns pointer to the derived reduced Epetra_LinearProblem. 

def PyTrilinos::Epetra::CrsSingletonFilter::RowMapColors (   self,
  args 
)

RowMapColors(self) -> MapColoring

Epetra_MapColoring* Epetra_CrsSingletonFilter::RowMapColors() const

Returns pointer to Epetra_MapColoring object: color 0 rows are part of
reduced system. 

def PyTrilinos::Epetra::CrsSingletonFilter::RowMapColors (   self,
  args 
)

RowMapColors(self) -> MapColoring

Epetra_MapColoring* Epetra_CrsSingletonFilter::RowMapColors() const

Returns pointer to Epetra_MapColoring object: color 0 rows are part of
reduced system. 

def PyTrilinos::Epetra::CrsSingletonFilter::SingletonsDetected (   self,
  args 
)

SingletonsDetected(self) -> bool

bool Epetra_CrsSingletonFilter::SingletonsDetected() const

Returns true if singletons were detected in this matrix (must be
called after Analyze() to be effective). 

def PyTrilinos::Epetra::CrsSingletonFilter::SingletonsDetected (   self,
  args 
)

SingletonsDetected(self) -> bool

bool Epetra_CrsSingletonFilter::SingletonsDetected() const

Returns true if singletons were detected in this matrix (must be
called after Analyze() to be effective). 

def PyTrilinos::Epetra::CrsSingletonFilter::UpdateReducedProblem (   self,
  args 
)

UpdateReducedProblem(self, LinearProblem Problem) -> int

int
Epetra_CrsSingletonFilter::UpdateReducedProblem(Epetra_LinearProblem
*Problem)

Update a reduced linear problem using new values.

Updates an existing Epetra_LinearProblem object using new matrix, LHS
and RHS values. The matrix structure must be identical to the matrix
that was used to construct the original reduced problem.

Error code, set to 0 if no error. 

def PyTrilinos::Epetra::CrsSingletonFilter::UpdateReducedProblem (   self,
  args 
)

UpdateReducedProblem(self, LinearProblem Problem) -> int

int
Epetra_CrsSingletonFilter::UpdateReducedProblem(Epetra_LinearProblem
*Problem)

Update a reduced linear problem using new values.

Updates an existing Epetra_LinearProblem object using new matrix, LHS
and RHS values. The matrix structure must be identical to the matrix
that was used to construct the original reduced problem.

Error code, set to 0 if no error. 


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