Back to Aurora Vision Library website

You are here: Start » Function Reference » Basic » Random » CreateRandomMatrix

CreateRandomMatrix


Header: STD.h
Namespace: avl
Module: FoundationLite

Creates matrix with random values in closed interval.

Syntax

void avl::CreateRandomMatrix
(
	const int inColumnCount,
	const int inRowCount,
	const float inMinValue,
	const float inMaxValue,
	const float inStep,
	atl::Optional<int> inSeed,
	avl::Matrix& outMatrix
)

Parameters

Name Type Range Default Description
Input value inColumnCount const int 10 Columns count of generated matrix
Input value inRowCount const int 10 Rows count of generated matrix
Input value inMinValue const float Minimal generated value
Input value inMaxValue const float 10.0f Maximal generated value
Input value inStep const float 0.0001 - 1.0f Minimal difference between two random values
Input value inSeed Optional<int> NIL Random seed used to generate values
Output value outMatrix Matrix&

Remarks

This filter should not be used for generating cryptographically secure random numbers.

Errors

List of possible exceptions:

Error type Description
DomainError Value of inColumnCount is non-positive.
DomainError Value of inMinValue is greater than value of inMaxValue.
DomainError Value of inRowCount is non-positive.
DomainError Value of inStep is greater than span between maximal and minimal value.
DomainError Values inMinValue and inMaxValue are equal.