/usr/include/trilinos/EpetraExt_MatrixMatrix.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 | // @HEADER
// ***********************************************************************
//
// EpetraExt: Epetra Extended - 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 EPETRAEXT_MATRIXMATRIX_H
#define EPETRAEXT_MATRIXMATRIX_H
#include <EpetraExt_ConfigDefs.h>
class Epetra_CrsMatrix;
namespace EpetraExt {
/** Collection of matrix-matrix operations. This class basically
functions as a namespace, containing only static methods.
See the program epetraext/test/MatrixMatrix/cxx_main.cpp for
a usage example.
*/
class MatrixMatrix {
public:
/** destructor */
virtual ~MatrixMatrix(){}
/** Given Epetra_CrsMatrix objects A, B and C, form the product C = A*B.
In a parallel setting, A and B need not have matching distributions,
but C needs to have the same row-map as A.
@param A Input, must already have had 'FillComplete()' called.
@param transposeA Input, whether to use transpose of matrix A.
@param B Input, must already have had 'FillComplete()' called.
@param transposeB Input, whether to use transpose of matrix B.
@param C Result. On entry to this method, it doesn't matter whether
FillComplete() has already been called on C or not. If it has,
then C's graph must already contain all nonzero locations that
will be produced when forming the product A*B. On exit,
C.FillComplete() will have been called, unless the last argument
to this function is specified to be false.
@param call_FillComplete_on_result Optional argument, defaults to true.
Power users may specify this argument to be false if they *DON'T*
want this function to call C.FillComplete. (It is often useful
to allow this function to call C.FillComplete, in cases where
one or both of the input matrices are rectangular and it is not
trivial to know which maps to use for the domain- and range-maps.)
@return error-code, 0 if successful. non-zero returns may result if A or
B are not already Filled, or if errors occur in putting values
into C, etc.
*/
static int Multiply(const Epetra_CrsMatrix& A,
bool transposeA,
const Epetra_CrsMatrix& B,
bool transposeB,
Epetra_CrsMatrix& C,
bool call_FillComplete_on_result=true);
/** Given Epetra_CrsMatrix objects A and B, form the sum B = a*A + b*B
@param A Input, must already have had 'FillComplete()' called.
@param transposeA Input, whether to use transpose of matrix A.
@param scalarA Input, scalar multiplier for matrix A.
@param B Result. On entry to this method, it doesn't matter whether
FillComplete() has already been called on B or not. If it has,
then B's graph must already contain all nonzero locations that
will be produced when forming the sum.
@param scalarB Input, scalar multiplier for matrix B.
@return error-code, 0 if successful. non-zero returns may result if A is
not already Filled, or if errors occur in putting values
into B, etc.
*/
static int Add(const Epetra_CrsMatrix& A,
bool transposeA,
double scalarA,
Epetra_CrsMatrix& B,
double scalarB);
/** Given Epetra_CrsMatrix objects A and B, form the sum C = a*A + b*B
@param A Input, must already have had 'FillComplete()' called.
@param transposeA Input, whether to use transpose of matrix A.
@param scalarA Input, scalar multiplier for matrix A.
@param B Input, must already have had 'FillComplete()' called.
@param transposeB Input, whether to use transpose of matrix B.
@param scalarB Input, scalar multiplier for matrix B.
@param C Result. On entry to this method, C can be NULL or a pointer
to an unfilled or filled matrix. If C is NULL then a new
object is allocated and must be deleted by the user.
If C is not NULL and FillComplete has already
been called then the sparsity pattern is assumed to be fixed
and compatible with the sparsity of A+B. If FillComplete has
not been called then the sum is completed and the function
returns without calling FillComplete on C.
@return error-code, 0 if successful. non-zero returns may result if A or is
not already Filled, or if errors occur in putting values
into C, etc.
*/
static int Add(const Epetra_CrsMatrix& A,
bool transposeA,
double scalarA,
const Epetra_CrsMatrix & B,
bool transposeB,
double scalarB,
Epetra_CrsMatrix * & C);
};//class MatrixMatrix
/**
*Method for internal use... sparsedot forms a dot-product between two
*sparsely-populated 'vectors'.
*Important assumption: assumes the indices in u_ind and v_ind are sorted.
*/
double sparsedot(double* u, int* u_ind, int u_len,
double* v, int* v_ind, int v_len);
}//namespace EpetraExt
#endif
|