imate
C++/CUDA Reference
Loading...
Searching...
No Matches
c_matrix.cpp
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
// =======
13
// Headers
14
// =======
15
16
#include "
./c_matrix.h
"
17
#include <cassert>
// assert
18
19
20
// =============
21
// constructor 1
22
// =============
23
26
27
template
<
typename
DataType>
28
cMatrix<DataType>::cMatrix
():
29
30
// Initializer list
31
A_is_symmetric(0)
32
{
33
}
34
35
36
// =============
37
// constructor 2
38
// =============
39
45
46
template
<
typename
DataType>
47
cMatrix<DataType>::cMatrix
(
const
FlagType
A_is_symmetric_):
48
49
// Initializer list
50
A_is_symmetric(A_is_symmetric_)
51
{
52
}
53
54
55
// ==========
56
// destructor
57
// ==========
58
61
62
template
<
typename
DataType>
63
cMatrix<DataType>::~cMatrix
()
64
{
65
}
66
67
68
// ============
69
// set symmetry
70
// ============
71
80
81
template
<
typename
DataType>
82
void
cMatrix<DataType>::set_symmetry
(
const
FlagType
symmetric)
83
{
84
if
(symmetric == 1)
85
{
86
this->A_is_symmetric = 1;
87
}
88
else
89
{
90
this->A_is_symmetric = 0;
91
}
92
}
93
94
95
// ==============
96
// get eigenvalue
97
// ==============
98
114
115
template
<
typename
DataType>
116
DataType
cMatrix<DataType>::get_eigenvalue
(
117
const
DataType* known_parameters,
118
const
DataType known_eigenvalue,
119
const
DataType* inquiry_parameters)
const
120
{
121
assert((
false
) &&
"This function should not be called within this class"
);
122
123
// Void unused variables to avoid compiler warnings (-Wno-unused-parameter)
124
(void) known_parameters;
125
(void) known_eigenvalue;
126
(void) inquiry_parameters;
127
128
return
0;
129
}
130
131
132
// ===============================
133
// Explicit template instantiation
134
// ===============================
135
136
template
class
cMatrix<float>
;
137
template
class
cMatrix<double>
;
138
template
class
cMatrix<long double>
;
c_matrix.h
cMatrix
Base class for constant matrices.
Definition
c_matrix.h:45
cMatrix::~cMatrix
virtual ~cMatrix()
Destructor.
Definition
c_matrix.cpp:63
cMatrix::cMatrix
cMatrix()
Default constructor.
Definition
c_matrix.cpp:28
cMatrix::set_symmetry
virtual void set_symmetry(const FlagType symmetric)
Specify whether the matrix is symmetic or non-symmetric.
Definition
c_matrix.cpp:82
cMatrix::get_eigenvalue
DataType get_eigenvalue(const DataType *known_parameters, const DataType known_eigenvalue, const DataType *inquiry_parameters) const
This virtual function is implemented from its pure virtual function of the base class....
Definition
c_matrix.cpp:116
FlagType
int FlagType
Definition
types.h:68
imate
_c_linear_operator
c_matrix.cpp
Generated on Tue May 12 2026 22:54:38 for imate by
1.9.8