AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AbstractLinAlgPack_MatrixPermAggr.cpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
5 // Copyright (2003) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #include "AbstractLinAlgPack_MatrixPermAggr.hpp"
43 #include "AbstractLinAlgPack_LinAlgOpPack.hpp"
44 #include "AbstractLinAlgPack_MatrixOpOut.hpp"
45 #include "AbstractLinAlgPack_VectorStdOps.hpp"
46 #include "AbstractLinAlgPack_VectorSpace.hpp"
47 #include "AbstractLinAlgPack_Permutation.hpp"
48 #include "AbstractLinAlgPack_PermutationOut.hpp"
49 #include "Teuchos_Assert.hpp"
50 #include "Teuchos_dyn_cast.hpp"
51 
52 namespace AbstractLinAlgPack {
53 
54 // Constructors / initializers
55 
57 {} // Nothing to explicitly initialize
58 
60  const mat_ptr_t &mat_orig
61  ,const perm_ptr_t &row_perm
62  ,const perm_ptr_t &col_perm
63  ,const mat_ptr_t &mat_perm
64  )
65 {
66  this->initialize(mat_orig,row_perm,col_perm,mat_perm);
67 }
68 
70  const mat_ptr_t &mat_orig
71  ,const perm_ptr_t &row_perm
72  ,const perm_ptr_t &col_perm
73  ,const mat_ptr_t &mat_perm
74  )
75 {
76 #ifdef TEUCHOS_DEBUG
78  mat_orig.get() == NULL, std::invalid_argument
79  ,"MatrixPermAggr::initialize(...): Error!" );
80 #endif
81 #ifdef ABSTRACTLINALGPACK_ASSERT_COMPATIBILITY
82  bool is_compatible = false;
83  if(row_perm.get()) {
84  is_compatible = mat_orig->space_cols().is_compatible(row_perm->space());
87  ,"MatrixPermAggr::initialize(...): Error, "
88  "mat_orig->space_cols().is_compatible(row_perm->space()) == false" );
89  }
90  if(col_perm.get()) {
91  is_compatible = mat_orig->space_rows().is_compatible(col_perm->space());
94  ,"MatrixPermAggr::initialize(...): Error, "
95  "mat_orig->space_rows().is_compatible(col_perm->space()) == false" );
96  }
97 #endif
98  mat_orig_ = mat_orig;
99  row_perm_ = row_perm;
100  col_perm_ = col_perm;
101  mat_perm_ = mat_perm;
102 }
103 
105 {
106  namespace rcp = MemMngPack;
107  mat_orig_ = Teuchos::null;
108  row_perm_ = Teuchos::null;
109  col_perm_ = Teuchos::null;
110  mat_perm_ = Teuchos::null;
111 }
112 
113 // Overridden from MatrixBase
114 
115 size_type MatrixPermAggr::rows() const
116 {
117  return mat_orig_.get() ? mat_orig_->rows() : 0;
118 }
119 
120 size_type MatrixPermAggr::cols() const
121 {
122  return mat_orig_.get() ? mat_orig_->cols() : 0;
123 }
124 
125 size_type MatrixPermAggr::nz() const
126 {
127  return mat_orig_.get() ? mat_orig_->nz() : 0;
128 }
129 
130 // Overridden from MatrixOp
131 
133 {
134  return mat_orig_->space_cols();
135 }
136 
138 {
139  return mat_orig_->space_rows();
140 }
141 
142 MatrixOp::mat_ptr_t
143 MatrixPermAggr::sub_view(const Range1D& row_rng, const Range1D& col_rng) const
144 {
145  if(mat_perm_.get())
146  return mat_perm_->sub_view(row_rng,col_rng);
147  if(!row_perm_.get() && !col_perm_.get())
148  return mat_orig_->sub_view(row_rng,col_rng);
149  return MatrixOp::sub_view(row_rng,col_rng); // ToDo: Speicalized!
150 }
151 
153 {
154  using Teuchos::dyn_cast;
155  const MatrixPermAggr
156  Mp = dyn_cast<const MatrixPermAggr>(M);
157  if( this == &Mp )
158  return *this; // Assignment to self
159  // Shallow copy is okay as long as client is careful!
160  mat_orig_ = Mp.mat_orig_;
161  row_perm_ = Mp.row_perm_;
162  col_perm_ = Mp.col_perm_;
163  mat_perm_ = Mp.mat_perm_;
164  return *this;
165 }
166 
167 std::ostream& MatrixPermAggr::output(std::ostream& out) const
168 {
169  out << "Matrix with permuted view:\n";
170  out << "mat_orig =\n" << *mat_orig_;
171  out << "row_perm =";
172  if( row_perm_.get() )
173  out << "\n" << *row_perm_;
174  else
175  out << " NULL\n";
176  out << "col_perm =";
177  if( col_perm_.get() )
178  out << "\n" << *col_perm_;
179  else
180  out << " NULL\n";
181  out << "mat_perm =";
182  if( mat_perm_.get() )
183  out << "\n" << *mat_perm_;
184  else
185  out << " NULL\n";
186  return out;
187 }
188 
190  MatrixOp* mwo_lhs, value_type alpha
191  ,BLAS_Cpp::Transp trans_rhs
192  ) const
193 {
194  if(!row_perm_.get() && !col_perm_.get()) {
195  AbstractLinAlgPack::Mp_StM(mwo_lhs,alpha,*mat_orig_,trans_rhs);
196  return true;
197  }
198  AbstractLinAlgPack::Mp_StM(mwo_lhs,alpha,*mat_orig_,trans_rhs); // ToDo: Specialize!
199  return true;
200 }
201 
203  MatrixOp* mwo_lhs, value_type alpha
204  ,BLAS_Cpp::Transp M_trans
205  ,const GenPermMatrixSlice& P_rhs, BLAS_Cpp::Transp P_rhs_trans
206  ) const
207 {
208  if(!row_perm_.get() && !col_perm_.get()) {
209  AbstractLinAlgPack::Mp_StMtP(mwo_lhs,alpha,*mat_orig_,M_trans,P_rhs,P_rhs_trans);
210  return true;
211  }
212  AbstractLinAlgPack::Mp_StMtP(mwo_lhs,alpha,*mat_orig_,M_trans,P_rhs,P_rhs_trans); // ToDo: Specialize!
213  return true;
214 }
215 
217  MatrixOp* mwo_lhs, value_type alpha
218  , const GenPermMatrixSlice& P_rhs, BLAS_Cpp::Transp P_rhs_trans
219  , BLAS_Cpp::Transp M_trans
220  ) const
221 {
222  if(!row_perm_.get() && !col_perm_.get()) {
223  AbstractLinAlgPack::Mp_StPtM(mwo_lhs,alpha,P_rhs,P_rhs_trans,*mat_orig_,M_trans);
224  return true;
225  }
226  AbstractLinAlgPack::Mp_StPtM(mwo_lhs,alpha,P_rhs,P_rhs_trans,*mat_orig_,M_trans); // ToDo: Specialize!
227  return true;
228 }
229 
231  MatrixOp* mwo_lhs, value_type alpha
232  ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
233  ,BLAS_Cpp::Transp M_trans
234  ,const GenPermMatrixSlice& P_rhs2, BLAS_Cpp::Transp P_rhs2_trans
235  ) const
236 {
237  if(!row_perm_.get() && !col_perm_.get()) {
238  AbstractLinAlgPack::Mp_StPtMtP(mwo_lhs,alpha,P_rhs1,P_rhs1_trans,*mat_orig_,M_trans,P_rhs2,P_rhs2_trans);
239  return true;
240  }
241  AbstractLinAlgPack::Mp_StPtMtP(mwo_lhs,alpha,P_rhs1,P_rhs1_trans,*mat_orig_,M_trans,P_rhs2,P_rhs2_trans); // ToDo: Specialize!
242  return true;
243 }
244 
246  VectorMutable* y, value_type a, BLAS_Cpp::Transp M_trans
247  ,const Vector& x, value_type b
248  ) const
249 {
250  using BLAS_Cpp::no_trans;
251  using BLAS_Cpp::trans;
252  using LinAlgOpPack::V_MtV;
253 
254  if(mat_perm_.get()) {
255  AbstractLinAlgPack::Vp_StMtV(y,a,*mat_perm_,M_trans,x,b);
256  return;
257  }
258  if(!row_perm_.get() && !col_perm_.get()) {
259  AbstractLinAlgPack::Vp_StMtV(y,a,*mat_orig_,M_trans,x,b);
260  return;
261  }
262 
263  //
264  // y = a*op(Pr*M*Pc')*x + b*y
265  //
266  // =>
267  //
268  // y = a*P1*op(M)*P2'*x + b*y
269  //
270  // =>
271  //
272  // ta = P2'*x
273  // tb = op(M)*ta
274  // tc = P1*tb
275  // y = a*tc + b*y
276  //
277  const Permutation
278  *P1 = ( M_trans == no_trans ? row_perm_.get() : col_perm_.get() ),
279  *P2 = ( M_trans == no_trans ? col_perm_.get() : row_perm_.get() );
280  VectorSpace::vec_mut_ptr_t ta, tb, tc;
281  // ta = P2'*x
282  if( P2 && !P2->is_identity() )
283  P2->permute( trans, x, (ta = P2->space().create_member()).get() );
284  else
285  *(tb = ( M_trans == no_trans ? mat_orig_->space_rows() : mat_orig_->space_cols() ).create_member() ) = x;
286  // tb = op(M)*ta
287  V_MtV(
288  (tb = ( M_trans == no_trans ? mat_orig_->space_cols() : mat_orig_->space_rows() ).create_member() ).get()
289  ,*mat_orig_, M_trans, *ta
290  );
291  // tc = P1*tb
292  if( P1 && !P1->is_identity() )
293  P1->permute( no_trans, *tb, (tc = P1->space().create_member()).get() );
294  else
295  tc = tb->clone();
296  // y = b*y + a*tc
297  AbstractLinAlgPack::Vt_S( y, b );
298  AbstractLinAlgPack::Vp_StV( y, a, *tc );
299 }
300 
302  VectorMutable* y, value_type a, BLAS_Cpp::Transp M_trans
303  , const SpVectorSlice& x, value_type b) const
304 {
305  if(mat_perm_.get()) {
306  AbstractLinAlgPack::Vp_StMtV(y,a,*mat_perm_,M_trans,x,b);
307  return;
308  }
309  if(!row_perm_.get() && !col_perm_.get()) {
310  AbstractLinAlgPack::Vp_StMtV(y,a,*mat_orig_,M_trans,x,b);
311  return;
312  }
313  MatrixOp::Vp_StMtV(y,a,M_trans,x,b);
314 }
315 
317  VectorMutable* vs_lhs, value_type alpha
318  ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
319  ,BLAS_Cpp::Transp M_rhs2_trans
320  ,const Vector& v_rhs3, value_type beta
321  ) const
322 {
323  if(!row_perm_.get() && !col_perm_.get()) {
324  AbstractLinAlgPack::Vp_StPtMtV(vs_lhs,alpha,P_rhs1,P_rhs1_trans,*mat_orig_,M_rhs2_trans,v_rhs3,beta);
325  return;
326  }
327  MatrixOp::Vp_StPtMtV(vs_lhs,alpha,P_rhs1,P_rhs1_trans,M_rhs2_trans,v_rhs3,beta);
328 }
329 
331  VectorMutable* vs_lhs, value_type alpha
332  ,const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
333  ,BLAS_Cpp::Transp M_rhs2_trans
334  ,const SpVectorSlice& sv_rhs3, value_type beta
335  ) const
336 {
337  if(!row_perm_.get() && !col_perm_.get()) {
338  AbstractLinAlgPack::Vp_StPtMtV(vs_lhs,alpha,P_rhs1,P_rhs1_trans,*mat_orig_,M_rhs2_trans,sv_rhs3,beta);
339  return;
340  }
341  MatrixOp::Vp_StPtMtV(vs_lhs,alpha,P_rhs1,P_rhs1_trans,M_rhs2_trans,sv_rhs3,beta);
342 }
343 
345  const Vector& v_rhs1, BLAS_Cpp::Transp trans_rhs2
346  ,const Vector& v_rhs3
347  ) const
348 {
349  if(!row_perm_.get() && !col_perm_.get())
350  return AbstractLinAlgPack::transVtMtV(v_rhs1,*mat_orig_,trans_rhs2,v_rhs3);
351  return MatrixOp::transVtMtV(v_rhs1,trans_rhs2,v_rhs3);
352 }
353 
355  const SpVectorSlice& sv_rhs1, BLAS_Cpp::Transp trans_rhs2
356  ,const SpVectorSlice& sv_rhs3
357  ) const
358 {
359  if(!row_perm_.get() && !col_perm_.get())
360  return AbstractLinAlgPack::transVtMtV(sv_rhs1,*mat_orig_,trans_rhs2,sv_rhs3);
361  return MatrixOp::transVtMtV(sv_rhs1,trans_rhs2,sv_rhs3);
362 }
363 
365  BLAS_Cpp::Transp M_trans, value_type alpha
366  ,const GenPermMatrixSlice& P1, BLAS_Cpp::Transp P1_trans
367  ,const GenPermMatrixSlice& P2, BLAS_Cpp::Transp P2_trans
368  ,value_type beta, MatrixSymOp* symwo_lhs
369  ) const
370 {
371  if(!row_perm_.get() && !col_perm_.get()) {
372  AbstractLinAlgPack::syr2k(*mat_orig_,M_trans,alpha,P1,P1_trans,P2,P2_trans,beta,symwo_lhs);
373  return;
374  }
375  MatrixOp::syr2k(M_trans,alpha,P1,P1_trans,P2,P2_trans,beta,symwo_lhs);
376 }
377 
379  MatrixOp* mwo_lhs, value_type alpha
380  ,BLAS_Cpp::Transp trans_rhs1, const MatrixOp& mwo_rhs2
381  ,BLAS_Cpp::Transp trans_rhs2, value_type beta
382  ) const
383 {
384  if(!row_perm_.get() && !col_perm_.get()) {
385  AbstractLinAlgPack::Mp_StMtM(mwo_lhs,alpha,*mat_orig_,trans_rhs1,mwo_rhs2,trans_rhs2,beta);
386  return true;
387  }
388  return MatrixOp::Mp_StMtM(mwo_lhs,alpha,trans_rhs1,mwo_rhs2,trans_rhs2,beta);
389 }
390 
392  MatrixOp* mwo_lhs, value_type alpha
393  ,const MatrixOp& mwo_rhs1, BLAS_Cpp::Transp trans_rhs1
394  ,BLAS_Cpp::Transp trans_rhs2, value_type beta
395  ) const
396 {
397  if(!row_perm_.get() && !col_perm_.get()) {
398  AbstractLinAlgPack::Mp_StMtM(mwo_lhs,alpha,mwo_rhs1,trans_rhs1,*mat_orig_,trans_rhs2,beta);
399  return true;
400  }
401  return MatrixOp::Mp_StMtM(mwo_lhs,alpha,mwo_rhs1,trans_rhs1,trans_rhs2,beta);
402 }
403 
405  BLAS_Cpp::Transp M_trans, value_type alpha
406  ,value_type beta, MatrixSymOp* sym_lhs
407  ) const
408 {
409  if(!row_perm_.get() && !col_perm_.get()) {
410  AbstractLinAlgPack::syrk(*mat_orig_,M_trans,alpha,beta,sym_lhs);
411  return true;
412  }
413  return MatrixOp::syrk(M_trans,alpha,beta,sym_lhs);
414 }
415 
416 } // end namespace AbstractLinAlgPack
friend void syr2k(const MatrixOp &M, BLAS_Cpp::Transp M_trans, value_type alpha, const GenPermMatrixSlice &P1, BLAS_Cpp::Transp P1_trans, const GenPermMatrixSlice &P2, BLAS_Cpp::Transp P2_trans, value_type beta, MatrixSymOp *symwo_lhs)
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
void Mp_StMtM(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &mwo_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2, value_type beta=1.0)
mwo_lhs = alpha * op(mwo_rhs1) * op(mwo_rhs2) + beta * mwo_lhs (right) (xGEMM).
void Vt_S(VectorMutable *v_lhs, const value_type &alpha)
v_lhs *= alpha
value_type transVtMtV(const Vector &v_rhs1, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3) const
void Vp_StPtMtV(VectorMutable *v_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, const MatrixOp &M_rhs2, BLAS_Cpp::Transp M_rhs2_trans, const Vector &v_rhs3, value_type beta=1.0)
v_lhs = alpha * op(P_rhs1) * op(M_rhs2) * v_rhs3 + beta * v_rhs
bool syrk(BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs) const
virtual mat_ptr_t sub_view(const Range1D &row_rng, const Range1D &col_rng) const
Create a transient constant sub-matrix view of this matrix (if supported).
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
v_lhs = alpha * v_rhs + v_lhs
Aggregate matrix class for a matrix and its permuted view.
T_To & dyn_cast(T_From &from)
const perm_ptr_t & row_perm() const
T * get() const
friend value_type transVtMtV(const Vector &v_rhs1, const MatrixOp &M_rhs2, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3)
void Vp_StMtV(VectorMutable *vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta) const
virtual const VectorSpace & space() const =0
Return a reference to a vector space object that this permutation is compatible with.
value_type transVtMtV(const Vector &v_rhs1, const MatrixOp &M_rhs2, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3)
result = v_rhs1' * op(M_rhs2) * v_rhs3
Interface adding operations specific for a symmetric matrix {abstract}.
const mat_ptr_t & mat_orig() const
void syr2k(const MatrixOp &M, BLAS_Cpp::Transp M_trans, value_type alpha, const GenPermMatrixSlice &P1, BLAS_Cpp::Transp P1_trans, const GenPermMatrixSlice &P2, BLAS_Cpp::Transp P2_trans, value_type beta, MatrixSymOp *symwo_lhs)
symwo_lhs += alpha*op(P1')*op(M)*op(P2) + alpha*op(P2')*op(M')*op(P1) + beta*symwo_lhs ...
void Mp_StPtMtP(MatrixOp *mwo_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs, const GenPermMatrixSlice &P_rhs2, BLAS_Cpp::Transp P_rhs2_trans)
mwo_lhs += alpha * op(P_rhs1) * op(M_rhs) * op(P_rhs2).
void initialize(const mat_ptr_t &mat_orig, const perm_ptr_t &row_perm, const perm_ptr_t &col_perm, const mat_ptr_t &mat_perm)
Initialize.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual void permute(BLAS_Cpp::Transp P_trans, const Vector &x, VectorMutable *y) const =0
Permute a vector op(P)*x -> y
Abstract interface for objects that represent a space for mutable coordinate vectors.
friend void Mp_StMtM(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &mwo_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2, value_type beta)
void syrk(const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs)
Perform a rank-k update of a symmetric matrix of the form:
const mat_ptr_t & mat_perm() const
void Mp_StMtP(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp M_trans, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans)
mwo_lhs += alpha * op(M_rhs) * op(P_rhs).
MatrixOp::mat_ptr_t sub_view(const Range1D &row_rng, const Range1D &col_rng) const
void Mp_StPtM(MatrixOp *mwo_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans, const MatrixOp &M_rhs, BLAS_Cpp::Transp M_trans)
mwo_lhs += alpha * op(P) * op(M_rhs).
void Mp_StM(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta=1.0)
v_lhs = alpha * op(M_rhs1) * v_rhs2 + beta * v_lhs (BLAS xGEMV)
bool Mp_StPtM(MatrixOp *mwo_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans, BLAS_Cpp::Transp M_trans) const
bool Mp_StPtMtP(MatrixOp *mwo_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, BLAS_Cpp::Transp M_trans, const GenPermMatrixSlice &P_rhs2, BLAS_Cpp::Transp P_rhs2_trans) const
Base class for all matrices that support basic matrix operations.
bool Mp_StMtM(MatrixOp *mwo_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2, value_type beta) const
virtual bool is_identity() const =0
Returns true if this is the identity permutation I.
const perm_ptr_t & col_perm() const
Abstract interface to permutation matrices.
void Vp_StPtMtV(VectorMutable *vs_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, BLAS_Cpp::Transp M_rhs2_trans, const Vector &v_rhs3, value_type beta) const
bool Mp_StMtP(MatrixOp *mwo_lhs, value_type alpha, BLAS_Cpp::Transp M_trans, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans) const
Abstract interface for mutable coordinate vectors {abstract}.
std::ostream & output(std::ostream &out) const
virtual vec_mut_ptr_t create_member() const =0
Create a vector member from the vector space.
friend void syrk(const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs)
bool Mp_StM(MatrixOp *mwo_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs) const
friend void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta)
Transp
void syr2k(BLAS_Cpp::Transp M_trans, value_type alpha, const GenPermMatrixSlice &P1, BLAS_Cpp::Transp P1_trans, const GenPermMatrixSlice &P2, BLAS_Cpp::Transp P2_trans, value_type beta, MatrixSymOp *symwo_lhs) const
Concrete matrix type to represent general permutation (mapping) matrices.
friend void Vp_StPtMtV(VectorMutable *v_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, const MatrixOp &M_rhs2, BLAS_Cpp::Transp M_rhs2_trans, const Vector &v_rhs3, value_type beta)