HALCON Reference Manual 10.0.2
Table of Contents / Matrix / Decomposition ClassesClassesClasses | | | Operators

orthogonal_decompose_matrixorthogonal_decompose_matrixorthogonal_decompose_matrixOrthogonalDecomposeMatrixOrthogonalDecomposeMatrix (Operator)

Name

orthogonal_decompose_matrixorthogonal_decompose_matrixorthogonal_decompose_matrixOrthogonalDecomposeMatrixOrthogonalDecomposeMatrix — Perform an orthogonal decomposition of a matrix.

Signature

orthogonal_decompose_matrix( : : MatrixID, DecompositionType, OutputMatricesType, ComputeOrthogonal : MatrixOrthogonalID, MatrixTriangularID)

Herror orthogonal_decompose_matrix(const Hlong MatrixID, const char* DecompositionType, const char* OutputMatricesType, const char* ComputeOrthogonal, Hlong* MatrixOrthogonalID, Hlong* MatrixTriangularID)

Herror T_orthogonal_decompose_matrix(const Htuple MatrixID, const Htuple DecompositionType, const Htuple OutputMatricesType, const Htuple ComputeOrthogonal, Htuple* MatrixOrthogonalID, Htuple* MatrixTriangularID)

Herror orthogonal_decompose_matrix(const HTuple& MatrixID, const HTuple& DecompositionType, const HTuple& OutputMatricesType, const HTuple& ComputeOrthogonal, Hlong* MatrixOrthogonalID, Hlong* MatrixTriangularID)

HMatrix HMatrix::OrthogonalDecomposeMatrix(const HTuple& DecompositionType, const HTuple& OutputMatricesType, const HTuple& ComputeOrthogonal, HMatrix* MatrixTriangularID) const

void HOperatorSetX.OrthogonalDecomposeMatrix(
[in] VARIANT MatrixID, [in] VARIANT DecompositionType, [in] VARIANT OutputMatricesType, [in] VARIANT ComputeOrthogonal, [out] VARIANT* MatrixOrthogonalID, [out] VARIANT* MatrixTriangularID)

IHMatrixX* HMatrixX.OrthogonalDecomposeMatrix(
[in] BSTR DecompositionType, [in] BSTR OutputMatricesType, [in] BSTR ComputeOrthogonal, [out] IHMatrixX*MatrixTriangularID)

static void HOperatorSet.OrthogonalDecomposeMatrix(HTuple matrixID, HTuple decompositionType, HTuple outputMatricesType, HTuple computeOrthogonal, out HTuple matrixOrthogonalID, out HTuple matrixTriangularID)

HMatrix HMatrix.OrthogonalDecomposeMatrix(string decompositionType, string outputMatricesType, string computeOrthogonal, out HMatrix matrixTriangularID)

Description

The operator orthogonal_decompose_matrixorthogonal_decompose_matrixorthogonal_decompose_matrixOrthogonalDecomposeMatrixOrthogonalDecomposeMatrix decomposes the MatrixMatrixMatrixMatrixmatrix defined by the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixID. The results are stored in the two generated matrices MatrixOrthogonalMatrixOrthogonalMatrixOrthogonalMatrixOrthogonalmatrixOrthogonal and MatrixTriangularMatrixTriangularMatrixTriangularMatrixTriangularmatrixTriangular. The operator returns the matrix handles MatrixOrthogonalIDMatrixOrthogonalIDMatrixOrthogonalIDMatrixOrthogonalIDmatrixOrthogonalID and MatrixTriangularIDMatrixTriangularIDMatrixTriangularIDMatrixTriangularIDmatrixTriangularID of these two matrices. Access to the elements of the matrices is possible e.g. with the operator get_full_matrixget_full_matrixget_full_matrixGetFullMatrixGetFullMatrix.

For OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'full'"full""full""full""full" all results of the decomposition are stored in the matrices MatrixOrthogonalMatrixOrthogonalMatrixOrthogonalMatrixOrthogonalmatrixOrthogonal and MatrixTriangularMatrixTriangularMatrixTriangularMatrixTriangularmatrixTriangular. For OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'reduced'"reduced""reduced""reduced""reduced" only a part of result elements of the matrices MatrixOrthogonalMatrixOrthogonalMatrixOrthogonalMatrixOrthogonalmatrixOrthogonal and MatrixTriangularMatrixTriangularMatrixTriangularMatrixTriangularmatrixTriangular are stored. Therefore the sizes of these matrices are smaller than for OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'full'"full""full""full""full".

For the parameter ComputeOrthogonalComputeOrthogonalComputeOrthogonalComputeOrthogonalcomputeOrthogonal = 'true'"true""true""true""true" both output matrices are computed. For the ComputeOrthogonalComputeOrthogonalComputeOrthogonalComputeOrthogonalcomputeOrthogonal = 'false'"false""false""false""false" only the matrix MatrixTriangularMatrixTriangularMatrixTriangularMatrixTriangularmatrixTriangular is computed. Thus, the runtime of the operation takes fewer time.

The type of the MatrixMatrixMatrixMatrixmatrix can be selected via the parameter DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType. For DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'qr'"qr""qr""qr""qr" a QR decomposition (Quadratic/Right) or for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'ql'"ql""ql""ql""ql" a QL decomposition (Quadratic/Left) is computed. The decomposition is written as

  MatrixMatrixMatrixMatrixmatrix = MatrixOrthogonalMatrixOrthogonalMatrixOrthogonalMatrixOrthogonalmatrixOrthogonal * MatrixTriangularMatrixTriangularMatrixTriangularMatrixTriangularmatrixTriangular.

Example for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'qr'"qr""qr""qr""qr" and OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'full'"full""full""full""full":


           /   6.0  -3.0   4.0   \
           |   5.0   5.0  -2.0   |
  Matrix = |  -3.0  12.0   5.0   |    ->
           |   3.0   4.0   7.0   |
           \   7.0   5.0   3.0  /

                     /  -0.5303   0.2613  -0.4277  -0.5566  -0.3972  \
                     |  -0.4419  -0.2920  -0.6383   0.1727  -0.5312  |
  MatrixOrthogonal = |   0.2652  -0.8443  -0.2059  -0.3961  -0.1326  |
                     |  -0.2652  -0.2432  -0.6008   0.7000  -0.1400  |
                     \  -0.6187  -0.2729   0.0799  -0.1160   0.7231  /

                     / -11.3137  -1.5910  -3.6239  \
                     |     0    -14.7129  -5.1135  |
  MatrixTriangular = |     0        0     -7.9824  |
                     |     0        0        0     |
                     \     0        0        0     /

Example for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'qr'"qr""qr""qr""qr" and OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'reduced'"reduced""reduced""reduced""reduced":


           /   6.0  -3.0   4.0   \
           |   5.0   5.0  -2.0   |
  Matrix = |  -3.0  12.0   5.0   |    ->
           |   3.0   4.0   7.0   |
           \   7.0   5.0   3.0  /

                     /  -0.5303   0.2613  -0.4277  \
                     |  -0.4419  -0.2920  -0.6383  |
  MatrixOrthogonal = |   0.2652  -0.8443  -0.2059  |
                     |  -0.2652  -0.2432  -0.6008  |
                     \  -0.6187  -0.2729   0.0799  /

                     / -11.3137  -1.5910  -3.6239  \
  MatrixTriangular = |     0    -14.7129  -5.1135  |
                     \     0        0     -7.9824  /

Example for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'ql'"ql""ql""ql""ql" and OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'full'"full""full""full""full":


           /   6.0  -3.0   4.0   \
           |   5.0   5.0  -2.0   |
  Matrix = |  -3.0  12.0   5.0   |    ->
           |   3.0   4.0   7.0   |
           \   7.0   5.0   3.0  /

                     /   0.6806   0.0657   0.3659  -0.4932  -0.3941  \
                     |   0.1161   0.5464   0.6091   0.5274   0.1971  |
  MatrixOrthogonal = |   0.4093  -0.0832  -0.4046   0.6474  -0.4927  |
                     |  -0.5362   0.4713   0.0072  -0.1208  -0.6897  |
                     \  -0.2611  -0.6842   0.5757   0.2119  -0.2956  /

                     /     0        0        0     \
                     |     0        0        0     |
  MatrixTriangular = |  10.5059     0        0     |
                     |  -1.1429  12.4620     0     |
                     \  -4.0399  -7.9812 -10.1489  /

Example for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'ql'"ql""ql""ql""ql" and OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'reduced'"reduced""reduced""reduced""reduced":


           /   6.0  -3.0   4.0   \
           |   5.0   5.0  -2.0   |
  Matrix = |  -3.0  12.0   5.0   |    ->
           |   3.0   4.0   7.0   |
           \   7.0   5.0   3.0  /

                     /   0.3659  -0.4932  -0.3941  \
                     |   0.6091   0.5274   0.1971  |
  MatrixOrthogonal = |  -0.4046   0.6474  -0.4927  |
                     |   0.0072  -0.1208  -0.6897  |
                     \   0.5757   0.2119  -0.2956  /

                     /  10.5059     0        0     \
  MatrixTriangular = |  -1.1429  12.4620     0     |
                     \  -4.0399  -7.9812 -10.1489  /

For DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'rq'"rq""rq""rq""rq" a RQ decomposition (Right/Quadratic) or for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'lq'"lq""lq""lq""lq" a LQ decomposition (Left/Quadratic) is computed. The decomposition is written as

  MatrixMatrixMatrixMatrixmatrix = MatrixTriangularMatrixTriangularMatrixTriangularMatrixTriangularmatrixTriangular * MatrixOrthogonalMatrixOrthogonalMatrixOrthogonalMatrixOrthogonalmatrixOrthogonal.

Example for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'rq'"rq""rq""rq""rq" and OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'full'"full""full""full""full":


           /   6.0   5.0  -3.0   3.0   7.0  \
  Matrix = |  -3.0   5.0  12.0   4.0   5.0  |    ->
           \   4.0  -2.0   5.0   7.0   3.0  /

                     /   0.6806   0.1161   0.4093  -0.5362  -0.2611  \
                     |   0.0657   0.5464  -0.0832   0.4713  -0.6842  |
  MatrixOrthogonal = |   0.3659   0.6091  -0.4046   0.0072   0.5757  |
                     |  -0.4932   0.5274   0.6474  -0.1208   0.2119  |
                     \  -0.3941   0.1971  -0.4927  -0.6897  -0.2956  /

                     /     0        0     10.5059  -1.1429  -4.0399  \
  MatrixTriangular = |     0        0        0     12.4620  -7.9812  |
                     \     0        0        0        0    -10.1489  /

Example for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'rq'"rq""rq""rq""rq" and OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'reduced'"reduced""reduced""reduced""reduced":


           /   6.0   5.0  -3.0   3.0   7.0  \
  Matrix = |  -3.0   5.0  12.0   4.0   5.0  |    ->
           \   4.0  -2.0   5.0   7.0   3.0  /

                     /   0.3659   0.6091  -0.4046   0.0072   0.5757  \
  MatrixOrthogonal = |  -0.4932   0.5274   0.6474  -0.1208   0.2119  |
                     \  -0.3941   0.1971  -0.4927  -0.6897  -0.2956  /

                     /  10.5059  -1.1429  -4.0399  \
  MatrixTriangular = |     0     12.4620  -7.9812  |
                     \     0        0    -10.1489  /

Example for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'lq'"lq""lq""lq""lq" and OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'full'"full""full""full""full":


           /   6.0   5.0  -3.0   3.0   7.0  \
  Matrix = |  -3.0   5.0  12.0   4.0   5.0  |    ->
           \   4.0  -2.0   5.0   7.0   3.0  /

                     /  -0.5303  -0.4419   0.2652  -0.2652  -0.6187  \
                     |   0.2613  -0.2920  -0.8443  -0.2432  -0.2729  |
  MatrixOrthogonal = |  -0.4277   0.6383  -0.2059  -0.6008   0.0799  |
                     |  -0.5566   0.1727  -0.3961   0.7000  -0.1160  |
                     \  -0.3972  -0.5312  -0.1326  -0.1400   0.7231  /

                     / -11.3137     0        0        0        0     \
  MatrixTriangular = |  -1.5910 -14.7129     0        0        0     |
                     \  -3.6239  -5.1135  -7.9824     0        0     /

Example for DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType = 'lq'"lq""lq""lq""lq" and OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType = 'reduced'"reduced""reduced""reduced""reduced":


           /   6.0   5.0  -3.0   3.0   7.0  \
  Matrix = |  -3.0   5.0  12.0   4.0   5.0  |    ->
           \   4.0  -2.0   5.0   7.0   3.0  /

                     /  -0.5303  -0.4419   0.2652  -0.2652  -0.6187  \
  MatrixOrthogonal = |   0.2613  -0.2920  -0.8443  -0.2432  -0.2729  |
                     \  -0.4277   0.6383  -0.2059  -0.6008   0.0799  /

                     / -11.3137     0        0     \
  MatrixTriangular = |  -1.5910 -14.7129     0     |
                     \  -3.6239  -5.1135  -7.9824  /

It should be noted that in the examples there are differences in the meaning of the numbers of the output matrices: The results of the elements are per definition a certain value if the number of this value is shown as an integer number, e.g., 0 or 1. If the number is shown as a floating point number, e.g., 0.0 or 1.0, the value is computed.

Parallelization

Parameters

MatrixIDMatrixIDMatrixIDMatrixIDmatrixID (input_control)  matrix HMatrix, HTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Matrix handle of the input matrix.

DecompositionTypeDecompositionTypeDecompositionTypeDecompositionTypedecompositionType (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Method of decomposition.

Default value: 'qr' "qr" "qr" "qr" "qr"

List of values: 'qr'"qr""qr""qr""qr", 'rq'"rq""rq""rq""rq", 'ql'"ql""ql""ql""ql", 'lq'"lq""lq""lq""lq"

OutputMatricesTypeOutputMatricesTypeOutputMatricesTypeOutputMatricesTypeoutputMatricesType (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Type of output matrices.

Default value: 'full' "full" "full" "full" "full"

List of values: 'full'"full""full""full""full", 'reduced'"reduced""reduced""reduced""reduced"

ComputeOrthogonalComputeOrthogonalComputeOrthogonalComputeOrthogonalcomputeOrthogonal (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Computation of the orthogonal matrix.

Default value: 'true' "true" "true" "true" "true"

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false"

MatrixOrthogonalIDMatrixOrthogonalIDMatrixOrthogonalIDMatrixOrthogonalIDmatrixOrthogonalID (output_control)  matrix HMatrix, HTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Matrix handle with the orthogonal part of the decomposed input matrix.

MatrixTriangularIDMatrixTriangularIDMatrixTriangularIDMatrixTriangularIDmatrixTriangularID (output_control)  matrix HMatrix, HTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Matrix handle with the triangular part of the decomposed input matrix.

Result

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

Possible Predecessors

create_matrixcreate_matrixcreate_matrixCreateMatrixCreateMatrix

Possible Successors

get_full_matrixget_full_matrixget_full_matrixGetFullMatrixGetFullMatrix, get_value_matrixget_value_matrixget_value_matrixGetValueMatrixGetValueMatrix

See also

decompose_matrixdecompose_matrixdecompose_matrixDecomposeMatrixDecomposeMatrix, solve_matrixsolve_matrixsolve_matrixSolveMatrixSolveMatrix

References

David Poole: “Linear Algebra: A Modern Introduction”; Thomson; Belmont; 2006.
Gene H. Golub, Charles F. van Loan: “Matrix Computations”; The Johns Hopkins University Press; Baltimore and London; 1996.

Module

Foundation


Table of Contents / Matrix / Decomposition ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH