imate
C++/CUDA Reference
c_linear_operator.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_LINEAR_OPERATOR_H_
13 #define _C_LINEAR_OPERATOR_C_LINEAR_OPERATOR_H_
14 
15 // =======
16 // Headers
17 // =======
18 
19 #include "../_definitions/types.h" // FlagType, IndexType, LongIndexType
20 
21 
22 // =================
23 // c Linear Operator
24 // =================
25 
38 
39 template <typename DataType>
41 {
42  public:
43 
44  // Member methods
46 
48  const LongIndexType num_rows_,
49  const LongIndexType num_columns_);
50 
51  virtual ~cLinearOperator();
52 
55  void set_parameters(DataType* parameters_);
58 
59  virtual DataType get_eigenvalue(
60  const DataType* known_parameters,
61  const DataType known_eigenvalue,
62  const DataType* inquiry_parameters) const = 0;
63 
64  virtual void dot(
65  const DataType* vector,
66  DataType* product) = 0;
67 
68  virtual void transpose_dot(
69  const DataType* vector,
70  DataType* product) = 0;
71 
72  protected:
73 
74  // Member data
78  DataType* parameters;
80 };
81 
82 #endif // _C_LINEAR_OPERATOR_C_LINEAR_OPERATOR_H_
Base class for linear operators. This class serves as interface for all derived classes.
LongIndexType get_num_columns() const
virtual DataType get_eigenvalue(const DataType *known_parameters, const DataType known_eigenvalue, const DataType *inquiry_parameters) const =0
DataType * parameters
virtual void transpose_dot(const DataType *vector, DataType *product)=0
virtual void dot(const DataType *vector, DataType *product)=0
virtual ~cLinearOperator()
const LongIndexType num_rows
IndexType num_parameters
FlagType eigenvalue_relation_known
cLinearOperator()
Default constructor.
const LongIndexType num_columns
void set_parameters(DataType *parameters_)
Sets the scalar parameter this->parameters. Parameter is initialized to NULL. However,...
LongIndexType get_num_rows() const
FlagType is_eigenvalue_relation_known() const
Returns a flag that determines whether a relation between the parameters of the operator and its eige...
IndexType get_num_parameters() const
int LongIndexType
Definition: types.h:60
int FlagType
Definition: types.h:68
int IndexType
Definition: types.h:65