Zephyr Scientific Library (zscilib)
Typedefs | Enumerations
Operands

Unary and binary operands that can be performed on matrix coefficients. More...

Typedefs

typedef enum zsl_mtx_unary_op zsl_mtx_unary_op_t
 Component-wise unary operations. More...
 
typedef enum zsl_mtx_binary_op zsl_mtx_binary_op_t
 Component-wise binary operations. More...
 

Enumerations

enum  zsl_mtx_unary_op {
  ZSL_MTX_UNARY_OP_INCREMENT,
  ZSL_MTX_UNARY_OP_DECREMENT,
  ZSL_MTX_UNARY_OP_NEGATIVE,
  ZSL_MTX_UNARY_OP_ROUND,
  ZSL_MTX_UNARY_OP_ABS,
  ZSL_MTX_UNARY_OP_FLOOR,
  ZSL_MTX_UNARY_OP_CEIL,
  ZSL_MTX_UNARY_OP_EXP,
  ZSL_MTX_UNARY_OP_LOG,
  ZSL_MTX_UNARY_OP_LOG10,
  ZSL_MTX_UNARY_OP_SQRT,
  ZSL_MTX_UNARY_OP_SIN,
  ZSL_MTX_UNARY_OP_COS,
  ZSL_MTX_UNARY_OP_TAN,
  ZSL_MTX_UNARY_OP_ASIN,
  ZSL_MTX_UNARY_OP_ACOS,
  ZSL_MTX_UNARY_OP_ATAN,
  ZSL_MTX_UNARY_OP_SINH,
  ZSL_MTX_UNARY_OP_COSH,
  ZSL_MTX_UNARY_OP_TANH
}
 Component-wise unary operations. More...
 
enum  zsl_mtx_binary_op {
  ZSL_MTX_BINARY_OP_ADD,
  ZSL_MTX_BINARY_OP_SUB,
  ZSL_MTX_BINARY_OP_MULT,
  ZSL_MTX_BINARY_OP_DIV,
  ZSL_MTX_BINARY_OP_MEAN,
  ZSL_MTX_BINARY_OP_EXPON,
  ZSL_MTX_BINARY_OP_MIN,
  ZSL_MTX_BINARY_OP_MAX,
  ZSL_MTX_BINARY_OP_EQUAL,
  ZSL_MTX_BINARY_OP_NEQUAL,
  ZSL_MTX_BINARY_OP_LESS,
  ZSL_MTX_BINARY_OP_GREAT,
  ZSL_MTX_BINARY_OP_LEQ,
  ZSL_MTX_BINARY_OP_GEQ
}
 Component-wise binary operations. More...
 
int zsl_mtx_unary_op (struct zsl_mtx *m, zsl_mtx_unary_op_t op)
 Applies a unary operand on every coefficient in matrix 'm'. More...
 
int zsl_mtx_unary_func (struct zsl_mtx *m, zsl_mtx_unary_fn_t fn)
 Applies a unary function on every coefficient in matrix 'm', using the specified 'zsl_mtx_apply_unary_fn_t' instance. More...
 
int zsl_mtx_binary_op (struct zsl_mtx *ma, struct zsl_mtx *mb, struct zsl_mtx *mc, zsl_mtx_binary_op_t op)
 Applies a component-wise binary operation on every coefficient in symmetrical matrices 'ma' and 'mb', with the results being stored in the identically shaped mc matrix. More...
 
int zsl_mtx_binary_func (struct zsl_mtx *ma, struct zsl_mtx *mb, struct zsl_mtx *mc, zsl_mtx_binary_fn_t fn)
 Applies a component-wise binary operztion on every coefficient in symmetrical matrices 'ma' and 'mb', with the results being stored in the identically shaped 'mc' matrix. The actual binary operation is executed using the specified 'zsl_mtx_binary_fn_t' callback. More...
 

Detailed Description

Unary and binary operands that can be performed on matrix coefficients.

Typedef Documentation

◆ zsl_mtx_binary_op_t

Component-wise binary operations.

◆ zsl_mtx_unary_op_t

Component-wise unary operations.

Enumeration Type Documentation

◆ zsl_mtx_binary_op

Component-wise binary operations.

Enumerator
ZSL_MTX_BINARY_OP_ADD 

a + b

ZSL_MTX_BINARY_OP_SUB 

a - b

ZSL_MTX_BINARY_OP_MULT 

a * b

ZSL_MTX_BINARY_OP_DIV 

a / b

ZSL_MTX_BINARY_OP_MEAN 

mean(a, b)

ZSL_MTX_BINARY_OP_EXPON 

a ^ b

ZSL_MTX_BINARY_OP_MIN 

min(a, b)

ZSL_MTX_BINARY_OP_MAX 

max(a, b)

ZSL_MTX_BINARY_OP_EQUAL 

a == b

ZSL_MTX_BINARY_OP_NEQUAL 

a != b

ZSL_MTX_BINARY_OP_LESS 

a < b

ZSL_MTX_BINARY_OP_GREAT 

a > b

ZSL_MTX_BINARY_OP_LEQ 

a <= b

ZSL_MTX_BINARY_OP_GEQ 

a >= b

Definition at line 105 of file matrices.h.

◆ zsl_mtx_unary_op

Component-wise unary operations.

Enumerator
ZSL_MTX_UNARY_OP_INCREMENT 

++

ZSL_MTX_UNARY_OP_DECREMENT 

ZSL_MTX_UNARY_OP_NEGATIVE 
ZSL_MTX_UNARY_OP_ROUND 
ZSL_MTX_UNARY_OP_ABS 
ZSL_MTX_UNARY_OP_FLOOR 
ZSL_MTX_UNARY_OP_CEIL 
ZSL_MTX_UNARY_OP_EXP 
ZSL_MTX_UNARY_OP_LOG 
ZSL_MTX_UNARY_OP_LOG10 
ZSL_MTX_UNARY_OP_SQRT 
ZSL_MTX_UNARY_OP_SIN 
ZSL_MTX_UNARY_OP_COS 
ZSL_MTX_UNARY_OP_TAN 
ZSL_MTX_UNARY_OP_ASIN 
ZSL_MTX_UNARY_OP_ACOS 
ZSL_MTX_UNARY_OP_ATAN 
ZSL_MTX_UNARY_OP_SINH 
ZSL_MTX_UNARY_OP_COSH 
ZSL_MTX_UNARY_OP_TANH 

Definition at line 81 of file matrices.h.

Function Documentation

◆ zsl_mtx_binary_func()

int zsl_mtx_binary_func ( struct zsl_mtx ma,
struct zsl_mtx mb,
struct zsl_mtx mc,
zsl_mtx_binary_fn_t  fn 
)

Applies a component-wise binary operztion on every coefficient in symmetrical matrices 'ma' and 'mb', with the results being stored in the identically shaped 'mc' matrix. The actual binary operation is executed using the specified 'zsl_mtx_binary_fn_t' callback.

Parameters
maPointer to first zsl_mtx to use in the binary operation.
mbPointer to second zsl_mtx to use in the binary operation.
mcPointer to output zsl_mtx used to store results.
fnThe zsl_mtx_binary_fn_t instance to call.
Returns
0 on success, and non-zero error code on failure

Definition at line 347 of file matrices.c.

◆ zsl_mtx_binary_op()

int zsl_mtx_binary_op ( struct zsl_mtx ma,
struct zsl_mtx mb,
struct zsl_mtx mc,
zsl_mtx_binary_op_t  op 
)

Applies a component-wise binary operation on every coefficient in symmetrical matrices 'ma' and 'mb', with the results being stored in the identically shaped mc matrix.

Parameters
maPointer to first zsl_mtx to use in the binary operation.
mbPointer to second zsl_mtx to use in the binary operation.
mcPointer to output zsl_mtx used to store results.
opThe binary operation to apply to each coefficient.
Returns
0 on success, and non-zero error code on failure

Definition at line 286 of file matrices.c.

Referenced by zsl_mtx_add(), zsl_mtx_add_d(), zsl_mtx_sub(), and zsl_mtx_sub_d().

◆ zsl_mtx_unary_func()

int zsl_mtx_unary_func ( struct zsl_mtx m,
zsl_mtx_unary_fn_t  fn 
)

Applies a unary function on every coefficient in matrix 'm', using the specified 'zsl_mtx_apply_unary_fn_t' instance.

Parameters
mPointer to the zsl_mtx to use.
fnThe zsl_mtx_unary_fn_t instance to call.
Returns
0 on success, and non-zero error code on failure

Definition at line 266 of file matrices.c.

◆ zsl_mtx_unary_op()

int zsl_mtx_unary_op ( struct zsl_mtx m,
zsl_mtx_unary_op_t  op 
)

Applies a unary operand on every coefficient in matrix 'm'.

Parameters
mPointer to the zsl_mtx to use.
opThe unary operation to apply to each coefficient.
Returns
0 on success, and non-zero error code on failure

Definition at line 191 of file matrices.c.