imate
C++/CUDA Reference
c_affine_matrix_function.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_AFFINE_MATRIX_FUNCTION_H_
13 #define _C_LINEAR_OPERATOR_C_AFFINE_MATRIX_FUNCTION_H_
14 
15 
16 // =======
17 // Headers
18 // =======
19 
20 #include "../_definitions/types.h" // LongIndexType
21 #include "./c_linear_operator.h" // cLinearOperator
22 
23 
24 // ========================
25 // c Affine Matrix Function
26 // ========================
27 
37 
38 
39 template <typename DataType>
40 class cAffineMatrixFunction : public cLinearOperator<DataType>
41 {
42  public:
43 
44  // Member methods
46  const LongIndexType num_rows_,
47  const LongIndexType num_columns_);
48 
49  virtual ~cAffineMatrixFunction();
50 
51  void set_parameters(DataType* t);
52 
53  DataType get_eigenvalue(
54  const DataType* known_parameters,
55  const DataType known_eigenvalue,
56  const DataType* inquiry_parameters) const;
57 
58  protected:
59 
60  // Member methods
61  void _add_scaled_vector(
62  const DataType* input_vector,
63  const LongIndexType vector_size,
64  const DataType scale,
65  DataType* output_vector) const;
66 
67  // Member data
69 };
70 
71 
72 #endif // _C_LINEAR_OPERATOR_C_AFFINE_MATRIX_FUNCTION_H_
Base class for affine matrix functions of one parameter.
void _add_scaled_vector(const DataType *input_vector, const LongIndexType vector_size, const DataType scale, DataType *output_vector) const
Performs the operation , where is an input vector scaled by and it the output vector.
virtual ~cAffineMatrixFunction()
Virtual destructor.
void set_parameters(DataType *t)
cAffineMatrixFunction(const LongIndexType num_rows_, const LongIndexType num_columns_)
Constructor.
DataType get_eigenvalue(const DataType *known_parameters, const DataType known_eigenvalue, const DataType *inquiry_parameters) const
This function defines an analytic relationship between a given set of parameters and the correspondin...
Base class for linear operators. This class serves as interface for all derived classes.
int LongIndexType
Definition: types.h:60