imate
C++/CUDA Reference
c_dense_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_DENSE_MATRIX_H_
13 #define _C_LINEAR_OPERATOR_C_DENSE_MATRIX_H_
14 
15 
16 // =======
17 // Headers
18 // =======
19 
20 #include "../_definitions/types.h" // FlagType, LongIndexType
21 #include "./c_matrix.h" // cMatrix
22 
23 
24 // ==============
25 // c Dense Matrix
26 // ==============
27 
28 template <typename DataType>
29 class cDenseMatrix : public cMatrix<DataType>
30 {
31  public:
32 
33  // Member methods
34  cDenseMatrix();
35 
37  const DataType* A_,
38  const LongIndexType num_rows_,
39  const LongIndexType num_columns_,
40  const FlagType A_is_row_major_);
41 
42  virtual ~cDenseMatrix();
43 
44  virtual FlagType is_identity_matrix() const;
45 
46  virtual void dot(
47  const DataType* vector,
48  DataType* product);
49 
50  virtual void dot_plus(
51  const DataType* vector,
52  const DataType alpha,
53  DataType* product);
54 
55  virtual void transpose_dot(
56  const DataType* vector,
57  DataType* product);
58 
59  virtual void transpose_dot_plus(
60  const DataType* vector,
61  const DataType alpha,
62  DataType* product);
63 
64  protected:
65 
66  // Member data
67  const DataType* A;
69 };
70 
71 #endif // _C_LINEAR_OPERATOR_C_DENSE_MATRIX_H_
virtual ~cDenseMatrix()
virtual void transpose_dot_plus(const DataType *vector, const DataType alpha, DataType *product)
virtual FlagType is_identity_matrix() const
Checks whether the matrix is identity.
virtual void dot_plus(const DataType *vector, const DataType alpha, DataType *product)
const FlagType A_is_row_major
virtual void transpose_dot(const DataType *vector, DataType *product)
const DataType * A
virtual void dot(const DataType *vector, DataType *product)
Base class for constant matrices.
Definition: c_matrix.h:41
int LongIndexType
Definition: types.h:60
int FlagType
Definition: types.h:68