imate
C++/CUDA Reference
c_matrix.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu>
3  * SPDX-License-Identifier: BSD-3-Clause
4  * SPDX-FileType: SOURCE
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the license found in the LICENSE.txt file in the root
8  * directory of this source tree.
9  */
10 
11 
12 #ifndef _C_LINEAR_OPERATOR_C_MATRIX_H_
13 #define _C_LINEAR_OPERATOR_C_MATRIX_H_
14 
15 
16 // =======
17 // Headers
18 // =======
19 
20 #include "../_definitions/types.h" // FlagType, IndexType, LongIndexType
21 #include "./c_linear_operator.h" // cLinearOperator
22 
23 
24 // ========
25 // c Matrix
26 // ========
27 
37 
38 
39 template <typename DataType>
40 class cMatrix : virtual public cLinearOperator<DataType>
41 {
42  public:
43 
44  // Member methods
45  cMatrix();
46 
47  virtual ~cMatrix();
48 
49  DataType get_eigenvalue(
50  const DataType* known_parameters,
51  const DataType known_eigenvalue,
52  const DataType* inquiry_parameters) const;
53 
54  virtual FlagType is_identity_matrix() const = 0;
55 
56  virtual void dot_plus(
57  const DataType* vector,
58  const DataType alpha,
59  DataType* product) = 0;
60 
61  virtual void transpose_dot_plus(
62  const DataType* vector,
63  const DataType alpha,
64  DataType* product) = 0;
65 };
66 
67 
68 #endif // _C_LINEAR_OPERATOR_C_MATRIX_H_
Base class for linear operators. This class serves as interface for all derived classes.
Base class for constant matrices.
Definition: c_matrix.h:41
virtual ~cMatrix()
Definition: c_matrix.cpp:38
virtual void dot_plus(const DataType *vector, const DataType alpha, DataType *product)=0
virtual FlagType is_identity_matrix() const =0
cMatrix()
Default constructor.
Definition: c_matrix.cpp:28
virtual void transpose_dot_plus(const DataType *vector, const DataType alpha, DataType *product)=0
DataType get_eigenvalue(const DataType *known_parameters, const DataType known_eigenvalue, const DataType *inquiry_parameters) const
This virtual function is implemented from its pure virtual function of the base class....
Definition: c_matrix.cpp:64
int FlagType
Definition: types.h:68