imate
C++/CUDA Reference
Loading...
Searching...
No Matches
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
41
42template <typename DataType>
43class cDenseMatrix : public cMatrix<DataType>
44{
45 public:
46
47 // Member methods
49
51 const DataType* A_,
52 const LongIndexType num_rows_,
53 const LongIndexType num_columns_,
54 const FlagType A_is_row_major_,
55 const FlagType A_is_symmetric_);
56
57 virtual ~cDenseMatrix();
58
59 virtual FlagType is_identity_matrix() const;
60
61 virtual void dot(
62 const DataType* vector,
63 DataType* product);
64
65 virtual void dot_plus(
66 const DataType* vector,
67 const DataType alpha,
68 DataType* product);
69
70 virtual void transpose_dot(
71 const DataType* vector,
72 DataType* product);
73
74 virtual void transpose_dot_plus(
75 const DataType* vector,
76 const DataType alpha,
77 DataType* product);
78
79 protected:
80
81 // Member data
82 const DataType* A;
84};
85
86#endif // _C_LINEAR_OPERATOR_C_DENSE_MATRIX_H_
Container for dense matrices.
virtual ~cDenseMatrix()
Destructor.
virtual void transpose_dot_plus(const DataType *vector, const DataType alpha, DataType *product)
Transposed-matrix vector product written in place.
virtual FlagType is_identity_matrix() const
Checks whether the matrix is identity.
virtual void dot_plus(const DataType *vector, const DataType alpha, DataType *product)
Matrix vector product written in place.
const FlagType A_is_row_major
virtual void transpose_dot(const DataType *vector, DataType *product)
Transposed-matrix vector product.
cDenseMatrix()
Default constructor.
const DataType * A
virtual void dot(const DataType *vector, DataType *product)
Matrix vector product.
Base class for constant matrices.
Definition c_matrix.h:45
int LongIndexType
Definition types.h:60
int FlagType
Definition types.h:68