KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
array_utils.h File Reference
#include "io_utils.h"
#include <cmath>
#include "array_eigen.h"
#include "array_mkl.h"
Include dependency graph for array_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ARRAY_IMPLEMENT_MACRO
 Declare implement of array.
 
#define ARRAY_IMPLEMENT_EIEGN
 
#define ARRAY_IMPLEMENT_XTENSOR
 
#define ARRAY_SHOW(_A, _n1, _n2)
 

Functions

template<class T >
bool ARRAY_ISFINITE (T *A, size_t n)
 

Macro Definition Documentation

◆ ARRAY_IMPLEMENT_EIEGN

#define ARRAY_IMPLEMENT_EIEGN

Definition at line 43 of file array_utils.h.

◆ ARRAY_IMPLEMENT_MACRO

#define ARRAY_IMPLEMENT_MACRO

Declare implement of array.

Options: Eigen, xtensor and macro. See more:

 @test: performance tests are on $DIR/benckmark/array_benckmark.md
Note
: all arrays are actually saved in 1-d C-like array style, for better balance with other language like Fortran.

: realize basic interface for array manipulations:

interface to Eigen/xtensor: base on inline functions and templated functions. Here xtensor(or xtensor-blas) further interface to mkl functions by flens project.

interface to macro: base on macro definitions. Easy to read and use, but little low efficiency.

we recomment interface to Eigen by default.

Definition at line 42 of file array_utils.h.

◆ ARRAY_IMPLEMENT_XTENSOR

#define ARRAY_IMPLEMENT_XTENSOR

Definition at line 44 of file array_utils.h.

◆ ARRAY_SHOW

#define ARRAY_SHOW ( _A,
_n1,
_n2 )
Value:
({ \
std::cout << "Show Array <" << #_A << ">\n"; \
int _idxA = 0; \
for (int _i = 0; _i < (_n1); ++_i) { \
for (int _j = 0; _j < (_n2); ++_j) std::cout << FMT(4) << (_A)[_idxA++]; \
std::cout << std::endl; \
} \
})
#define FMT(X)
Definition fmt.h:40

Definition at line 54 of file array_utils.h.

Function Documentation

◆ ARRAY_ISFINITE()

template<class T >
bool ARRAY_ISFINITE ( T * A,
size_t n )

Definition at line 67 of file array_utils.h.