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
27template <typename DataType>
29
30 // Initializer list
31 A_is_symmetric(0)
32{
33}
34
35
36// =============
37// constructor 2
38// =============
39
45
46template <typename DataType>
47cMatrix<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
62template <typename DataType>
66
67
68// ============
69// set symmetry
70// ============
71
80
81template <typename DataType>
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
115template <typename DataType>
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
136template class cMatrix<float>;
137template class cMatrix<double>;
138template class cMatrix<long double>;
Base class for constant matrices.
Definition c_matrix.h:45
virtual ~cMatrix()
Destructor.
Definition c_matrix.cpp:63
cMatrix()
Default constructor.
Definition c_matrix.cpp:28
virtual void set_symmetry(const FlagType symmetric)
Specify whether the matrix is symmetic or non-symmetric.
Definition c_matrix.cpp:82
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
int FlagType
Definition types.h:68