MyraMath
schurgemm.h
Go to the documentation of this file.
1 // ========================================================================= //
2 // This file is part of MyraMath, copyright (c) 2014-2019 by Ryan A Chilton //
3 // and distributed by MyraCore, LLC. See LICENSE.txt for license terms. //
4 // ========================================================================= //
5 
6 #ifndef MYRAMATH_MULTIFRONTAL_LU_SCHURGEMMA_H
7 #define MYRAMATH_MULTIFRONTAL_LU_SCHURGEMMA_H
8 
14 #include <myramath/multifrontal/detail/schurgemm.h>
15 
16 namespace myra {
17 
18 // Forward declarations.
19 template<class Number> class LUKernel;
20 
21 namespace multifrontal {
22 namespace detail {
23 
24 // Forwarde declarations.
25 template<class Number> class XContainer;
26 
27 namespace lu {
28 
29 // Forward declarations.
30 template<class Kernel> class LUContainer;
31 
32 namespace schurgemm {
33 
34 template<class Number> class JobGraphBase : public ::myra::multifrontal::detail::schurgemm::JobGraphBase2<Number>
35  {
36  public:
37 
38  // Structural typedefs for base class.
39  typedef ::myra::multifrontal::detail::schurgemm::JobGraphBase2<Number> Base;
40 
41  // Typedefs related to numeric storage.
42  typedef ::myra::LUKernel<Number> Kernel;
43  typedef ::myra::multifrontal::detail::lu::LUContainer<Kernel> LUContainer;
44  typedef ::myra::multifrontal::detail::XContainer<Number> XContainer;
46  typedef MatrixRange<Number> Range;
47 
48  // Constructor - requires const references to X and Y, mutable reference to S
49  JobGraphBase(const LUContainer* in_LU, const XContainer* in_X, const XContainer* in_Y, const MatrixRange<Number>& in_S)
50  : Base(&in_LU->tree(), in_X, in_Y, in_S), X(in_X), Y(in_Y), S(in_S) { }
51 
52  // Virtual copy constructor.
53  virtual ::myra::JobGraphBase* clone() const
54  { return new JobGraphBase(*this); }
55 
56  protected:
57 
58  // Updates Sn(i,j) += Xn(k,i)'*Yn(k,j)
59  virtual uint64_t update(int n, int k, int i, int j)
60  {
61  Number one(1);
62  Number zero(0);
63  const Range Sn_ij = this->s(n,i,j);
64  const CRange Xn_ki = this->x(n,k,i);
65  const CRange Yn_kj = this->y(n,k,j);
66  return gemm_nwork(Sn_ij, Xn_ki, 'T', Yn_kj, 'N', one, one);
67  }
68 
69  private:
70 
71  // Reference to underlying X and Y (const)
72  const XContainer* X;
73  const XContainer* Y;
74 
75  // Output range.
76  const MatrixRange<Number> S;
77 
78  }; // class JobGraph
79 
80 } } } } } // namespace
81 
82 #endif
Definition: syntax.dox:1
Represents a const MatrixRange.
Definition: bothcat.h:22
Factors A into L*U, presents solve methods.
Definition: Kernel.h:35
Definition: random.cpp:45
Represents a mutable MatrixRange.
Definition: conjugate.h:26
Definition: partialsolve.h:32
Definition: schurgemm.h:25