HALCON Reference Manual / Matrix / Arithmetic Operators

add_matrix_mod (Operator)

Name

add_matrix_mod — Add two matrices.

Synopsis

add_matrix_mod( : : MatrixAID, MatrixBID : )

Description

The operator add_matrix_mod computes the sum of the input matrices MatrixA and MatrixB given by the matrix handles MatrixAID and MatrixBID. Both matrices must have identical dimensions. The input matrix MatrixA is overwritten with the result. Access to the elements of the matrix is possible e.g. with the operator get_full_matrix. The formula for the calculation of the result is:

  MatrixA = MatrixA + MatrixB.

Example:

            /   3.0   1.0  -2.0  \                /   2.0   8.0  -3.0  \
  MatrixA = |  -5.0   7.0   2.0  |      MatrixB = |  -4.0  -1.0   5.0  |
            \  -9.0  -4.0   1.0  /                \   2.0  -4.0   7.0  /

                 /   5.0   9.0  -5.0  \
  ->   MatrixA = |  -9.0   6.0   7.0  |
                 \  -7.0  -8.0   8.0  /

Attention

add_matrix_mod modifies the content of an already existing matrix.

Parameters

MatrixAID (input_control) matrix (integer)
Matrix handle of the input matrix A.

MatrixBID (input_control) matrix (integer)
Matrix handle of the input matrix B.

Result

If the parameters are valid, the operator add_matrix_mod returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Parallelization Information

add_matrix_mod is reentrant and processed without parallelization.

Possible Predecessors

create_matrix

Possible Successors

get_full_matrix, get_value_matrix

Alternatives

add_matrix

See also

sub_matrix, sub_matrix_mod

Module

Foundation


HALCON Reference Manual / Matrix / Arithmetic Operators
Version 9.0.2 Copyright © 1996-2010 MVTec Software GmbH