Openholo  v1.0
Open Source Digital Holographic Library
function.h File Reference
#include "complex.h"
#include "mat.h"
#include "vec.h"
#include <chrono>
#include <random>
Include dependency graph for function.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 oph
 

Macros

#define CUR_TIME   std::chrono::system_clock::now()
 
#define ELAPSED_TIME(x, y)   ((std::chrono::duration<double>)(y - x)).count()
 
#define CUR_TIME_DURATION   CUR_TIME.time_since_epoch()
 
#define CUR_TIME_DURATION_MILLI_SEC   std::chrono::duration_cast<std::chrono::milliseconds>(CUR_TIME_DURATION).count()
 

Functions

template<typename type , typename T >
type oph::force_cast (const Complex< T > &p)
 
template<typename type , typename T >
type oph::force_cast (const T &p)
 
Real oph::minOfArr (const std::vector< Real > &arr)
 
Real oph::minOfArr (const Real *src, const int &size)
 
Real oph::maxOfArr (const std::vector< Real > &arr)
 
Real oph::maxOfArr (const Real *src, const int &size)
 
Real oph::average (const Real *src, const int &size)
 
template<typename T >
void oph::abs (const oph::Complex< T > &src, oph::Complex< T > &dst)
 
template<typename T >
void oph::absArr (const std::vector< Complex< T >> &src, std::vector< oph::Complex< T >> &dst)
 
template<typename T >
void oph::absMat (const oph::matrix< oph::Complex< T >> &src, oph::matrix< oph::Complex< T >> &dst)
 
template<typename T >
void oph::absCplx (const oph::Complex< T > &src, T &dst)
 
template<typename T >
void oph::absCplxArr (const oph::Complex< T > *src, T *dst, const int &size)
 
template<typename T >
oph::getReal (const oph::Complex< T > src)
 
template<typename T >
void oph::realPart (const oph::Complex< T > *src, T *dst, const int &size)
 
template<typename T >
void oph::angle (const std::vector< Complex< T >> &src, std::vector< T > &dst)
 
template<typename T >
oph::angle (const oph::Complex< T > &src)
 
template<typename T >
void oph::normalize (const Complex< T > *src, Complex< T > *dst, const int &size)
 Normalize all elements of Complex<T>* src from 0 to 1. More...
 
template<typename T >
void oph::normalize (const T *src, T *dst, const int &size)
 
template<typename T >
void oph::normalize (T *src, oph::uchar *dst, const oph::uint nx, const oph::uint ny)
 Normalize all elements of T* src from 0 to 255. More...
 
template<typename T >
void oph::normalize (const std::vector< T > *src, std::vector< oph::uchar > *dst)
 Normalize all elements from 0 to 255. More...
 
template<typename T >
void oph::memsetArr (const std::vector< T > *pArr, T _Value, oph::uint beginIndex, oph::uint endIndex)
 Set elements to specific values from begin index to end index. More...
 
template<typename T >
void oph::memsetArr (T *pArr, const T &_Value, const oph::uint &beginIndex, const oph::uint &endIndex)
 
template<typename T >
void oph::circShift (const T *src, T *dst, int shift_x, int shift_y, int xdim, int ydim)
 Shifts the elements by shift_x, shift_y. More...
 
Real oph::rand (const Real min, const Real max, oph::ulong _SEED_VALUE=0)
 Get random Real value from min to max. More...
 
int oph::rand (const int min, const int max, oph::ulong _SEED_VALUE=0)
 Get random Integer value from min to max. More...
 
void oph::getPhase (oph::Complex< Real > *src, Real *dst, const int &size)
 
void oph::getAmplitude (oph::Complex< Real > *src, Real *dst, const int &size)
 
template<typename T >
void oph::Field2Buffer (matrix< T > &src, T **dst)
 
template<typename T >
void oph::Buffer2Field (const T *src, matrix< T > &dst, const ivec2 buffer_size)
 
void oph::meshGrid ()
 

Macro Definition Documentation

◆ CUR_TIME

#define CUR_TIME   std::chrono::system_clock::now()

Definition at line 58 of file function.h.

◆ CUR_TIME_DURATION

#define CUR_TIME_DURATION   CUR_TIME.time_since_epoch()

Definition at line 60 of file function.h.

◆ CUR_TIME_DURATION_MILLI_SEC

#define CUR_TIME_DURATION_MILLI_SEC   std::chrono::duration_cast<std::chrono::milliseconds>(CUR_TIME_DURATION).count()

Definition at line 61 of file function.h.

◆ ELAPSED_TIME

#define ELAPSED_TIME (   x,
 
)    ((std::chrono::duration<double>)(y - x)).count()

Definition at line 59 of file function.h.