#include "dMatrix.h"
#include "fMatrix.h"
#include "CMatrix.h"
#include "fCMatrix.h"
#include "dSparse.h"
#include "CSparse.h"
#include "dDiagMatrix.h"
#include "fDiagMatrix.h"
#include "CDiagMatrix.h"
#include "fCDiagMatrix.h"
#include "PermMatrix.h"
#include "mx-inlines.cc"
#include "quit.h"
#include "defun-dld.h"
#include "error.h"
#include "oct-obj.h"
Go to the source code of this file.
Functions | |
DEFUN_DLD (kron, args,,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} kron (@var{A}, @var{B})\n\ @deftypefnx {Loadable Function} {} kron (@var{A1}, @var{A2}, @dots{})\n\ Form the Kronecker product of two or more matrices, defined block by \n\ block as\n\ \n\ @example\n\ x = [a(i, j) b]\n\ @end example\n\ \n\ For example:\n\ \n\ @example\n\ @group\n\ kron (1:4, ones (3, 1))\n\ @result{} 1 2 3 4\n\ 1 2 3 4\n\ 1 2 3 4\n\ @end group\n\ @end example\n\ \n\ If there are more than two input arguments @var{A1}, @var{A2}, @dots{}, \n\ @var{An} the Kronecker product is computed as\n\ \n\ @example\n\ kron (kron (@var{A1}, @var{A2}), @dots{}, @var{An})\n\ @end example\n\ \n\ @noindent\n\ Since the Kronecker product is associative, this is well-defined.\n\ @end deftypefn") | |
octave_value | dispatch_kron (const octave_value &a, const octave_value &b) |
template<class MTA , class MTB > | |
octave_value | do_kron (const octave_value &a, const octave_value &b) |
template<class R , class T > | |
static MArray< T > | kron (const MDiagArray2< R > &a, const MArray< T > &b) |
static PermMatrix | kron (const PermMatrix &a, const PermMatrix &b) |
template<class T > | |
static MSparse< T > | kron (const MSparse< T > &A, const MSparse< T > &B) |
template<class R , class T > | |
static MArray< T > | kron (const MArray< R > &a, const MArray< T > &b) |
DEFUN_DLD | ( | kron | , | |
args | ||||
) |
Definition at line 246 of file kron.cc.
References dispatch_kron(), and print_usage().
octave_value dispatch_kron | ( | const octave_value & | a, | |
const octave_value & | b | |||
) |
Definition at line 175 of file kron.cc.
References octave_value::columns(), octave_value::diag(), octave_value::is_complex_type(), octave_value::is_diag_matrix(), octave_value::is_perm_matrix(), octave_value::is_single_type(), octave_value::is_sparse_type(), and octave_value::rows().
Referenced by DEFUN_DLD().
octave_value do_kron | ( | const octave_value & | a, | |
const octave_value & | b | |||
) |
Definition at line 167 of file kron.cc.
References kron(), and octave_value().
static MArray<T> kron | ( | const MDiagArray2< R > & | a, | |
const MArray< T > & | b | |||
) | [static] |
Definition at line 78 of file kron.cc.
References Array< T >::cols(), DiagArray2< T >::cols(), Array< T >::data(), DiagArray2< T >::dgelem(), DiagArray2< T >::diag_length(), Array< T >::ndims(), Array< T >::rows(), DiagArray2< T >::rows(), and Array< T >::xelem().
static PermMatrix kron | ( | const PermMatrix & | a, | |
const PermMatrix & | b | |||
) | [static] |
Definition at line 129 of file kron.cc.
References PermMatrix::data(), PermMatrix::fortran_vec(), PermMatrix::is_col_perm(), and PermMatrix::rows().
static MSparse<T> kron | ( | const MSparse< T > & | A, | |
const MSparse< T > & | B | |||
) | [static] |
Definition at line 99 of file kron.cc.
References Sparse< T >::cidx(), Sparse< T >::columns(), Sparse< T >::data(), Sparse< T >::nnz(), Sparse< T >::ridx(), and Sparse< T >::rows().
static MArray<T> kron | ( | const MArray< R > & | a, | |
const MArray< T > & | b | |||
) | [static] |
Definition at line 53 of file kron.cc.
References Array< T >::cols(), Array< T >::data(), Array< T >::fortran_vec(), Array< T >::ndims(), and Array< T >::rows().
Referenced by do_kron().