/usr/include/trilinos/Epetra_RowMatrixTransposer.h is in libtrilinos-dev 10.4.0.dfsg-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | //@HEADER
/*
************************************************************************
Epetra: Linear Algebra Services Package
Copyright (2001) Sandia Corporation
Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
license for use of this work by or on behalf of the U.S. Government.
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
Questions? Contact Michael A. Heroux (maherou@sandia.gov)
************************************************************************
*/
//@HEADER
#ifndef EPETRA_CRSMATRIXTRANSPOSER_H
#define EPETRA_CRSMATRIXTRANSPOSER_H
#include <Epetra_Object.h>
class Epetra_RowMatrix;
class Epetra_CrsMatrix;
class Epetra_Map;
class Epetra_Export;
//! Epetra_RowMatrixTransposer: A class for transposing an Epetra_RowMatrix object.
/*! This class provides capabilities to construct a transpose matrix of an existing Epetra_RowMatrix
object and (optionally) redistribute it across a parallel distributed memory machine.
*/
class EPETRA_LIB_DLL_EXPORT Epetra_RowMatrixTransposer {
public:
//! @name Constructors/destructors
//@{
//! Primary Epetra_RowMatrixTransposer constructor.
/*!
\param Matrix (In) An existing Epetra_RowMatrix object. The Epetra_RowMatrix, the LHS and RHS pointers
do not need to be defined before this constructor is called.
\return Pointer to a Epetra_RowMatrixTransposer object.
*/
Epetra_RowMatrixTransposer(Epetra_RowMatrix * OrigMatrix);
//! Epetra_RowMatrixTransposer copy constructor.
Epetra_RowMatrixTransposer(const Epetra_RowMatrixTransposer& Source);
//! Epetra_RowMatrixTransposer destructor.
virtual ~Epetra_RowMatrixTransposer();
//@}
//! @name Forward transformation methods
//@{
//! Generate a new Epetra_CrsMatrix as the transpose of an Epetra_RowMatrix passed into the constructor.
/*! Constructs a new Epetra_CrsMatrix that is a copy of the Epetra_RowMatrix passed in to the constructor.
\param MakeDataContiguous (In) Causes the output matrix, LHS and RHS to be stored in a form compatible with
Fortran-style solvers. The output matrix will be compatible with the Harwell-Boeing compressed
column format. The RHS and LHS will be stored such that the last value in column j of the
multivector is stored next to the first value in column j+1.
\param TransposeRowMap (Optional/In) If this argument is defined, the transpose matrix will be distributed
using this map as the row map for the transpose. If it is set to zero, the transpose matrix will use
the OrigMatrix->RowMatrixDomainMap as the row map.
\return Integer error code, 0 if no errors. Negative if some fatal error occured.
*/
int CreateTranspose(const bool MakeDataContiguous,
Epetra_CrsMatrix *& TransposeMatrix,
Epetra_Map * TransposeRowMap = 0);
//! Update the values of an already-redistributed problem.
/*! Updates the values of an already-redistributed problem. This method allows updating
the redistributed problem without
allocating new storage.
\param MatrixWithNewValues (In) The values from MatrixWithNewValues will be copied into the TransposeMatrix. The
MatrixWithNewValues object must be identical in structure to the original matrix object used to create
this instance of Epetra_RowMatrixTransposer.
\return Integer error code, 0 if no errors. Negative if some fatal error occured.
*/
int UpdateTransposeValues(Epetra_RowMatrix * MatrixWithNewValues);
//@}
//! @name Reverse transformation methods
//@{
//! Update values of original matrix (Not implemented and not sure if we will implement this).
int UpdateOriginalMatrixValues();
//@}
//! @name Attribute accessor methods
//@{
//! Returns const reference to the Epetra_Map object describing the row distribution of the transpose matrix.
/*! The RedistExporter object can be used to redistribute other Epetra_DistObject objects whose maps are compatible with
the original linear problem map, or with the RedistMap().
\warning Must not be called before CreateTranspose()is called.
*/
const Epetra_Map & TransposeRowMap() const {return(*TransposeRowMap_);};
//! Returns const reference to the Epetra_Export object used to redistribute the original matrix.
/*! The TransposeExporter object can be used to redistribute other Epetra_DistObject objects whose maps are compatible with
the original matrix.
\warning Must not be called before CreateTranspose() is called.
*/
const Epetra_Export & TransposeExporter() const{return(*TransposeExporter_);};
//@}
private:
void DeleteData();
Epetra_RowMatrixTransposer& operator=(const Epetra_RowMatrixTransposer& src);
Epetra_RowMatrix * OrigMatrix_;
Epetra_CrsMatrix * TransposeMatrix_;
Epetra_Export * TransposeExporter_;
Epetra_Map * TransposeRowMap_;
bool TransposeCreated_;
bool MakeDataContiguous_;
int NumMyRows_;
int NumMyCols_;
int MaxNumEntries_;
int * Indices_;
double * Values_;
int * TransNumNz_;
int ** TransIndices_;
double ** TransValues_;
int * TransMyGlobalEquations_;
bool OrigMatrixIsCrsMatrix_;
};
#endif /* EPETRA_CRSMATRIXTRANSPOSER_H */
|