00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef LOCA_BORDEREDSOLVER_HOUSEHOLDERQR_H
00043 #define LOCA_BORDEREDSOLVER_HOUSEHOLDERQR_H
00044
00045 #include "Teuchos_RCP.hpp"
00046 #include "Teuchos_BLAS.hpp"
00047
00048 #include "NOX_Abstract_MultiVector.H"
00049
00050
00051 namespace LOCA {
00052 class GlobalData;
00053 }
00054
00055 namespace LOCA {
00056
00057 namespace BorderedSolver {
00058
00092 class HouseholderQR {
00093
00094 public:
00095
00097
00100 HouseholderQR(const Teuchos::RCP<LOCA::GlobalData>& global_data);
00101
00103 virtual ~HouseholderQR();
00104
00106
00110 void computeQR(const NOX::Abstract::MultiVector::DenseMatrix& C,
00111 const NOX::Abstract::MultiVector& B,
00112 bool use_c_transpose,
00113 NOX::Abstract::MultiVector::DenseMatrix& Y1,
00114 NOX::Abstract::MultiVector& Y2,
00115 NOX::Abstract::MultiVector::DenseMatrix& T,
00116 NOX::Abstract::MultiVector::DenseMatrix& R);
00117
00124 void applyCompactWY(const NOX::Abstract::MultiVector::DenseMatrix& Y1,
00125 const NOX::Abstract::MultiVector& Y2,
00126 const NOX::Abstract::MultiVector::DenseMatrix& T,
00127 NOX::Abstract::MultiVector::DenseMatrix& X1,
00128 NOX::Abstract::MultiVector& X2,
00129 bool isZeroX1, bool isZeroX2,
00130 bool useTranspose) const;
00131
00137 void applyCompactWY(
00138 const NOX::Abstract::MultiVector::DenseMatrix& Y1,
00139 const NOX::Abstract::MultiVector& Y2,
00140 const NOX::Abstract::MultiVector::DenseMatrix& T,
00141 const NOX::Abstract::MultiVector::DenseMatrix* input1,
00142 const NOX::Abstract::MultiVector* input2,
00143 NOX::Abstract::MultiVector::DenseMatrix& result1,
00144 NOX::Abstract::MultiVector& result2,
00145 bool useTranspose) const;
00146
00147 protected:
00148
00157 void computeHouseholderVector(
00158 int col,
00159 const NOX::Abstract::MultiVector::DenseMatrix& A1,
00160 const NOX::Abstract::MultiVector& A2,
00161 NOX::Abstract::MultiVector::DenseMatrix& V1,
00162 NOX::Abstract::MultiVector& V2,
00163 double& beta);
00164
00169 void applyHouseholderVector(
00170 const NOX::Abstract::MultiVector::DenseMatrix& V1,
00171 const NOX::Abstract::MultiVector& V2,
00172 double beta,
00173 NOX::Abstract::MultiVector::DenseMatrix& A1,
00174 NOX::Abstract::MultiVector& A2);
00175
00176 private:
00177
00179 HouseholderQR(const HouseholderQR&);
00180
00182 HouseholderQR& operator = (const HouseholderQR&);
00183
00184 protected:
00185
00187 Teuchos::RCP<LOCA::GlobalData> globalData;
00188
00190 Teuchos::BLAS<int,double> dblas;
00191
00192 };
00193 }
00194 }
00195
00196 #endif