cpp_det_by_minor

View page source

C++ Determinant Using Expansion by Minors

Syntax

      # include <cmpad/algo/det_by_minor.hpp>
      cmpad::det_by_minor < Vector > det
      det . setup ( option )
      y = det ( x )

Class Declaration

template <class Vector> class det_by_minor : public fun_obj<Vector>

Algo

This is an cpp_fun_obj interface to the det_by_minor Algorithm . We use Algo for the type of this algorithm; i.e.,

      typedef cmpad::det_by_minor < Vector > Algo

Vector

This is a fun_obj Vector type.

vector_type

The type Algo :: vector_type is the same as Vector . This is useful when Algo is a template parameter.

scalar_type

The type Algo :: scalar_type is the type of the elements of Vector ; i.e., Vector :: value_type . This is also useful when Algo is a template parameter.

det

The object det is a fun that computes the function corresponding to the det_by_minor algorithm.

option

This is an option_t object that specifies n_arg and n_other .

ell

see ell .

n_arg

see n_arg .

n_other

see n_other .

x

The argument x has size n_arg = \(\ell * \ell\) . The elements of the matrix \(A(x)\) is defined as follows: for \(i = 0 , \ldots , \ell-1\) and \(j = 0 , \ldots , \ell-1\), by

\[A(x)_{i,j} = x[ i * \ell + j]\]

y

The return value y has size \(m = 1\) and its element is equal to the determinant of \(A(x)\).

Example

The file xam_det_by_minor.cpp contains an example and test of det_by_minor .

Source Code

det_by_minor.hpp displays the source code for this algorithm.