imate
C++/CUDA Reference
Loading...
Searching...
No Matches
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
42
43template <typename DataType>
44class cMatrix : virtual public cLinearOperator<DataType>
45{
46 public:
47
48 // Member methods
49 cMatrix();
50
51 explicit cMatrix(const FlagType A_is_symmetric_);
52
53 virtual ~cMatrix();
54
55 DataType get_eigenvalue(
56 const DataType* known_parameters,
57 const DataType known_eigenvalue,
58 const DataType* inquiry_parameters) const;
59
60 virtual FlagType is_identity_matrix() const = 0;
61
62 virtual void set_symmetry(const FlagType symmetric);
63
64 virtual void dot_plus(
65 const DataType* vector,
66 const DataType alpha,
67 DataType* product) = 0;
68
69 virtual void transpose_dot_plus(
70 const DataType* vector,
71 const DataType alpha,
72 DataType* product) = 0;
73
74 protected:
75
76 // Member data
78};
79
80
81#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:45
virtual ~cMatrix()
Destructor.
Definition c_matrix.cpp:63
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
FlagType A_is_symmetric
Definition c_matrix.h:77
virtual void set_symmetry(const FlagType symmetric)
Specify whether the matrix is symmetic or non-symmetric.
Definition c_matrix.cpp:82
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:116
int FlagType
Definition types.h:68