imate
C++/CUDA Reference
Loading...
Searching...
No Matches
c_csc_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_CSC_MATRIX_H_
13#define _C_LINEAR_OPERATOR_C_CSC_MATRIX_H_
14
15
16// =======
17// Headers
18// =======
19
20#include "../_definitions/types.h" // LongIndexType, FlagType
21#include "./c_matrix.h" // cMatrix
22
23
24// ============
25// c CSC Matrix
26// ============
27
41
42template <typename DataType>
43class cCSCMatrix : public cMatrix<DataType>
44{
45 public:
46
47 // Member methods
48 cCSCMatrix();
49
51 const DataType* A_data_,
52 const LongIndexType* A_indices_,
53 const LongIndexType* A_index_pointer_,
54 const LongIndexType num_rows_,
55 const LongIndexType num_columns_,
56 const FlagType A_is_symmetric_);
57
58 virtual ~cCSCMatrix();
59
60 virtual FlagType is_identity_matrix() const;
61
62 LongIndexType get_nnz() const;
63
64 virtual void dot(
65 const DataType* vector,
66 DataType* product);
67
68 virtual void dot_plus(
69 const DataType* vector,
70 const DataType alpha,
71 DataType* product);
72
73 virtual void transpose_dot(
74 const DataType* vector,
75 DataType* product);
76
77 virtual void transpose_dot_plus(
78 const DataType* vector,
79 const DataType alpha,
80 DataType* product);
81
82 protected:
83
84 // Member data
85 const DataType* A_data;
88};
89
90#endif // _C_LINEAR_OPERATOR_C_CSC_MATRIX_H_
Container for CSC matrices.
LongIndexType get_nnz() const
Returns the number of non-zero elements of the sparse matrix.
virtual void transpose_dot(const DataType *vector, DataType *product)
Transposed-matrix vector product.
virtual ~cCSCMatrix()
Destructor.
virtual void dot(const DataType *vector, DataType *product)
Matrix vector product.
const DataType * A_data
virtual FlagType is_identity_matrix() const
Checks whether the matrix is identity.
const LongIndexType * A_indices
const LongIndexType * A_index_pointer
virtual void dot_plus(const DataType *vector, const DataType alpha, DataType *product)
Matrix vector product written in place.
cCSCMatrix()
Default constructor.
virtual void transpose_dot_plus(const DataType *vector, const DataType alpha, DataType *product)
Transposed-matrix vector product written in place.
Base class for constant matrices.
Definition c_matrix.h:45
int LongIndexType
Definition types.h:60
int FlagType
Definition types.h:68