KIDS
ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
array_utils.h
Go to the documentation of this file.
1
15
#ifndef Array_Utils_H
16
#define Array_Utils_H
17
18
/*======================================================
19
= Declare the implement of array =
20
======================================================*/
21
42
#define ARRAY_IMPLEMENT_MACRO
43
#define ARRAY_IMPLEMENT_EIEGN
44
#define ARRAY_IMPLEMENT_XTENSOR
45
46
/*===== End of Declare the implement of array ======*/
47
48
49
50
/*---------- for debugging array information ----------*/
51
52
#include "
io_utils.h
"
53
54
#define ARRAY_SHOW(_A, _n1, _n2) \
55
({ \
56
std::cout << "Show Array <" << #_A << ">\n"; \
57
int _idxA = 0; \
58
for (int _i = 0; _i < (_n1); ++_i) { \
59
for (int _j = 0; _j < (_n2); ++_j) std::cout << FMT(4) << (_A)[_idxA++]; \
60
std::cout << std::endl; \
61
} \
62
})
63
64
/*---------- common array information ----------*/
65
#include <cmath>
66
template
<
class
T>
67
bool
ARRAY_ISFINITE
(T* A,
size_t
n) {
68
bool
is_finite =
true
;
69
for
(
int
i = 0; is_finite && i < n; ++i) is_finite = std::isfinite(std::abs(A[i]));
70
return
is_finite;
71
}
72
73
// #include "array_macro.h"
74
#include "
array_eigen.h
"
75
#include "
array_mkl.h
"
76
// #include "array_xtensor.h"
77
78
// #ifdef ARRAY_IMPLEMENT_EIEGN
79
// #elif defined(ARRAY_IMPLEMENT_XTENSOR)
80
// #elif defined(ARRAY_IMPLEMENT_MACRO)
81
// #else
82
// #error "Unknown Array Implement"
83
// #endif // ARRAY_IMPLEMENT_EIEGN
84
85
#endif
// Array_Utils_H
array_eigen.h
array_mkl.h
ARRAY_ISFINITE
bool ARRAY_ISFINITE(T *A, size_t n)
Definition
array_utils.h:67
io_utils.h
home
shin
share
KIDS
src
core
include
kids
utils
array_utils.h
Generated on Mon May 27 2024 11:36:31 for KIDS by
1.10.0