monolish
0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
src
utils
compare
compare_linearoperator.cpp
Go to the documentation of this file.
1
#include "../../../include/common/monolish_dense.hpp"
2
#include "../../../include/common/monolish_logger.hpp"
3
#include "../../../include/common/monolish_matrix.hpp"
4
#include "../../internal/monolish_internal.hpp"
5
6
namespace
monolish
{
7
namespace
util {
8
9
template
<
typename
T>
10
bool
is_same_structure
(
const
matrix::LinearOperator<T>
&A,
11
const
matrix::LinearOperator<T>
&B) {
12
Logger
&logger =
Logger::get_instance
();
13
logger.
util_in
(
monolish_func
);
14
15
bool
ans =
false
;
16
17
if
(A.
get_row
() == B.
get_row
() && A.
get_col
() == B.
get_col
()) {
18
logger.
util_out
();
19
ans =
true
;
20
}
21
22
logger.
util_out
();
23
return
ans;
24
}
25
26
template
bool
is_same_structure
(
const
matrix::LinearOperator<double>
&A,
27
const
matrix::LinearOperator<double>
&B);
28
template
bool
is_same_structure
(
const
matrix::LinearOperator<float>
&A,
29
const
matrix::LinearOperator<float>
&B);
30
31
template
<
typename
T>
32
bool
is_same_size
(
const
matrix::LinearOperator<T>
&A,
33
const
matrix::LinearOperator<T>
&B) {
34
Logger
&logger =
Logger::get_instance
();
35
logger.
util_in
(
monolish_func
);
36
37
bool
ans =
true
;
38
39
if
(A.
get_row
() != B.
get_row
() && A.
get_col
() != B.
get_col
()) {
40
logger.
util_out
();
41
ans =
false
;
42
}
43
44
logger.
util_out
();
45
return
ans;
46
}
47
48
template
bool
is_same_size
(
const
matrix::LinearOperator<double>
&A,
49
const
matrix::LinearOperator<double>
&B);
50
template
bool
is_same_size
(
const
matrix::LinearOperator<float>
&A,
51
const
matrix::LinearOperator<float>
&B);
52
53
}
// namespace util
54
}
// namespace monolish
monolish::util::is_same_size
bool is_same_size(const T &x, const U &y)
compare size of vector or 1Dview (same as is_same_structure())
Definition:
monolish_common.hpp:358
monolish::matrix::LinearOperator
Linear Operator imitating Matrix.
Definition:
monolish_coo.hpp:30
monolish_func
#define monolish_func
Definition:
monolish_logger.hpp:9
monolish::util::is_same_structure
bool is_same_structure(const T A, const U B)
compare matrix structure
Definition:
monolish_common.hpp:268
monolish::Logger
logger class (singleton, for developper class)
Definition:
monolish_logger.hpp:19
monolish::matrix::LinearOperator::get_col
size_t get_col() const
get # of col
Definition:
monolish_linearoperator.hpp:164
monolish::Logger::util_out
void util_out()
Definition:
logger_utils.cpp:123
monolish::Logger::util_in
void util_in(const std::string func_name)
Definition:
logger_utils.cpp:113
monolish
Definition:
monolish_matrix_blas.hpp:9
monolish::matrix::LinearOperator::get_row
size_t get_row() const
get # of row
Definition:
monolish_linearoperator.hpp:155
monolish::Logger::get_instance
static Logger & get_instance()
Definition:
monolish_logger.hpp:42
Generated by
1.8.17