Matrex Functions Templates
sys.date.add
- adds a number (of days, hours, seconds...) to a date
- Input Matrices (Min: 2 Max: 2):
date DATE the matrix of dates to add the periods toperiod NUMERIC the periods to add- Output Matrices (Min: 1 Max: 1):
out DATE the output matrix- Parameters:
unit TEXT the unit of the period to add
Choices: [SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR]
sys.date.compose
- composes dates matrix from year, month, day, hour, minute, second matrices
- Input Matrices (Min: 3 Max: 6):
year NUMERIC the matrix containing the year valuesmonth NUMERIC the matrix containing the month valuesday NUMERIC the matrix containing the day valueshour NUMERIC the matrix containing the hour valuesminute NUMERIC the matrix containing the minute valuessecond NUMERIC the matrix containing the second values- Output Matrices (Min: 1 Max: 1):
out DATE the return matrix containing the calculated dates
sys.date.extract
- to extract a field value (year, month, ... second) from a date. Specify which field
you want to extract using the unit parameter - Input Matrices (Min: 1 Max: 1):
dates DATE the dates to extract the field from- Output Matrices (Min: 1 Max: 1):
out NUMERIC the value of the extracted field- Parameters:
unit TEXT the unit (year, month..., second) that you want to extract from the date
Choices: [SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR]
sys.date.fill
- Fills the output matrix with the now, today, tomorrow value or other
The size of the output matrix is the same is given as parameters
- Output Matrices (Min: 1 Max: 1):
out DATE the result matrix, containing the dates- Parameters:
type TEXT the type of value to fill the matrix with
Choices: [TODAY, NOW, YESTERDAY, TOMORROW]sizeX NUMERIC the width of the output matrixsizeY NUMERIC the height of the output matrix
sys.date.fillas
- Fills the output matrix with the now, today, tomorrow value or other
The size of the output matrix is the same as the one of the input matrix - Input Matrices (Min: 1 Max: 1):
givesSize ANY gives the size of the output matrix- Output Matrices (Min: 1 Max: 1):
out DATE the matrix to fill with dates- Parameters:
type TEXT the type of the value to fill the matrix with
Choices: [NOW, TODAY, YESTERDAY, TOMORROW]
sys.date.format
- formats a matrix of dates to a matrix of texts using the java.text.SimpleDateFormat formatter
- Input Matrices (Min: 1 Max: 1):
in DATE the dates to format- Output Matrices (Min: 1 Max: 1):
out TEXT the formatted dates- Parameters:
pattern TEXT Pattern for java.text.SimpleDateFormat
sys.date.frommilliseconds
- converts a matrix of milliseconds to a matrix of dates
- Input Matrices (Min: 1 Max: 1):
ms NUMERIC the milliseconds matrix- Output Matrices (Min: 1 Max: 1):
out DATE the dates matrix
sys.date.interval
- builds a date interval, i.e. a vector of dates from some parameters
- Output Matrices (Min: 1 Max: 1):
out DATE the interval vector- Parameters:
start DATE the first date of the arrayunit TEXT the unit for each step, (DAY, MONTH...)
Choices: [SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR]unitsNumber NUMERIC the number of units for each step.
You can have for example steps of 2 daysstepsNumber NUMERIC the number of steps, i.e. the number of elements of the final vector
sys.date.intervalas
- builds a date/time interval with the size of another matrix
- Input Matrices (Min: 1 Max: 1):
getSizeFrom ANY the matrix to make the interval the same size of- Output Matrices (Min: 1 Max: 1):
interval DATE the generated interval- Parameters:
start DATE the start of the interval (the first date of the array)unit TEXT The unit for each step (MONTH, DAY...)
Choices: [SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR]unitsNumber NUMERIC the number of units for each step.
You can have for example steps of 2 dayswhichSize TEXT which size of the input matrix (X or Y) to get as Y size of the array
Choices: [x, y]
sys.date.tomilliseconds
- transforms a matrix of dates to a matrix of the number of milliseconds from January 1, 1970 00:00:00 GMT (java.sql.Timestamp)
- Input Matrices (Min: 1 Max: 1):
in DATE the matrix of dates- Output Matrices (Min: 1 Max: 1):
out NUMERIC the milliseconds for the in dates
sys.db.query
- queries the database and transforms the result columns in matrices (arrays)
- Output Matrices (Min: 1 Max: 64):
column ANY a column in the result of the query- Parameters:
driver TEXT driver class nameurl TEXT database urluser TEXT database userpassword TEXT database passwordsql TEXT query sql
sys.generation.duplicate
- The output matrix is a copy of the input one. Changes in the input matrix are reflected in the output one.
Used for example to "rename" the matrix, when a function (isql?) requires specific names. - Input Matrices (Min: 1 Max: 1):
toCopy ANY The matrix to copy- Output Matrices (Min: 1 Max: 1):
copy ANY the copy of toCopy
sys.generation.fill
- fills the matrix with the same value in each cell
- Output Matrices (Min: 1 Max: 1):
result ANY the matrix filled with the value- Parameters:
sizeX NUMERIC the x size of the matrixsizeY NUMERIC The y size of the matrixvalue TEXT the value of the matrix (converted to the matrix type)
sys.generation.fillas
- fills the output matrix with the parameter value. The output matrix has the same size as the input matrix.
- Input Matrices (Min: 1 Max: 1):
input ANY the input matrix (only needed to calculate the size of the output matrix)- Output Matrices (Min: 1 Max: 1):
result ANY the matrix filled with the given value- Parameters:
value TEXT the value to fill the matrix with (as a string)
sys.generation.gen
- builds a matrix from a string.
The string passed as parameter must contain a CSV text of the form "a,b|c,d" where ',' is the columns separator and '|' is the line separator.
Used to get easy small matrices when working with the expression parser. - Output Matrices (Min: 1 Max: 1):
out ANY the output matrix containing the CSV text values.- Parameters:
csvtext TEXT the CSV text of the form "a,b|c,d"columnSeparator TEXT it is normally , but you can use something else.
Optional
Choices: [,, ;]lineSeparator TEXT separator of the lines in the CSV text. It none is given '|' is used.
Optional
Choices: [|, #, %]
sys.generation.interval
- Creates an interval array starting from start, with step step and size
- Output Matrices (Min: 1 Max: 1):
interval NUMERIC the vector that represents the interval- Parameters:
start NUMERIC the first number of the arraystep NUMERIC the step (the number to sum to go from one item of the array to the next)size NUMERIC the number of points in the interval
sys.generation.intervalas
- builds a numeric interval with the size of another matrix
- Input Matrices (Min: 1 Max: 1):
getSizeFrom ANY the matrix to make the interval the same size of- Output Matrices (Min: 1 Max: 1):
interval NUMERIC the generated interval- Parameters:
start NUMERIC the first item of the intervalstep NUMERIC the step of the interval (distance between two near items of the array)whichSize TEXT Get the X or Y size of the input matrix as Y size of the interval?
Choices: [x, y]
sys.generation.random
- creates N matrices filled with random values
- Output Matrices (Min: 1 Max: 1):
random NUMERIC a random matrix- Parameters:
sizeX NUMERIC the x size of the final matrixsizeY NUMERIC the y size of the final matrix
sys.generation.randomas
- generates a matrix with random values 0..1 of the same size of the input matrix
- Input Matrices (Min: 1 Max: 1):
in ANY the matrix that gives the size of the generated matrix- Output Matrices (Min: 1 Max: 1):
out NUMERIC the matrix filled with random numbers 0..1
sys.generation.tile
- tiles the output matrix with x * y copies of the input matrix
- Input Matrices (Min: 1 Max: 1):
in ANY the matrix to use to tile out- Output Matrices (Min: 1 Max: 1):
out ANY the matrix result of the tiling- Parameters:
x NUMERIC the number of times the input matrix is replicated in the x axisy NUMERIC the number of times the input matrix is replicated in the y axis
sys.generation.tileas
- tiles the output matrix with x * y copies of the input matrix, where x and y are the size of the "as" input matrix
- Input Matrices (Min: 2 Max: 2):
in ANY the matrix to use to tile outas ANY the matrix the size of will be the the x,y times the in matrix is tiled- Output Matrices (Min: 1 Max: 1):
out ANY the result of the tiling
sys.import.csv
- import CSV or SDV files
- Output Matrices (Min: 1 Max: 64):
field ANY a field in each line of the file- Parameters:
path TEXT the path of the filename to readseparator TEXT the character which divides the fields in a line (, or ;)
Choices: [,, ;]
sys.logical.and
- calculates the logical and of the two matrices element by element
- Input Matrices (Min: 2 Max: 2):
a BOOLEAN the first and operandb BOOLEAN The second and operand- Output Matrices (Min: 1 Max: 1):
out BOOLEAN the and result
sys.logical.if
- Calculates the if(condition, then, else) element by element of the matrices condition, then, else
- Input Matrices (Min: 3 Max: 3):
condition BOOLEAN the if conditionthen ANY the matrix containing the values to return if the condition is trueelse ANY the matrix containing the values to return if the condition is false- Output Matrices (Min: 1 Max: 1):
out ANY the if result
sys.logical.not
- returns the NOT of each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
in BOOLEAN input matrix- Output Matrices (Min: 1 Max: 1):
not BOOLEAN matrix containing the items of in, NOT-ed
sys.logical.or
- Calculates the logical or element by element of the two matrices
- Input Matrices (Min: 2 Max: 2):
a BOOLEAN the first or operandb BOOLEAN The second or operand- Output Matrices (Min: 1 Max: 1):
out BOOLEAN the or result
sys.mathstat.analysis.interpolator
- Evaluates a function created interpolating some points.
The interpolation can be done using one of 3 different alogorithms (spline, neville, divided difference). - Input Matrices (Min: 3 Max: 3):
pointsX NUMERIC the points to interpolate (x values)pointsY NUMERIC the points to interpolate (y values)evaluateX NUMERIC the functions built with the interpolation is evaluated with these values, producing the output.- Output Matrices (Min: 1 Max: 1):
out NUMERIC the output of the interpolated function evaluation- Parameters:
type TEXT The algorithm used to interpolate the points.
Choices: [SPLINE, NEVILLE, DIVIDED_DIFFERENCE]
sys.mathstat.by.arithmeticmeanby
- aggregates (in this case calculates the arithmetic mean) the 'values' matrices [2..64] by the keys found in the first column of the 'keys' matrix
- Input Matrices (Min: 2 Max: 64):
keys ANY the matrix containing in the first column the keys by which to aggregate the values of the other matrices.values NUMERIC the values to be aggregated by the keys in the keys matrix- Output Matrices (Min: 2 Max: 64):
keys ANY the key input matrix with the keys sorted and uniquevalues NUMERIC the values aggregated by the keys in the keys matrix
sys.mathstat.by.geometricmeanby
- aggregates (in this case calculates the geometric mean) the 'values' matrices [2..64] by the keys found in the first column of the 'keys' matrix
- Input Matrices (Min: 2 Max: 64):
keys ANY the matrix containing in the first column the keys by which to aggregate the values of the other matrices.values NUMERIC the values to be aggregated by the keys in the keys matrix- Output Matrices (Min: 2 Max: 64):
keys ANY the key input matrix with the keys sorted and uniquevalues NUMERIC the values aggregated by the keys in the keys matrix
sys.mathstat.by.maxby
- aggregates (in this case finds the max value) the 'values' matrices [2..64] by the keys found in the first column of the 'keys' matrix
- Input Matrices (Min: 2 Max: 64):
keys ANY the matrix containing in the first column the keys by which to aggregate the values of the other matrices.values NUMERIC the values to be aggregated by the keys in the keys matrix- Output Matrices (Min: 2 Max: 64):
keys ANY the key input matrix with the keys sorted and uniquevalues NUMERIC the values aggregated by the keys in the keys matrix
sys.mathstat.by.minby
- aggregates (in this case finds the minimum value) the 'values' matrices [2..64] by the keys found in the first column of the 'keys' matrix
- Input Matrices (Min: 2 Max: 64):
keys ANY the matrix containing in the first column the keys by which to aggregate the values of the other matrices.values NUMERIC the values to be aggregated by the keys in the keys matrix- Output Matrices (Min: 2 Max: 64):
keys ANY the key input matrix with the keys sorted and uniquevalues NUMERIC the values aggregated by the keys in the keys matrix
sys.mathstat.by.productby
- aggregates (in this case calculates the product) the 'values' matrices [2..64] by the keys found in the first column of the 'keys' matrix
- Input Matrices (Min: 2 Max: 64):
keys ANY the matrix containing in the first column the keys by which to aggregate the values of the other matrices.values NUMERIC the values to be aggregated by the keys in the keys matrix- Output Matrices (Min: 2 Max: 64):
keys ANY the key input matrix with the keys sorted and uniquevalues NUMERIC the values aggregated by the keys in the keys matrix
sys.mathstat.by.sumby
- aggregates (in this case sums) the 'values' matrices [2..64] by the keys found in the first column of the 'keys' matrix
- Input Matrices (Min: 2 Max: 64):
keys ANY the matrix containing in the first column the keys by which to aggregate the values of the other matrices.values NUMERIC the values to be aggregated by the keys in the keys matrix- Output Matrices (Min: 2 Max: 64):
keys ANY the key input matrix with the keys sorted and uniquevalues NUMERIC the values aggregated by the keys in the keys matrix
sys.mathstat.by.varianceby
- aggregates (in this case calculates the variance) the 'values' matrices [2..64] by the keys found in the first column of the 'keys' matrix
- Input Matrices (Min: 2 Max: 64):
keys ANY the matrix containing in the first column the keys by which to aggregate the values of the other matrices.values NUMERIC the values to be aggregated by the keys in the keys matrix- Output Matrices (Min: 2 Max: 64):
keys ANY the key input matrix with the keys sorted and uniquevalues NUMERIC the values aggregated by the keys in the keys matrix
sys.mathstat.distributions.binomial
- calculates the probability functions of the binomial distribution
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC the probability function matrix- Parameters:
type TEXT type of the density function calculated.
PDF - probability density function
CDF - cumulative density function
Choices: [PDF, CDF]trials NUMERIC the number of trialsprobabilityOfSuccess NUMERIC the probability of success
sys.mathstat.distributions.chisquared
- calculates the probability functions of a chi-squared distribution
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input- Output Matrices (Min: 1 Max: 1):
y NUMERIC the chi squared distribution probability function for each point of the input- Parameters:
type TEXT type of the density function calculated.
PDF - probability density function
CDF - cumulative density function
Choices: [PDF, CDF]degreesOfFreedom NUMERIC the degrees of freedom of the chi-squared distribution
sys.mathstat.distributions.exponential
- calculates the density functions of the exponential distribution
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input values- Output Matrices (Min: 1 Max: 1):
y NUMERIC the output values- Parameters:
type TEXT type of the density function calculated.
PDF - probability density function
CDF - cumulative density function
Choices: [PDF, CDF]mean NUMERIC the mean of the exponential distribution
sys.mathstat.distributions.hypergeometric
- calculates the probability functions of the hypergeometric distribution
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC the probability function of the hypergeometric distribution- Parameters:
type TEXT type of the density function calculated.
PDF - probability density function
CDF - cumulative density function
Choices: [PDF, CDF]populationSize NUMERIC the population sizenumberOfSuccesses NUMERIC the number of successes in the populationsampleSize NUMERIC the sample size
sys.mathstat.distributions.normal
- calculates the probability functions of the normal distribution
- Input Matrices (Min: 1 Max: 1):
input NUMERIC the points on the x axis for which the cumulative probability is calculated- Output Matrices (Min: 1 Max: 1):
cumulative_probability NUMERIC the cumulative probability- Parameters:
type TEXT type of the density function calculated.
PDF - probability density function
CDF - cumulative density function
Choices: [PDF, CDF]mean NUMERIC the mean parameterstandardDeviation NUMERIC the standard deviation
sys.mathstat.distributions.poisson
- calculates the density functions of the poisson distribution
- Input Matrices (Min: 1 Max: 1):
x NUMERIC input values of the function- Output Matrices (Min: 1 Max: 1):
y NUMERIC result of the function- Parameters:
type TEXT type of the density function calculated.
PDF - probability density function
CDF - cumulative density function
Choices: [PDF, CDF]mean NUMERIC the mean of the distribution
sys.mathstat.optimization.cost.powell
- calculates the powell cost function. Works for vectors that have size that is multiple of 4
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the vector to calculate the cost of. It must have size that is multiple of 4- Output Matrices (Min: 1 Max: 1):
cost NUMERIC the calculated cost
sys.mathstat.optimization.cost.rosenbrock
- Calculates the Rosenbrock cost function for direct search optimizations.
Rosenbrock is applied to vectors of size 2. - Input Matrices (Min: 1 Max: 1):
x NUMERIC the vector of size 2 to calculate the cost of- Output Matrices (Min: 1 Max: 1):
cost NUMERIC the calculated cost
sys.mathstat.optimization.neldermead
- Nelder-Mead direct search method.
- Input Matrices (Min: 3 Max: 3):
vertexA NUMERIC the initial vertexvertexB NUMERIC the final vertexcost NUMERIC the cost of the last evaluation of the solver, calculated by an external function- Output Matrices (Min: 2 Max: 2):
evaluation NUMERIC the last evaluation of the solver. It is the result of the optimization if terminated is truefinalValues NUMERIC The values to which the solver converged. This matrix has value only when the optimization has terminated- Parameters:
maxEvaluations NUMERIC the maximum number of evaluations (times the cost function is called)threshold NUMERIC when the difference of the cost of the last calculated vertices is less than this threshold, the algorithm has converged.rho NUMERIC
Optionalkhi NUMERIC
Optionalgamma NUMERIC
Optionalsigma NUMERIC
Optional
sys.mathstat.transform.fct
- Calculates the Fast Cosine Transformation (FCT) for transformation of one-dimensional data sets.
Uses the FCT implementation in the Apache Common-Math library.
For reference: http://documents.wolfram.com/v5/Add-onsLinks/StandardPackages/LinearAlgebra/FourierTrig.html
Input and output are real numbers vectors. - Input Matrices (Min: 1 Max: 1):
in NUMERIC The input vector. The number of elements must be power of 2 + 1 (e.g. 3, 5, 9,...)- Output Matrices (Min: 1 Max: 1):
out NUMERIC the output vector- Parameters:
type TEXT TRANSFORM: F_n = (1/2) [f_0 + (-1)^n f_N] + \Sigma_{k=0}^{N-1} f_k \cos(\pi nk/N)
TRANSFORM2: F_n = \sqrt{1/2N} [f_0 + (-1)^n f_N] + \sqrt{2/N} \Sigma_{k=0}^{N-1} f_k \cos(\pi nk/N)
INVERSE: f_k = (1/N) [F_0 + (-1)^k F_N] + (2/N) \Sigma_{n=0}^{N-1} F_n \cos(\pi nk/N)
INVERSE2: f_k = \sqrt{1/2N} [F_0 + (-1)^k F_N] + \sqrt{2/N} \Sigma_{n=0}^{N-1} F_n \cos(\pi nk/N)
Choices: [TRANSFORM, TRANSFORM2, INVERSE, INVERSE2]
sys.mathstat.transform.fft
- Calculates the Fast Fourier Transformation (FFT) for transformation of one-dimensional data sets.
Uses the FFT implementation in the Apache Common-Math library.
For reference: http://mathworld.wolfram.com/FastFourierTransform.html
The input can be either a real vector or a complex vector (broken in a real and an imaginary vectors).
The output is always a complex vector (broken in a real and an imaginary vectors).
- Input Matrices (Min: 1 Max: 2):
inReal NUMERIC The real array (length must be power of 2) to be transformedinImaginary NUMERIC The imaginary array (length must be power of 2) to be transformed. It is optional, meaning that the input can be real.- Output Matrices (Min: 2 Max: 2):
outReal NUMERIC The output is always a complex number. This is the real part.outImaginary NUMERIC The output is always a complex number. This is the imaginary part.- Parameters:
type TEXT TRANSFORM: y_n = \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k
TRANSFORM2: y_n = (1/\sqrt{N}) \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k
Choices: [TRANSFORM, TRANSFORM2, INVERSE, INVERSE2]
sys.mathstat.transform.fst
- Calculates the Fast Sine Transformation (FST) for transformation of one-dimensional data sets.
Uses the FST implementation in the Apache Common-Math library.
For reference: http://documents.wolfram.com/v5/Add-onsLinks/StandardPackages/LinearAlgebra/FourierTrig.html
Input and output are real numbers vectors. - Input Matrices (Min: 1 Max: 1):
in NUMERIC the input vector. Must have a number of elements that is power of 2- Output Matrices (Min: 1 Max: 1):
out NUMERIC the output vector- Parameters:
type TEXT TRANSFORM: F_n = \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N)
TRANSFORM2: F_n = \sqrt{2/N} \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N)
INVERSE: f_k = (2/N) \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N)
INVERSE2: f_k = \sqrt{2/N} \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N)
Choices: [TRANSFORM, TRANSFORM2, INVERSE, INVERSE2]
sys.mathstat.arithmeticmean
- Calculates the arithmetic means of the columns of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC an array which contains the arithmetic mean of each column of the matrix x
sys.mathstat.geometricmean
- calculates the geometric means of the columns of the input matrix
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
mean NUMERIC the vector of geometric means
sys.mathstat.iterativesum
- sums iteratively all the items of the input matrix by column
So, if you have the vector [1,2,3] as input, the output will be [1,3,6] - Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC a matrix every item of which is the sum of the same item and the previous items of the x matrix, by column
sys.mathstat.max
- Calculates the maximum element of each column of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC an array containing the maximums of the items of each column of the x matrix
sys.mathstat.min
- Calculates the minimum element of each column of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC an array containing the minimums of the item of each column of the x matrix
sys.mathstat.product
- Calculates the product of all numbers in each column of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC an array that contains the product of the item of each column of x
sys.mathstat.sum
- sum the values in the columns of the matrix
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
sum NUMERIC a vector which is the sum of the columns of the matrix
sys.mathstat.variance
- calculates the variance of each column of the matrix
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
variance NUMERIC a vector containing the variances of the columns of the matrix
sys.matrix.determinant
- the matrix determinant
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
determinant NUMERIC calculates the matrix determinant
sys.matrix.identity
- builds an identity matrix of the given size
- Input Matrices (Min: 1 Max: 1):
size NUMERIC size of the identity matrix (must be 1x1)- Output Matrices (Min: 1 Max: 1):
identity NUMERIC the identity matrix
sys.matrix.identityas
- builds an indentity matrix (1 in the diagonal, 0 everywhere else) using the size of the original matrix
- Input Matrices (Min: 1 Max: 1):
size ANY The matrix that has the same x or y size of the output identity matrix- Output Matrices (Min: 1 Max: 1):
identity NUMERIC The identity matrix- Parameters:
which TEXT Use the size of the x or y axis of the original matrix as size of the identity matrix?
Choices: [x, y]
sys.matrix.inverse
- calculates the matrix inverse
- Input Matrices (Min: 1 Max: 1):
toInvert NUMERIC the matrix to invert- Output Matrices (Min: 1 Max: 1):
inverted NUMERIC the result of the inversion
sys.matrix.norm
- the maximum absolute row sum norm of the matrix
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
norm NUMERIC the matrix norm
sys.matrix.qrdecomposition
- Calculates the QR-decomposition of a matrix. In the QR-decomposition of a matrix A consists of two matrices Q and R that satisfy: A = QR, Q is orthogonal (QTQ = I), and R is upper triangular.
Uses the common-math library
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the matrix to decompose- Output Matrices (Min: 2 Max: 2):
q NUMERIC the q matrixr NUMERIC the r matrix
sys.matrix.solve
- Returns a matrix of (column) solution vectors for linear systems.
- Input Matrices (Min: 2 Max: 2):
coefficient NUMERIC coefficient matrixconstant NUMERIC constant vectors- Output Matrices (Min: 1 Max: 1):
solution NUMERIC the result of the solve method
sys.matrix.times
- matrix multiplication
- Input Matrices (Min: 2 Max: 2):
mat1 NUMERIC matrix to multiplymat2 NUMERIC matrix to multiply- Output Matrices (Min: 1 Max: 1):
result NUMERIC multiplication result
sys.matrix.transpose
- Transposes the input numerical matrix
- Input Matrices (Min: 1 Max: 1):
totranspose NUMERIC the matrix to transpose- Output Matrices (Min: 1 Max: 1):
transposed NUMERIC the transposed matrix
sys.sql.isql
- SQL select in memory, that works on matrices 1xN (vectorial matrices). Use SQL to filter, sort, group values on matrices. Matrices are grouped in tables (equivalent to database tables), of which they become columns. More in the "internalsql.pdf" document. Example:
select price.ticker as ticker, sum(price.fix) as sumfix from [ticker, fix] as price group by price.ticker - Input Matrices (Min: 0 Max: 64):
input ANY input vectorial matrix that becomes a column of a table in the query- Output Matrices (Min: 0 Max: 64):
output ANY The output matrices (as... in the select clause)- Parameters:
sql TEXT the sql select query
sys.standard.trigonometric.acos
- calculates the acos function for each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC acos(x)
sys.standard.trigonometric.asin
- calculates the asin function for each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC asin(x)
sys.standard.trigonometric.atan
- calculates the atan function for each item of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC atan(x)
sys.standard.trigonometric.cos
- calculates the cos function for each item of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the matrix to get the cosinus of- Output Matrices (Min: 1 Max: 1):
cosinus NUMERIC the cosinus of x
sys.standard.trigonometric.cosh
- calculates the cosh function for each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC cosh(x)
sys.standard.trigonometric.sin
- calculates the sin function for each item of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the matrix to get the sinus of- Output Matrices (Min: 1 Max: 1):
sinus NUMERIC the sinus of x
sys.standard.trigonometric.sinh
- calculates the sinh function for each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC sinh(x)
sys.standard.trigonometric.tan
- calculates the tangent function for each item of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the matrix to get the tangent of- Output Matrices (Min: 1 Max: 1):
tangent NUMERIC the tangent of x
sys.standard.trigonometric.tanh
- calculates the tanh function for each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC tanh(x)
sys.standard.abs
- abs(x) absolute value of each element of the matrix
- Input Matrices (Min: 1 Max: 1):
toabs NUMERIC the matrix to get the absolute value of- Output Matrices (Min: 1 Max: 1):
result NUMERIC the absolute value of the matrix
sys.standard.binarybyblock
- Given the matrix 'byBlocks', which has width and/or height that is multiple than the matrix 'whole',
applies a function (plus, minus...) to to each block of 'byBlock' that has the same size as 'whole'
E.g.
byBlock a b c d whole A B Result a+A b+B c+A d+B
e f g h C D e+C e+D g+C h+D
i j k l i+A j+B k+A l+B
m n o p m+C n+D o+C p+D - Input Matrices (Min: 2 Max: 2):
byBlock NUMERIC to divide in blocks of the same size as 'whole'whole NUMERIC to consider as it is- Output Matrices (Min: 1 Max: 1):
result NUMERIC same size as byBlock- Parameters:
type TEXT the binary function to apply to each cell of the block and the matrix
Choices: [plus, minus, times, divide, pow]order TEXT matrix x is divided by blocks, x is consider as it is. The order of the parameters for functions like 'minus' and 'divide' is then important.
Choices: [f(x,y), f(y,x)]
sys.standard.ceil
- calculates the ceil (the smallest integer number > x) function for each element of the input matrix.
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC ceil(x)
sys.standard.degrees
- convert each element of the input matrix from radians to degrees
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the matrix of radians to convert- Output Matrices (Min: 1 Max: 1):
out NUMERIC the degrees of each element of the input matrix
sys.standard.div
- integer division, element by element
- Input Matrices (Min: 2 Max: 2):
a NUMERIC to divideb NUMERIC to divide for- Output Matrices (Min: 1 Max: 1):
out NUMERIC division result
sys.standard.divide
- divides the matrix 'what' by the matrix 'by' element by element
- Input Matrices (Min: 2 Max: 2):
what NUMERIC the matrix to divideby NUMERIC the matrix to divide by- Output Matrices (Min: 1 Max: 1):
result NUMERIC the division result
sys.standard.equal
- for each cell of the two input matrices (which need to have the same size) tells if the value is equal.
- Input Matrices (Min: 2 Max: 2):
a NUMERIC matrix to compareb NUMERIC matrix to compare- Output Matrices (Min: 1 Max: 1):
isequal BOOLEAN contains a boolean value for each pair of values , which tells if the two values are equal
sys.standard.exp
- calculates the exponential function for each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
toexp NUMERIC the number to get the exponential of- Output Matrices (Min: 1 Max: 1):
result NUMERIC the result of the exponential
sys.standard.factorial
- Calculates the factorial (n!) of the input matrix. The input values will be truncated to integers.
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
fact NUMERIC the factorial for each input value
sys.standard.floor
- calculates the floor function (the greatest integer number < x) for each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC floor(x)
sys.standard.less
- verifies a < b element by element
- Input Matrices (Min: 2 Max: 2):
a NUMERIC the first matrix to compareb NUMERIC the second matrix to compare- Output Matrices (Min: 1 Max: 1):
result BOOLEAN true if a < b
sys.standard.lesseq
- verifies a <= b element by element
- Input Matrices (Min: 2 Max: 2):
a NUMERIC the first matrix to compareb NUMERIC the second matrix to compare- Output Matrices (Min: 1 Max: 1):
result BOOLEAN true if a <= b
sys.standard.log
- calculates the logarithm for each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
tolog NUMERIC the number to get the logarithm of- Output Matrices (Min: 1 Max: 1):
result NUMERIC the logarithm
sys.standard.minus
- subtracts the two matrices element by element
- Input Matrices (Min: 2 Max: 2):
difffrom NUMERIC the number to remove fromdiffwhat NUMERIC the number to remove- Output Matrices (Min: 1 Max: 1):
result NUMERIC the difference
sys.standard.minus1
- calculates the opposite of each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
original NUMERIC original matrix- Output Matrices (Min: 1 Max: 1):
minus NUMERIC opposite of the original
sys.standard.mod
- integer module: a mod b, a % b element by element
- Input Matrices (Min: 2 Max: 2):
a NUMERIC to modb NUMERIC to mod with- Output Matrices (Min: 1 Max: 1):
out NUMERIC the result of the module operation
sys.standard.more
- verifies a > b element by element
- Input Matrices (Min: 2 Max: 2):
a NUMERIC the first matrix to compareb NUMERIC the second matrix to compare- Output Matrices (Min: 1 Max: 1):
result BOOLEAN true if > b is true
sys.standard.moreeq
- verifies a >= b element by element
- Input Matrices (Min: 2 Max: 2):
a NUMERIC the first matrix to compareb NUMERIC the second matrix to compare- Output Matrices (Min: 1 Max: 1):
result BOOLEAN true if a >= b
sys.standard.plus
- sums the two matrices element by element (must be the same size)
- Input Matrices (Min: 2 Max: 2):
addendum1 NUMERIC the first sum addendumaddendum2 NUMERIC the second sum addendum- Output Matrices (Min: 1 Max: 1):
result NUMERIC the sum result
sys.standard.pow
- pow(x, y) power of by y
- Input Matrices (Min: 2 Max: 2):
x NUMERIC the matrix to get the power ofy NUMERIC the matrix to use as power- Output Matrices (Min: 1 Max: 1):
result NUMERIC the result matrix
sys.standard.radians
- converts each element of the input matrix from degrees to radians
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the matrix of numbers expressed as degrees- Output Matrices (Min: 1 Max: 1):
out NUMERIC the matrix of numbers converted to radians
sys.standard.round
- calculates the round function for each element of the input matrix.
- Input Matrices (Min: 1 Max: 1):
x NUMERIC the input matrix- Output Matrices (Min: 1 Max: 1):
y NUMERIC round(x)
sys.standard.sign
- for each element in the matrix, give -1 for a negative number, 1 for positive, 0 for 0.
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the matrix to calculate the signum of- Output Matrices (Min: 1 Max: 1):
out NUMERIC the signum of the input matrix
sys.standard.sqrt
- calculates the square root of each element of the input matrix
- Input Matrices (Min: 1 Max: 1):
input NUMERIC to get the square root of- Output Matrices (Min: 1 Max: 1):
result NUMERIC the square root
sys.standard.times
- multiplies the matrices element by element
- Input Matrices (Min: 2 Max: 2):
mat1 NUMERIC the first matrix to multiplymat2 NUMERIC the second matrix to multiply- Output Matrices (Min: 1 Max: 1):
result NUMERIC the multiplication result
sys.standard.trunc
- truncates each number in the matrix to its closest integer value
- Input Matrices (Min: 1 Max: 1):
in NUMERIC the (real) numbers to truncate- Output Matrices (Min: 1 Max: 1):
out NUMERIC the integer values result of the truncation
sys.string.cat
- concatenates the texts of two or more matrices element by element
- Input Matrices (Min: 1 Max: 64):
text TEXT the text to concatenate- Output Matrices (Min: 1 Max: 1):
result TEXT the concatenation result
sys.string.compare
- Compare the strings of two matrices lexicographically, element by element. (See the java function compareTo)
- Input Matrices (Min: 2 Max: 2):
a TEXT the first matrix with the texts to compareb TEXT the second matrix with the texts to compare- Output Matrices (Min: 1 Max: 1):
out NUMERIC the comparison result
sys.string.equals
- tells if the strings in the two matrices are the same element by element
- Input Matrices (Min: 2 Max: 2):
a TEXT the first matrix to compareb TEXT the second matrix to compare- Output Matrices (Min: 1 Max: 1):
out BOOLEAN each element is true if the related elements in a and b are equal
sys.string.lowercase
- convert all the strings of the input matrix to lowercase
- Input Matrices (Min: 1 Max: 1):
in TEXT the matrix to convert to lowercase- Output Matrices (Min: 1 Max: 1):
out TEXT the lowercase matrix
sys.string.substring
- for each string in the matrix, calculates its substring using the String.substring function in java.
String.substring(begin) if the end parameter is not given
String.substring(begin,end) otherwise
The calculation terminates with an error and does not give a result if the parameters are out of the bounds of the original string. - Input Matrices (Min: 1 Max: 1):
in TEXT the input matrix containing the strings to substring- Output Matrices (Min: 1 Max: 1):
out TEXT the result of the substring operation- Parameters:
begin NUMERIC the start of the substring (0-based)end NUMERIC the end of the substring, excluded (0-based). If not entered, the whole string is considered
Optional
sys.string.substringby
- for each string in the "in" matrix, calculates its substring using the String.substring function in java.
It used the "begin" and optionally the "end" matrices to determine which part of the string to extract.
If "end" is not set, the substring contains all the characters of the original string starting from the index defined in "begin".
The calculation terminates with an error and does not give a result if the indices are out of the bounds of the original string. - Input Matrices (Min: 2 Max: 3):
in TEXT Contains the strings to extract the substrings frombegin NUMERIC for each string in the "in" matrix, contains the zero-based index, in the string, of the first character of the extracted substringend NUMERIC for each string in the "in" matrix, contains the zero-based index, in the string, of the first character not in extracted substring (last + 1)- Output Matrices (Min: 1 Max: 1):
out TEXT for each string in the "in" matrix, contains the substing extracted from it
sys.string.trim
- trims all the strings in the input matrix string by string
- Input Matrices (Min: 1 Max: 1):
in TEXT the matrix with the strings to trim- Output Matrices (Min: 1 Max: 1):
out TEXT trimmed strings
sys.string.uppercase
- convert all the strings in the input matrix to uppercase
- Input Matrices (Min: 1 Max: 1):
in TEXT the matrix to uppercase- Output Matrices (Min: 1 Max: 1):
out TEXT the uppercased matrix
sys.util.at
- to get the values in matrixItem that have coordinates x,y, where x and y are in the matrices matrixX and matrixY. If matrixX is not given, then 0 is assumed as x coordinate, which works fine for vectors
- Input Matrices (Min: 2 Max: 3):
items ANY the matrix containing the items to copy to the output matrixy NUMERIC the y coordinatesx NUMERIC the x coordinate- Output Matrices (Min: 1 Max: 1):
out ANY the output matrix containing the values items(x,y)
sys.util.fromstring
- transforms a string matrix to the result matrix (with a fixed type)
- Input Matrices (Min: 1 Max: 1):
stringmatrix TEXT the matrix containing strings- Output Matrices (Min: 1 Max: 1):
typedmatrix ANY the converted matrix (decides the type)
sys.util.hbreak
- breaks the matrix in smaller matrices horizontally. It produces matrices made with the columns of the original one.
- Input Matrices (Min: 2 Max: 3):
toBreak ANY the matrix to breakstartX NUMERIC the array of columns where the small matrices startwidth NUMERIC the array of sizes of the small matrices. If not given an array of 1 is assumed.- Output Matrices (Min: 1 Max: 64):
result ANY the matrix resulted from the breaking
sys.util.hglue
- merges two or more matrices with the same horizontal size in one big matrix. The columns of the input matrices become the columns of the final matrix.
- Input Matrices (Min: 1 Max: 64):
toglue ANY matrix to glue- Output Matrices (Min: 1 Max: 1):
glued ANY the final matrix
sys.util.lookup
- finds the matrix 'what' items in the matrix 'where', and returns two position matrices, x and y
- Input Matrices (Min: 2 Max: 2):
where ANY matrix where to find the itemswhat ANY matrix containing the items to find- Output Matrices (Min: 2 Max: 2):
x NUMERIC the x cohordinates of the positionsy NUMERIC the y cohordinates of the positions
sys.util.queue
- adds the matrix "toAdd" at the end of the matrix "queue".
- Input Matrices (Min: 1 Max: 1):
toAdd ANY the matrix to attach to the end of the "queue" matrix- Output Matrices (Min: 1 Max: 1):
queue ANY the matrix that is expanded with the matrix "toAdd"- Parameters:
side TEXT the side of the "queue" matrix to attach the "toAdd" matrix to
Choices: [BOTTOM, RIGHT, TOP, LEFT]
sys.util.size
- Returns the size of a set of matrices as an sizeX vector and an sizeY vector
- Input Matrices (Min: 1 Max: 64):
in ANY the matrix to get the size of- Output Matrices (Min: 2 Max: 2):
sizeX NUMERIC the x size of each matrix as a vectorsizeY NUMERIC the x size of each matrix as a vector
sys.util.sort
- sorts all the input matrices by the first column of the first matrix
- Input Matrices (Min: 1 Max: 64):
matrixKey ANY The matrix whose first column is used as key to sort all the input matrices. matrixValue ANY matrix that is sorted by the first column of matrixKey- Output Matrices (Min: 1 Max: 64):
sortedKey ANY the key matrix sortedsortedValue ANY the matrix resulted by the sort of the matrix with the same index in the input
sys.util.tostring
- converts a typed matrix into a string matrix
- Input Matrices (Min: 1 Max: 1):
typedmatrix ANY the matrix to convert- Output Matrices (Min: 1 Max: 1):
stringmatrix TEXT the final matrix with all text elements
sys.util.transpose
- transposes a matrix of any type
- Input Matrices (Min: 1 Max: 1):
totranspose ANY the matrix to transpose- Output Matrices (Min: 1 Max: 1):
transposed ANY the input matrix transposed
sys.util.vbreak
- breaks the matrix in smaller matrices vertically. It produces matrices made with the rows of the original one.
- Input Matrices (Min: 2 Max: 3):
toBreak ANY the matrix to breakstartY NUMERIC the array of the positions in which the small matrices startheight NUMERIC the array of the heights of the small matrices. If not given an array of 1 is assumed.- Output Matrices (Min: 1 Max: 64):
result ANY the result of the breaking
sys.util.vglue
- merges together matrices with the same width to a big matrix. The rows of the input matrices become the rows of the final matrix.
- Input Matrices (Min: 1 Max: 64):
toglue ANY the matrix to merge- Output Matrices (Min: 1 Max: 1):
glued ANY the merged matrix