LILAC
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Functions
utils.cpp File Reference
#include "defs.hpp"
#include "engine/item.h"
#include <map>
#include <set>
#include <complex.h>
#include <acml.h>
Include dependency graph for utils.cpp:

Go to the source code of this file.

Classes

class  fft_plan_holder
class  __HIDER__::_unique_name
 Create a unique name that cannot already exist in the engine, should never reference directly. More...

Namespaces

namespace  __HIDER__

Functions

void err (std::string message, std::string function, std::string file, _fatal f)
void err (std::string message, std::string function, std::string file, _warning w)
void err (std::string message, std::string function, std::string file, const item *p, _fatal f)
void err (std::string message, std::string function, std::string file, const item *p, _warning f)
void err (std::string message, std::string function, std::string file, std::shared_ptr< item > p, _fatal f)
void err (std::string message, std::string function, std::string file, std::shared_ptr< item > p, _warning f)
void _fft (comp *_in, comp *_out, const size_t len, int dir, double scale)
 Actual fft function that fft and ifft wrap.
void fft (comp *in, comp *out, const size_t len)
 This function performs a fourier transform in the forward direction.
void ifft (comp *in, comp *out, const size_t len)
 This functions performs a normalized fourier transform in the backwards direction.
void trim (std::string &curline, const std::string &val)
void ltoken (std::string &tok, std::string &str, std::string delim)
std::string get_unique_name (std::string base)

Function Documentation

void _fft ( comp _in,
comp _out,
const size_t  len,
int  dir,
double  scale 
)

Actual fft function that fft and ifft wrap.

Definition at line 110 of file utils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void err ( std::string  message,
std::string  function,
std::string  file,
_fatal  f 
)

Throws a fatal error, and prints the message, function name, and file name. Afterwards, program exits. err("something failed", "some_func", "folder/some_file.cpp", FATAL_ERROR)–>

A fatal error has occured in functions some_func in file "folder/some_file.cpp" Error message is: Something failed Exiting program

Definition at line 37 of file utils.cpp.

Here is the caller graph for this function:

void err ( std::string  message,
std::string  function,
std::string  file,
_warning  w 
)

Throws a warning, and prints the message, function name, and file name. Afterwards, program continues. err("something failed", "some_func", "folder/some_file.cpp", WARNING)–>

A non-fatal error has occured in functions some_func in file "folder/some_file.cpp" Error message is: Something failed

Definition at line 54 of file utils.cpp.

void err ( std::string  message,
std::string  function,
std::string  file,
const item p,
_fatal  f 
)

Definition at line 58 of file utils.cpp.

Here is the call graph for this function:

void err ( std::string  message,
std::string  function,
std::string  file,
const item p,
_warning  f 
)

Definition at line 65 of file utils.cpp.

Here is the call graph for this function:

void err ( std::string  message,
std::string  function,
std::string  file,
std::shared_ptr< item p,
_fatal  f 
)

Definition at line 71 of file utils.cpp.

void err ( std::string  message,
std::string  function,
std::string  file,
std::shared_ptr< item p,
_warning  f 
)

Definition at line 78 of file utils.cpp.

void fft ( comp in,
comp out,
const size_t  len 
)

This function performs a fourier transform in the forward direction.

Definition at line 134 of file utils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string get_unique_name ( std::string  base)

Returns a name that has not been created previously be the function, and should not exist in the engine Will almost certainly not be human-readable or printable on a terminal

Parameters
baseThe base string with which to generate the new name
Returns
A unique name

Definition at line 227 of file utils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ifft ( comp in,
comp out,
const size_t  len 
)

This functions performs a normalized fourier transform in the backwards direction.

Definition at line 148 of file utils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ltoken ( std::string tok,
std::string str,
std::string  delim 
)

Definition at line 189 of file utils.cpp.

Here is the caller graph for this function:

void trim ( std::string curline,
const std::string val 
)

Trims specified characters from beginning and end of string " \n \r stuff-we want \t " –> "stuff we want"

Parameters
curlineThe string to be trimmed. Is modified by the function.
valThe characters to be trimmed, are whitespace by default

Definition at line 164 of file utils.cpp.

Here is the caller graph for this function: