vector_ops.h

Methods that treat the matrix as a vector, including things like finding minimum or maximum values, norms, sums, etc.

Author

Brian Jackson (bjack205@gmail.com)

Date

2022-01-30

Copyright

Copyright (c) 2022

Functions

MatrixIterator slap_ArgMax(Matrix mat, sfloat *max_value)

Find the maximum value in the matrix.

Header File: slap/vector_ops.h

Parameters:
  • mat[in] A valid matrix

  • max_value[out]

Returns:

A MatrixIterator pointing to the max value

MatrixIterator slap_ArgMin(Matrix mat, sfloat *min_value)

Find the minimum value in the matrix.

Header File: slap/vector_ops.h

Parameters:
  • mat[in]

  • min_value[out]

Returns:

A MatrixIterator pointing to the min value

sfloat slap_Max(Matrix mat)

Find the maximum value in the matrix.

Header File: slap/vector_ops.h

Parameters:

mat – A valid Matrix

Returns:

The maximum value, or NaN if there was an error

sfloat slap_Min(Matrix mat)

Find the minimum value in the matrix.

Header File: slap/vector_ops.h

Parameters:

mat – A valid Matrix

Returns:

The minimum value, or NaN if there was an error

sfloat slap_NormTwoSquared(Matrix mat)

Calculate the squared 2-norm of the matrix (treating it like a vector)

Header File: slap/vector_ops.h

Parameters:

mat – A valid Matrix

Returns:

The two norm squared, or NaN if there was an error

sfloat slap_NormTwo(Matrix mat)

Calculate the 2-norm, treating the matrix as a vector.

Header File: slap/vector_ops.h

Parameters:

mat – A valid matrix

Returns:

The two-norm, or NaN if there was an error

sfloat slap_NormInf(Matrix mat)

Calculate the infinity norm, treating the matrix as a vector.

Header File: slap/vector_ops.h

Parameters:

mat – A valid matrix

Returns:

The infinity norm, or NaN if there was an error

sfloat slap_NormOne(Matrix mat)

Calculate the one norm, treating the matrix as a vector.

Header File: slap/vector_ops.h

Parameters:

mat – A valid matrix

Returns:

The one norm, or NaN if there was an error

sfloat slap_Sum(Matrix mat)

Calculate the sum of all of the elements.

Header File: slap/vector_ops.h

Parameters:

mat – A valid matrix

Returns:

The sum of all of the elements, or NaN if there was an error