ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
adore::mad::ArrayMatrixTools Class Reference

#include <arraymatrixtools.h>

Collaboration diagram for adore::mad::ArrayMatrixTools:
Collaboration graph

Public Types

enum  CONDITION {
  EQUAL , GREATER , LOWER , GREATER_EQUAL ,
  LOWER_EQUAL , UNDEFINED
}
 

Static Public Member Functions

template<typename T >
static double mean (T *input, int inputSize)
 
template<typename T >
static double sum (T *input, int inputSize)
 
template<typename T >
static void diff (T *output, T *input, int inputSize)
 
template<typename T >
static void sort (T *output, int *outputIndex, T *input, int inputSize)
 
template<typename T >
static bool any (T *input, int inputSize, const char *condition, double ref)
 
template<typename T >
static std::vector< int > find (T *input, int inputSize, const char *condition, double ref)
 
template<typename T >
static std::vector< int > find (std::vector< T > *input, const char *condition, double ref)
 
template<typename T >
static void find (int *output, int *outputSize, T *input, int inputSize, const char *condition, double ref)
 
template<typename T >
static void transpose (T *output, T *input, int input_row, int input_column)
 
static void matrixMultiplication (double *output, double *input_1, int input_1_row, int input_1_column, double *input_2, int input_2_row, int input_2_column)
 
template<typename T >
static void pointwise_multiply (T *output, T *input_1, T *input_2, int inputSize)
 
template<typename T >
static void pieceOfArray (T *output, T *input, int start, int end)
 
template<typename T >
static void sparseDiagonalMatrix (T *sparse, T *input, int output_row, int output_column, int inputSize, int StartingReference)
 
static double angle_norm (double x)
 
static double unwrap (double prev, double now)
 
static bool isNaN (double x)
 
template<typename T >
static int sign (T x)
 
template<typename T >
static double exponentialAverage (T *input, int inputSize)
 
template<typename T >
static double exponentialMovingAverage (T *input, int inputSize, double newValue)
 
static double aglBetwVecInArcLen (double *v1, double *v2, int dim)
 
template<int T>
static double aglBetwVecInArcLen (dlib::vector< double, T > v1, dlib::vector< double, T > v2)
 
template<int T>
static double geoDistance (dlib::vector< double, T > v1, dlib::vector< double, T > v2)
 
static CONDITION hashit (std::string const &inString)
 

Member Enumeration Documentation

◆ CONDITION

Enumerator
EQUAL 
GREATER 
LOWER 
GREATER_EQUAL 
LOWER_EQUAL 
UNDEFINED 

Member Function Documentation

◆ aglBetwVecInArcLen() [1/2]

template<int T>
static double adore::mad::ArrayMatrixTools::aglBetwVecInArcLen ( dlib::vector< double, T >  v1,
dlib::vector< double, T >  v2 
)
inlinestatic

◆ aglBetwVecInArcLen() [2/2]

static double adore::mad::ArrayMatrixTools::aglBetwVecInArcLen ( double *  v1,
double *  v2,
int  dim 
)
inlinestatic

◆ angle_norm()

static double adore::mad::ArrayMatrixTools::angle_norm ( double  x)
inlinestatic

normalize an angle [-2*pi , 2*pi]

Parameters
xis the input (angle)
returnis the normalized input
Here is the caller graph for this function:

◆ any()

template<typename T >
static bool adore::mad::ArrayMatrixTools::any ( T *  input,
int  inputSize,
const char *  condition,
double  ref 
)
inlinestatic

checks if any data from input elements match the defined condition (equal, bigger, etc. ) with reference

Parameters
returntrue if the condition is satisfied, else false
inputis the data vector
inputSizeis the size of input vector
conditionis the user condtion as char (E ==, L <, G >, LE <=, GE >= )
refis the reference value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ diff()

template<typename T >
static void adore::mad::ArrayMatrixTools::diff ( T *  output,
T *  input,
int  inputSize 
)
inlinestatic

computes difference between vector elements

Parameters
outputis vector of difference between input's elements
inputis vector
inputSizeis the size of vector
Here is the caller graph for this function:

◆ exponentialAverage()

template<typename T >
static double adore::mad::ArrayMatrixTools::exponentialAverage ( T *  input,
int  inputSize 
)
inlinestatic

returns the mean value of the exponential weigthed input

Parameters
inputis the input vector
inputSizeis the size of input
returnis mean value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exponentialMovingAverage()

template<typename T >
static double adore::mad::ArrayMatrixTools::exponentialMovingAverage ( T *  input,
int  inputSize,
double  newValue 
)
inlinestatic

returns the average value of the exponential weigthed input (greater weight and significance on the most recent input data)

Parameters
inputis the input vector
inputSizeis the size of input
newValueis most recent data
returnis mean value
Here is the call graph for this function:

◆ find() [1/3]

template<typename T >
static void adore::mad::ArrayMatrixTools::find ( int *  output,
int *  outputSize,
T *  input,
int  inputSize,
const char *  condition,
double  ref 
)
inlinestatic

finds and return the index of any data from input elements match the defined condition (equal, bigger, etc. ) with reference

Parameters
outputa vector that contains the index of the found elements
outputSizea the size of output vector
inputis the data vector
inputSizeis the data vector size
conditionis the user condtion as char ( E ==, L <, G >, LE <=, GE >= )
refis the reference value
Here is the call graph for this function:

◆ find() [2/3]

template<typename T >
static std::vector<int> adore::mad::ArrayMatrixTools::find ( std::vector< T > *  input,
const char *  condition,
double  ref 
)
inlinestatic

finds and return the index of any data from input elements match the defined condition (equal, bigger, etc. ) with reference

Parameters
returna vector
inputis the data vector
conditionis the user condtion as char ( EQUAL, GREATER, LOWER, GREATER_EQUAL, LOWER_EQUAL )
refis the reference value
Here is the call graph for this function:

◆ find() [3/3]

template<typename T >
static std::vector<int> adore::mad::ArrayMatrixTools::find ( T *  input,
int  inputSize,
const char *  condition,
double  ref 
)
inlinestatic

finds and return the index of any data from input elements match the defined condition (equal, bigger, etc. ) with reference

Parameters
returna vector
inputis the data vector
inputSizeis the data vector size
conditionis the user condtion as char ( EQUAL, GREATER, LOWER, GREATER_EQUAL, LOWER_EQUAL )
refis the reference value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ geoDistance()

template<int T>
static double adore::mad::ArrayMatrixTools::geoDistance ( dlib::vector< double, T >  v1,
dlib::vector< double, T >  v2 
)
inlinestatic

◆ hashit()

static CONDITION adore::mad::ArrayMatrixTools::hashit ( std::string const &  inString)
inlinestatic
Here is the caller graph for this function:

◆ isNaN()

static bool adore::mad::ArrayMatrixTools::isNaN ( double  x)
inlinestatic

checks if the input is not a number

Parameters
xis the input
returnis true if the input is not a number, else false

◆ matrixMultiplication()

static void adore::mad::ArrayMatrixTools::matrixMultiplication ( double *  output,
double *  input_1,
int  input_1_row,
int  input_1_column,
double *  input_2,
int  input_2_row,
int  input_2_column 
)
inlinestatic

multiplies matrices (defined as C array)

Parameters
outputis the result of multiplication matrix (C array)
input_1is input matrix (C array)
input_1_rowis input matrix number of row
input_1_columnis input matrix number of column
input_2is input matrix (C array)
input_2_rowis input matrix number of row
input_2_columnis input matrix number of column
Here is the caller graph for this function:

◆ mean()

template<typename T >
static double adore::mad::ArrayMatrixTools::mean ( T *  input,
int  inputSize 
)
inlinestatic

computes mean of a vector

Parameters
inputis vector
inputSizeis the size of vector
Returns
The mean value

◆ pieceOfArray()

template<typename T >
static void adore::mad::ArrayMatrixTools::pieceOfArray ( T *  output,
T *  input,
int  start,
int  end 
)
inlinestatic

returns the given piece of an array

Parameters
outputis a piece of input
inputis a vector
startis the index of the piece
endis the index of the piece
Here is the caller graph for this function:

◆ pointwise_multiply()

template<typename T >
static void adore::mad::ArrayMatrixTools::pointwise_multiply ( T *  output,
T *  input_1,
T *  input_2,
int  inputSize 
)
inlinestatic

Pointwise multiplication of two vectors with the same size

Parameters
outputthe result of pointwise multiplication
input_ais the first vector
input_bis the second vector
inputSizeis the size of input vectors
Here is the caller graph for this function:

◆ sign()

template<typename T >
static int adore::mad::ArrayMatrixTools::sign ( x)
inlinestatic

returns the sign of the input

Parameters
xis the input
returnis one if the input positive, else minus one

◆ sort()

template<typename T >
static void adore::mad::ArrayMatrixTools::sort ( T *  output,
int *  outputIndex,
T *  input,
int  inputSize 
)
inlinestatic

sorts the input data (ascending)

Parameters
outputsorted data
outputIndexis the index(location) of the sorted data before being sorted (input)
inputSizeis the size of input vector
Here is the caller graph for this function:

◆ sparseDiagonalMatrix()

template<typename T >
static void adore::mad::ArrayMatrixTools::sparseDiagonalMatrix ( T *  sparse,
T *  input,
int  output_row,
int  output_column,
int  inputSize,
int  StartingReference 
)
inlinestatic

returns a diagonal sparse matrix of input

Parameters
sparseis a the sparse matrix
inputis a vector
output_rowis the number of row of sparse matrix
output_columnis the number of column of sparse matrix
inputsizeis the size of input vector
Startingreferenceis the diagonal starting reference
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sum()

template<typename T >
static double adore::mad::ArrayMatrixTools::sum ( T *  input,
int  inputSize 
)
inlinestatic

computes sum of a vector

Parameters
inputis vector
inputSizeis the size of vector
Returns
The sum value
Here is the caller graph for this function:

◆ transpose()

template<typename T >
static void adore::mad::ArrayMatrixTools::transpose ( T *  output,
T *  input,
int  input_row,
int  input_column 
)
inlinestatic

returns the transpose of a matrix defined as C array

Parameters
outputis the transposed matrix (C array) [A11, A12, ..., A21, A22, ...]
inputmatrix (C array)
input_rowis the number of row
input_columnis the number of column
Here is the caller graph for this function:

◆ unwrap()

static double adore::mad::ArrayMatrixTools::unwrap ( double  prev,
double  now 
)
inlinestatic

returns an angle which its jump between consecutive angles is lessthan or equal to pi radians

Parameters
previs the input (previous angle)
nowis the input (current angle)
returnis the output
Here is the call graph for this function:

The documentation for this class was generated from the following file: