Armadillo: C++ library for linear algebra & scientific computing - API Documentation

Armadillo
C++ library for linear algebra & scientific computing
[top] API Documentation for Armadillo 14.4


Preamble




Overview
Matrix, Vector, Cube and Field Classes
Member Functions & Variables
Generated Vectors / Matrices / Cubes
Functions of Vectors / Matrices / Cubes
Decompositions, Factorisations, Inverses and Equation Solvers (Dense Matrices)
Decompositions, Factorisations and Equation Solvers (Sparse Matrices)
Signal & Image Processing
Statistics & Clustering
Miscellaneous




Matrix, Vector, Cube and Field Classes



Mat<type>
mat
cx_mat


Col<type>
vec
cx_vec


Row<type>
rowvec
cx_rowvec


Cube<type>
cube
cx_cube


field<object_type>


SpMat<type>
sp_mat
sp_cx_mat


operators: + − * % / == != <= >= < > && ||



Member Functions & Variables



attributes


element/object access via (), [] and .at()


element initialisation


.zeros()
(member function of Mat, Col, Row, SpMat, Cube)
.zeros( n_elem )
(member function of Col and Row)
.zeros( n_rows, n_cols )
(member function of Mat and SpMat)
.zeros( n_rows, n_cols, n_slices )
(member function of Cube)
.zeros( size(X) )
(member function of Mat, Col, Row, Cube, SpMat)


.ones()
(member function of Mat, Col, Row, Cube)
.ones( n_elem )
(member function of Col and Row)
.ones( n_rows, n_cols )
(member function of Mat)
.ones( n_rows, n_cols, n_slices )
(member function of Cube)
.ones( size(X) )
(member function of Mat, Col, Row, Cube)


.eye()
.eye( n_rows, n_cols )
.eye( size(X) )


.randu()
(member function of Mat, Col, Row, Cube)
.randu( n_elem )
(member function of Col and Row)
.randu( n_rows, n_cols )
(member function of Mat)
.randu( n_rows, n_cols, n_slices )
(member function of Cube)
.randu( size(X) )
(member function of Mat, Col, Row, Cube)

.randn()
(member function of Mat, Col, Row, Cube)
.randn( n_elem )
(member function of Col and Row)
.randn( n_rows, n_cols )
(member function of Mat)
.randn( n_rows, n_cols, n_slices )
(member function of Cube)
.randn( size(X) )
(member function of Mat, Col, Row, Cube)


.fill( value )


.imbue( functor )
.imbue( lambda_function )


.clean( threshold )


.replace( old_value, new_value )


.clamp( min_value, max_value )


.transform( functor )
.transform( lambda_function )


.for_each( functor )
.for_each( lambda_function )


.set_size( n_elem )
(member function of Col, Row, field)
.set_size( n_rows, n_cols )
(member function of Mat, SpMat, field)
.set_size( n_rows, n_cols, n_slices )
(member function of Cube and field)
.set_size( size(X) )
(member function of Mat, Col, Row, Cube, SpMat, field)


.reshape( n_rows, n_cols )
(member function of Mat, SpMat, field)
.reshape( n_rows, n_cols, n_slices )
(member function of Cube, field)
.reshape( size(X) )
(member function of Mat, Cube, SpMat, field)


.resize( n_elem )
(member function of Col, Row)
.resize( n_rows, n_cols )
(member function of Mat, SpMat, field)
.resize( n_rows, n_cols, n_slices )
(member function of Cube, field)
.resize( size(X) )
(member function of Mat, Col, Row, Cube, SpMat, field)


.copy_size( A )


.reset()


submatrix views
  • non-contiguous views for matrix or vector X:

      X.elem( vector_of_indices )
      X( vector_of_indices )

      X.cols( vector_of_column_indices )
      X.rows( vector_of_row_indices )

      X.submat( vector_of_row_indices, vector_of_column_indices )
      X( vector_of_row_indices, vector_of_column_indices )


  • related matrix views (documented separately)

  • Instances of span(start,end) can be replaced by span::all to indicate the entire range

  • For functions requiring one or more vector of indices, eg. X.submat(vector_of_row_indices, vector_of_column_indices), each vector of indices must be of type uvec

  • In the function X.elem(vector_of_indices), elements specified in vector_of_indices are accessed. X is interpreted as one long vector, with column-by-column ordering of the elements of X. The vector_of_indices must evaluate to a vector of type uvec (eg. generated by the find() function). The aggregate set of the specified elements is treated as a column vector (ie. the output of X.elem() is always a column vector).

  • The function .unsafe_col() is provided for speed reasons and should be used only if you know what you are doing. It creates a seemingly independent Col vector object (eg. vec), but uses memory from the existing matrix object. As such, the created vector is not alias safe, and does not take into account that the underlying matrix memory could be freed (eg. due to any operation involving a size change of the matrix).

  • Examples:

  • See also:



  • subcube views and slices


    subfield views


    .diag()
    .diag( k )


    .each_col() .each_row() (form 1)
    .each_col( vector_of_indices ) .each_row( vector_of_indices ) (form 2)
    .each_col( lambda_function ) .each_row( lambda_function ) (form 3)


    .each_slice() (form 1)
    .each_slice( vector_of_indices ) (form 2)
    .each_slice( lambda_function ) (form 3)
    .each_slice( lambda_function, use_mp ) (form 4)


    .set_imag( X )
    .set_real( X )


    .insert_rows( row_number, X )
    .insert_rows( row_number, number_of_rows ) (member functions of Mat, Col and Cube)
    .insert_cols( col_number, X )
    .insert_cols( col_number, number_of_cols ) (member functions of Mat, Row and Cube)
    .insert_slices( slice_number, X )
    .insert_slices( slice_number, number_of_slices ) (member functions of Cube)


    .shed_row( row_number )
    .shed_rows( first_row, last_row )
    .shed_rows( vector_of_indices ) (member function of Mat, Col, SpMat, Cube)
    (member function of Mat, Col, SpMat, Cube)
    (member function of Mat, Col)
    .shed_col( column_number )
    .shed_cols( first_column, last_column )
    .shed_cols( vector_of_indices ) (member function of Mat, Row, SpMat, Cube)
    (member function of Mat, Row, SpMat, Cube)
    (member function of Mat, Row)
    .shed_slice( slice_number )
    .shed_slices( first_slice, last_slice )
    .shed_slices( vector_of_indices ) (member functions of Cube)


    .swap_rows( row1, row2 )
    .swap_cols( col1, col2 )


    .swap( X )


    .memptr()


    .colptr( col_number )


    iterators (dense matrices & vectors)


    iterators (cubes)


    iterators (sparse matrices)


    iterators (dense submatrices & subcubes)


    compatibility container functions


    .as_col()
    .as_row()


    .col_as_mat( col_number )
    .row_as_mat( row_number )


    .as_dense()


    .t()
    .st()


    .i()


    .min()
    .max()


    .index_min()
    .index_max()


    .eval()


    .in_range( i )
    (member of Mat, Col, Row, Cube, SpMat, field)
    .in_range( span(start, end) )
    (member of Mat, Col, Row, Cube, SpMat, field)
    .in_range( row, col )
    (member of Mat, Col, Row, SpMat, field)
    .in_range( span(start_row, end_row), span(start_col, end_col) )
    (member of Mat, Col, Row, SpMat, field)
    .in_range( row, col, slice )
    (member of Cube and field)
    .in_range( span(start_row, end_row), span(start_col, end_col), span(start_slice, end_slice) )
    (member of Cube and field)
    .in_range( first_row, first_col, size(X) ) (X is a matrix or field)
    (member of Mat, Col, Row, SpMat, field)
    .in_range( first_row, first_col, size(n_rows, n_cols) )
    (member of Mat, Col, Row, SpMat, field)
    .in_range( first_row, first_col, first_slice, size(Q) ) (Q is a cube or field)
    (member of Cube and field)
    .in_range( first_row, first_col, first_slice, size(n_rows, n_cols n_slices) )
    (member of Cube and field)


    .is_empty()


    .is_vec()
    .is_colvec()
    .is_rowvec()


    .is_sorted()
    .is_sorted( sort_direction )
    .is_sorted( sort_direction, dim )


    .is_trimatu()
    .is_trimatl()


    .is_diagmat()


    .is_square()


    .is_symmetric()
    .is_symmetric( tol )


    .is_hermitian()
    .is_hermitian( tol )


    .is_sympd()
    .is_sympd( tol )


    .is_zero()
    .is_zero( tolerance )


    .is_finite()


    .has_inf()


    .has_nan()


    .print()
    .print( header )

    .print( stream )
    .print( stream, header )


    .raw_print()
    .raw_print( header )

    .raw_print( stream )
    .raw_print( stream, header )


    .brief_print()
    .brief_print( header )

    .brief_print( stream )
    .brief_print( stream, header )


    saving / loading matrices & cubes

    .save( filename )
    .save( filename, file_type )

    .save( stream )
    .save( stream, file_type )

    .save( hdf5_name(filename, dataset) )
    .save( hdf5_name(filename, dataset, settings) )

    .save( csv_name(filename, header) )
    .save( csv_name(filename, header, settings) ) .load( filename )
    .load( filename, file_type )

    .load( stream )
    .load( stream, file_type )

    .load( hdf5_name(filename, dataset) )
    .load( hdf5_name(filename, dataset, settings) )

    .load( csv_name(filename, header) )
    .load( csv_name(filename, header, settings) )



    saving / loading fields

    .save( name )
    .save( name, file_type )

    .save( stream )
    .save( stream, file_type ) .load( name )
    .load( name, file_type )

    .load( stream )
    .load( stream, file_type )





    Generated Vectors / Matrices / Cubes



    linspace( start, end )
    linspace( start, end, N )


    logspace( A, B )
    logspace( A, B, N )


    regspace( start, end )
    regspace( start, delta, end )


    randperm( N )
    randperm( N, M )


    eye( n_rows, n_cols )
    eye( size(X) )


    ones( n_elem )
    ones( n_rows, n_cols )
    ones( n_rows, n_cols, n_slices )
    ones( size(X) )


    zeros( n_elem )
    zeros( n_rows, n_cols )
    zeros( n_rows, n_cols, n_slices )
    zeros( size(X) )


    randu( )
    randu( distr_param(a,b) )

    randu( n_elem )
    randu( n_elem, distr_param(a,b) )

    randu( n_rows, n_cols )
    randu( n_rows, n_cols, distr_param(a,b) )

    randu( n_rows, n_cols, n_slices )
    randu( n_rows, n_cols, n_slices, distr_param(a,b) )

    randu( size(X) )
    randu( size(X), distr_param(a,b) )


    randn( )
    randn( distr_param(mu,sd) )

    randn( n_elem )
    randn( n_elem, distr_param(mu,sd) )

    randn( n_rows, n_cols )
    randn( n_rows, n_cols, distr_param(mu,sd) )

    randn( n_rows, n_cols, n_slices )
    randn( n_rows, n_cols, n_slices, distr_param(mu,sd) )

    randn( size(X) )
    randn( size(X), distr_param(mu,sd) )


    randg( )
    randg( distr_param(a,b) )

    randg( n_elem )
    randg( n_elem, distr_param(a,b) )

    randg( n_rows, n_cols )
    randg( n_rows, n_cols, distr_param(a,b) )

    randg( n_rows, n_cols, n_slices )
    randg( n_rows, n_cols, n_slices, distr_param(a,b) )

    randg( size(X) )
    randg( size(X), distr_param(a,b) )


    randi( )
    randi( distr_param(a,b) )

    randi( n_elem )
    randi( n_elem, distr_param(a,b) )

    randi( n_rows, n_cols )
    randi( n_rows, n_cols, distr_param(a,b) )

    randi( n_rows, n_cols, n_slices )
    randi( n_rows, n_cols, n_slices, distr_param(a,b) )

    randi( size(X) )
    randi( size(X), distr_param(a,b) )


    speye( n_rows, n_cols )
    speye( size(X) )


    spones( A )


    sprandu( n_rows, n_cols, density )
    sprandn( n_rows, n_cols, density )

    sprandu( size(X), density )
    sprandn( size(X), density )


    toeplitz( A )
    toeplitz( A, B )



    Functions of Vectors / Matrices / Cubes



    abs( X )


    accu( X )


    affmul( A, B )


    all( V )
    all( X )
    all( X, dim )


    any( V )
    any( X )
    any( X, dim )


    approx_equal( A, B, method, tol )
    approx_equal( A, B, method, abs_tol, rel_tol )


    arg( X )


    as_scalar( expression )


    clamp( X, min_val, max_val )


    cond( A )


    conj( X )


    conv_to< type >::from( X )


    cross( A, B )


    cumsum( V )
    cumsum( X )
    cumsum( X, dim )


    cumprod( V )
    cumprod( X )
    cumprod( X, dim )


    val = det( A ) (form 1)
    det( val, A ) (form 2)


    diagmat( V )
    diagmat( V, k )

    diagmat( X )
    diagmat( X, k )


    diagvec( X )
    diagvec( X, k )


    diags( V, D, n_rows, n_cols )
    spdiags( V, D, n_rows, n_cols )


    diff( V )
    diff( V, k )

    diff( X )
    diff( X, k )
    diff( X, k, dim )


    dot( A, B )
    cdot( A, B )
    norm_dot( A, B )


    eps( X )


    B = expmat( A )
    expmat( B, A )


    B = expmat_sym( A )
    expmat_sym( B, A )


    find( X )
    find( X, k )
    find( X, k, s )


    find_finite( X )


    find_nonfinite( X )


    find_nan( X )


    find_unique( X )
    find_unique( X, ascending_indices )


    fliplr( X )
    flipud( X )


    imag( X )
    real( X )


    uvec sub = ind2sub( size(X), index ) (form 1)
    umat sub = ind2sub( size(X), vector_of_indices ) (form 2)


    index_min( V )
    index_min( M )
    index_min( M, dim )
    index_min( Q )
    index_min( Q, dim ) index_max( V )
    index_max( M )
    index_max( M, dim )
    index_max( Q )
    index_max( Q, dim )


    inplace_trans( X )
    inplace_trans( X, method )

    inplace_strans( X )
    inplace_strans( X, method )


    C = intersect( A, B ) (form 1)
    intersect( C, iA, iB, A, B ) (form 2)


    join_rows( A, B )
    join_rows( A, B, C )
    join_rows( A, B, C, D )

    join_cols( A, B )
    join_cols( A, B, C )
    join_cols( A, B, C, D ) join_horiz( A, B )
    join_horiz( A, B, C )
    join_horiz( A, B, C, D )

    join_vert( A, B )
    join_vert( A, B, C )
    join_vert( A, B, C, D )


    join_slices( cube C, cube D )
    join_slices( mat M, mat N )

    join_slices( mat M, cube C )
    join_slices( cube C, mat M )


    kron( A, B )


    complex result = log_det( A ) (form 1)
    log_det( val, sign, A ) (form 2)


    result = log_det_sympd( A ) (form 1)
    log_det_sympd( result, A ) (form 2)


    B = logmat( A )
    logmat( B, A )


    B = logmat_sympd( A )
    logmat_sympd( B, A )


    min( V )
    min( M )
    min( M, dim )
    min( Q )
    min( Q, dim )
    min( A, B ) max( V )
    max( M )
    max( M, dim )
    max( Q )
    max( Q, dim )
    max( A, B )


    nonzeros( X )


    norm( X )
    norm( X, p )


    norm2est( X )
    norm2est( X, tol )
    norm2est( X, tol, max_iter )


    normalise( V )
    normalise( V, p )

    normalise( X )
    normalise( X, p )
    normalise( X, p, dim )


    pow( A, scalar ) (form 1)
    pow( A, B ) (form 2)


    B = powmat( A, n )
    powmat( B, A, n )


    prod( V )
    prod( M )
    prod( M, dim )


    r = rank( X ) (form 1)
    r = rank( X, tolerance )
    rank( r, X ) (form 2)
    rank( r, X, tolerance )


    rcond( A )


    repelem( A, num_copies_per_row, num_copies_per_col )


    repmat( A, num_copies_per_row, num_copies_per_col )


    reshape( X, n_rows, n_cols ) (X is a vector or matrix)
    reshape( X, size(Y) )

    reshape( Q, n_rows, n_cols, n_slices ) (Q is a cube)
    reshape( Q, size(R) )


    resize( X, n_rows, n_cols ) (X is a vector or matrix)
    resize( X, size(Y) )

    resize( Q, n_rows, n_cols, n_slices ) (Q is a cube)
    resize( Q, size(R) )


    reverse( V )
    reverse( X )
    reverse( X, dim )


    R = roots( P )
    roots( R, P )


    shift( V, N )
    shift( X, N )
    shift( X, N, dim )


    shuffle( V )
    shuffle( X )
    shuffle( X, dim )


    size( X )
    size( n_rows, n_cols )
    size( n_rows, n_cols, n_slices )


    sort( V )
    sort( V, sort_direction )

    sort( X )
    sort( X, sort_direction )
    sort( X, sort_direction, dim )


    sort_index( X )
    sort_index( X, sort_direction )

    stable_sort_index( X )
    stable_sort_index( X, sort_direction )


    B = sqrtmat( A )
    sqrtmat( B, A )


    B = sqrtmat_sympd( A )
    sqrtmat_sympd( B, A )


    sum( V )
    sum( M )
    sum( M, dim )
    sum( Q )
    sum( Q, dim )


    uword index = sub2ind( size(M), row, col ) (M is a matrix)
    uvec indices = sub2ind( size(M), matrix_of_subscripts )
    uword index = sub2ind( size(Q), row, col, slice ) (Q is a cube)
    uvec indices = sub2ind( size(Q), matrix_of_subscripts )


    symmatu( A )
    symmatu( A, do_conj )

    symmatl( A )
    symmatl( A, do_conj )


    trace( X )


    trans( A )
    strans( A )


    trapz( X, Y )
    trapz( X, Y, dim )

    trapz( Y )
    trapz( Y, dim )


    trimatu( A )
    trimatu( A, k )

    trimatl( A )
    trimatl( A, k )


    trimatu_ind( size(A) )
    trimatu_ind( size(A), k )

    trimatl_ind( size(A) )
    trimatl_ind( size(A), k )


    unique( A )


    vecnorm( X )
    vecnorm( X, p )
    vecnorm( X, p, dim )


    vectorise( X )
    vectorise( X, dim )
    vectorise( Q )


    miscellaneous element-wise functions:


    trigonometric element-wise functions (cos, sin, tan, ...)



    Decompositions, Factorisations, Inverses and Equation Solvers (Dense Matrices)



    R = chol( X ) (form 1)
    R = chol( X, layout ) (form 2)
    chol( R, X ) (form 3)
    chol( R, X, layout ) (form 4)
    chol( R, P, X, layout, "vector" ) (form 5)
    chol( R, P, X, layout, "matrix" ) (form 6)


    vec eigval = eig_sym( X )

    eig_sym( eigval, X )

    eig_sym( eigval, eigvec, X )
    eig_sym( eigval, eigvec, X, method )


    cx_vec eigval = eig_gen( X )
    cx_vec eigval = eig_gen( X, bal )

    eig_gen( eigval, X )
    eig_gen( eigval, X, bal )

    eig_gen( eigval, eigvec, X )
    eig_gen( eigval, eigvec, X, bal )

    eig_gen( eigval, leigvec, reigvec, X )
    eig_gen( eigval, leigvec, reigvec, X, bal )


    cx_vec eigval = eig_pair( A, B )

    eig_pair( eigval, A, B )

    eig_pair( eigval, eigvec, A, B )

    eig_pair( eigval, leigvec, reigvec, A, B )


    H = hess( X )

    hess( H, X )

    hess( U, H, X )


    B = inv( A )
    B = inv( A, settings )

    inv( B, A )
    inv( B, A, settings )

    inv( B, rcond, A )


    B = inv_sympd( A )
    B = inv_sympd( A, settings )

    inv_sympd( B, A )
    inv_sympd( B, A, settings )

    inv_sympd( B, rcond, A )


    lu( L, U, P, X )
    lu( L, U, X )


    B = null( A )
    B = null( A, tolerance )

    null( B, A )
    null( B, A, tolerance )


    B = orth( A )
    B = orth( A, tolerance )

    orth( B, A )
    orth( B, A, tolerance )


    B = pinv( A )
    B = pinv( A, tolerance )
    B = pinv( A, tolerance, method )

    pinv( B, A )
    pinv( B, A, tolerance )
    pinv( B, A, tolerance, method )


    qr( Q, R, X ) (form 1)
    qr( Q, R, P, X, "vector" ) (form 2)
    qr( Q, R, P, X, "matrix" ) (form 3)


    qr_econ( Q, R, X )


    qz( AA, BB, Q, Z, A, B )
    qz( AA, BB, Q, Z, A, B, select )


    S = schur( X )

    schur( S, X )

    schur( U, S, X )


    X = solve( A, B )
    X = solve( A, B, settings )

    solve( X, A, B )
    solve( X, A, B, settings )


    vec s = svd( X )

    svd( vec s, X )

    svd( mat U, vec s, mat V, mat X )
    svd( mat U, vec s, mat V, mat X, method )

    svd( cx_mat U, vec s, cx_mat V, cx_mat X )
    svd( cx_mat U, vec s, cx_mat V, cx_mat X, method )


    svd_econ( mat U, vec s, mat V, mat X )
    svd_econ( mat U, vec s, mat V, mat X, mode )
    svd_econ( mat U, vec s, mat V, mat X, mode, method )

    svd_econ( cx_mat U, vec s, cx_mat V, cx_mat X )
    svd_econ( cx_mat U, vec s, cx_mat V, cx_mat X, mode )
    svd_econ( cx_mat U, vec s, cx_mat V, cx_mat X, mode, method )


    X = syl( A, B, C )
    syl( X, A, B, C )



    Decompositions, Factorisations and Equation Solvers (Sparse Matrices)



    vec eigval = eigs_sym( X, k )
    vec eigval = eigs_sym( X, k, form )
    vec eigval = eigs_sym( X, k, form, opts )
    vec eigval = eigs_sym( X, k, sigma )
    vec eigval = eigs_sym( X, k, sigma, opts )

    eigs_sym( eigval, X, k )
    eigs_sym( eigval, X, k, form )
    eigs_sym( eigval, X, k, form, opts )
    eigs_sym( eigval, X, k, sigma )
    eigs_sym( eigval, X, k, sigma, opts )

    eigs_sym( eigval, eigvec, X, k )
    eigs_sym( eigval, eigvec, X, k, form )
    eigs_sym( eigval, eigvec, X, k, form, opts )
    eigs_sym( eigval, eigvec, X, k, sigma )
    eigs_sym( eigval, eigvec, X, k, sigma, opts )


    cx_vec eigval = eigs_gen( X, k )
    cx_vec eigval = eigs_gen( X, k, form )
    cx_vec eigval = eigs_gen( X, k, sigma )
    cx_vec eigval = eigs_gen( X, k, form, opts )
    cx_vec eigval = eigs_gen( X, k, sigma, opts )

    eigs_gen( eigval, X, k )
    eigs_gen( eigval, X, k, form )
    eigs_gen( eigval, X, k, sigma )
    eigs_gen( eigval, X, k, form, opts )
    eigs_gen( eigval, X, k, sigma, opts )

    eigs_gen( eigval, eigvec, X, k )
    eigs_gen( eigval, eigvec, X, k, form )
    eigs_gen( eigval, eigvec, X, k, sigma )
    eigs_gen( eigval, eigvec, X, k, form, opts )
    eigs_gen( eigval, eigvec, X, k, sigma, opts )


    vec s = svds( X, k )
    vec s = svds( X, k, tol )

    svds( vec s, X, k )
    svds( vec s, X, k, tol )

    svds( mat U, vec s, mat V, sp_mat X, k )
    svds( mat U, vec s, mat V, sp_mat X, k, tol )

    svds( cx_mat U, vec s, cx_mat V, sp_cx_mat X, k )
    svds( cx_mat U, vec s, cx_mat V, sp_cx_mat X, k, tol )


    X = spsolve( A, B )
    X = spsolve( A, B, solver )
    X = spsolve( A, B, solver, opts )

    spsolve( X, A, B )
    spsolve( X, A, B, solver )
    spsolve( X, A, B, solver, opts )


    spsolve_factoriser




    Signal & Image Processing



    conv( A, B )
    conv( A, B, shape )


    conv2( A, B )
    conv2( A, B, shape )


    cx_mat Y = fft( X )
    cx_mat Y = fft( X, n )

    cx_mat Z = ifft( cx_mat Y )
    cx_mat Z = ifft( cx_mat Y, n )


    cx_mat Y = fft2( X )
    cx_mat Y = fft2( X, n_rows, n_cols )

    cx_mat Z = ifft2( cx_mat Y )
    cx_mat Z = ifft2( cx_mat Y, n_rows, n_cols )


    interp1( X, Y, XI, YI )
    interp1( X, Y, XI, YI, method )
    interp1( X, Y, XI, YI, method, extrapolation_value )


    interp2( X, Y, Z, XI, YI, ZI )
    interp2( X, Y, Z, XI, YI, ZI, method )
    interp2( X, Y, Z, XI, YI, ZI, method, extrapolation_value )


    P = polyfit( X, Y, N )
    polyfit( P, X, Y, N )


    Y = polyval( P, X )



    Statistics & Clustering



    mean, median, stddev, var, range


    cov( X, Y )
    cov( X, Y, norm_type )

    cov( X )
    cov( X, norm_type )


    cor( X, Y )
    cor( X, Y, norm_type )

    cor( X )
    cor( X, norm_type )


    hist( V )
    hist( V, n_bins )
    hist( V, centers )

    hist( X, centers )
    hist( X, centers, dim )


    histc( V, edges )
    histc( X, edges )
    histc( X, edges, dim )


    quantile( V, P )
    quantile( X, P )
    quantile( X, P, dim )


    mat coeff = princomp( mat X )
    cx_mat coeff = princomp( cx_mat X )

    princomp( mat coeff, mat X )
    princomp( cx_mat coeff, cx_mat X )

    princomp( mat coeff, mat score, mat X )
    princomp( cx_mat coeff, cx_mat score, cx_mat X )

    princomp( mat coeff, mat score, vec latent, mat X )
    princomp( cx_mat coeff, cx_mat score, vec latent, cx_mat X )

    princomp( mat coeff, mat score, vec latent, vec tsquared, mat X )
    princomp( cx_mat coeff, cx_mat score, vec latent, cx_vec tsquared, cx_mat X )


    normpdf( X )
    normpdf( X, M, S )


    log_normpdf( X )
    log_normpdf( X, M, S )


    normcdf( X )
    normcdf( X, M, S )


    X = mvnrnd( M, C )
    X = mvnrnd( M, C, N )

    mvnrnd( X, M, C )
    mvnrnd( X, M, C, N )


    chi2rnd( DF )
    chi2rnd( DF_scalar )
    chi2rnd( DF_scalar, n_elem )
    chi2rnd( DF_scalar, n_rows, n_cols )
    chi2rnd( DF_scalar, size(X) )


    W = wishrnd( S, df )
    W = wishrnd( S, df, D )

    wishrnd( W, S, df )
    wishrnd( W, S, df, D )


    W = iwishrnd( T, df )
    W = iwishrnd( T, df, Dinv )

    iwishrnd( W, T, df )
    iwishrnd( W, T, df, Dinv )


    running_stat<type>


    running_stat_vec<vec_type>
    running_stat_vec<vec_type>(calc_cov)


    kmeans( means, data, k, seed_mode, n_iter, print_mode )


    gmm_diag
    gmm_full



    Miscellaneous



    constants (pi, inf, eps, ...)


    wall_clock


    RNG seed setting


    output streams


    uword, sword


    cx_double, cx_float


    Examples of Matlab/Octave syntax and conceptually corresponding Armadillo syntax




    example program



    config.hpp


    History of API Additions and Changes


    sourceforge

    AltStyle によって変換されたページ (->オリジナル) /