GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "dDiagMatrix.h"
Protected Types | |
typedef bool(* | compare_fcn_type )(typename ref_param< double >::type, typename ref_param< double >::type) |
typedef ref_param< double >::type | crefT |
typedef double | element_type |
Protected Member Functions | |
Array< double > | as_column (void) const |
Return the array as a column vector. More... | |
Array< double > | as_matrix (void) const |
Return the array as a matrix. More... | |
Array< double > | as_row (void) const |
Return the array as a row vector. More... | |
double & | checkelem (octave_idx_type n) |
double & | checkelem (octave_idx_type i, octave_idx_type j, octave_idx_type k) |
double & | checkelem (const Array< octave_idx_type > &ra_idx) |
crefT | checkelem (octave_idx_type n) const |
crefT | checkelem (octave_idx_type i, octave_idx_type j, octave_idx_type k) const |
crefT | checkelem (const Array< octave_idx_type > &ra_idx) const |
void | clear (void) |
void | clear (const dim_vector &dv) |
void | clear (octave_idx_type r, octave_idx_type c) |
octave_idx_type | compute_index (octave_idx_type i, octave_idx_type j) const |
octave_idx_type | compute_index (octave_idx_type i, octave_idx_type j, octave_idx_type k) const |
octave_idx_type | compute_index (const Array< octave_idx_type > &ra_idx) const |
octave_idx_type | compute_index_unchecked (const Array< octave_idx_type > &ra_idx) const |
double & | elem (octave_idx_type n) |
double & | elem (octave_idx_type i, octave_idx_type j, octave_idx_type k) |
double & | elem (const Array< octave_idx_type > &ra_idx) |
crefT | elem (octave_idx_type n) const |
crefT | elem (octave_idx_type i, octave_idx_type j, octave_idx_type k) const |
crefT | elem (const Array< octave_idx_type > &ra_idx) const |
Array< octave_idx_type > | find (octave_idx_type n=-1, bool backward=false) const |
Find indices of (at most n) nonzero elements. More... | |
Array< double > & | insert (const Array< double > &a, const Array< octave_idx_type > &idx) |
Insert an array into another at a specified position. More... | |
Array< double > & | insert (const Array< double > &a, octave_idx_type r, octave_idx_type c) |
This is just a special case for idx = [r c 0 ...]. More... | |
Array< double > | ipermute (const Array< octave_idx_type > &vec) const |
bool | is_empty (void) const |
bool | is_shared (void) |
sortmode | is_sorted (sortmode mode=UNSORTED) const |
Ordering is auto-detected or can be specified. More... | |
sortmode | is_sorted_rows (sortmode mode=UNSORTED) const |
Ordering is auto-detected or can be specified. More... | |
bool | is_square (void) const |
bool | is_vector (void) const |
Array< double > | linear_slice (octave_idx_type lo, octave_idx_type up) const |
Extract a slice from this array as a column vector: A(:)(lo+1:up). More... | |
octave_idx_type | lookup (const double &value, sortmode mode=UNSORTED) const |
Do a binary lookup in a sorted array. More... | |
Array< octave_idx_type > | lookup (const Array< double > &values, sortmode mode=UNSORTED) const |
Ditto, but for an array of values, specializing on the case when values are sorted. More... | |
void | make_unique (void) |
Array< U > | map (F fcn) const |
Apply function fcn to each element of the Array<T>. More... | |
void | maybe_economize (void) |
void * | mex_get_data (void) const |
Give a pointer to the data in mex format. More... | |
int | ndims (void) const |
Array< double > | nth_element (const idx_vector &n, int dim=0) const |
Returns the n-th element in increasing order, using the same ordering as used for sort. More... | |
double & | operator() (octave_idx_type n) |
double & | operator() (octave_idx_type i, octave_idx_type j, octave_idx_type k) |
double & | operator() (const Array< octave_idx_type > &ra_idx) |
crefT | operator() (octave_idx_type n) const |
crefT | operator() (octave_idx_type i, octave_idx_type j, octave_idx_type k) const |
crefT | operator() (const Array< octave_idx_type > &ra_idx) const |
bool | optimize_dimensions (const dim_vector &dv) |
Returns true if this->dims () == dv, and if so, replaces this->dimensions by a shallow copy of dv. More... | |
Array< double > | page (octave_idx_type k) const |
Extract page: A(:,:,k+1). More... | |
Array< double > | permute (const Array< octave_idx_type > &vec, bool inv=false) const |
Array< double > | reshape (octave_idx_type nr, octave_idx_type nc) const |
Array< double > | reshape (const dim_vector &new_dims) const |
virtual double | resize_fill_value (void) const |
Array< double > | sort (int dim=0, sortmode mode=ASCENDING) const |
Array< double > | sort (Array< octave_idx_type > &sidx, int dim=0, sortmode mode=ASCENDING) const |
Array< octave_idx_type > | sort_rows_idx (sortmode mode=ASCENDING) const |
Sort by rows returns only indices. More... | |
Array< double > | squeeze (void) const |
Chop off leading singleton dimensions. More... | |
bool | test (F fcn) const |
Generic any/all test functionality with arbitrary predicate. More... | |
double & | xelem (octave_idx_type n) |
crefT | xelem (octave_idx_type n) const |
double & | xelem (octave_idx_type i, octave_idx_type j) |
double & | xelem (octave_idx_type i, octave_idx_type j, octave_idx_type k) |
crefT | xelem (octave_idx_type i, octave_idx_type j, octave_idx_type k) const |
double & | xelem (const Array< octave_idx_type > &ra_idx) |
crefT | xelem (const Array< octave_idx_type > &ra_idx) const |
void | resize (const dim_vector &dv, const double &rfv) |
void | resize (const dim_vector &dv) |
void | resize2 (octave_idx_type nr, octave_idx_type nc, const double &rfv) |
Resizing (with fill). More... | |
void | resize2 (octave_idx_type nr, octave_idx_type nc) |
void | resize1 (octave_idx_type n, const double &rfv) |
void | resize1 (octave_idx_type n) |
octave_idx_type | capacity (void) const |
Number of elements in the array. More... | |
Third dimension | |
Get the third dimension of the array (number of pages) | |
octave_idx_type | dim3 (void) const |
octave_idx_type | pages (void) const |
Array< double > | index (const idx_vector &i) const |
Indexing without resizing. More... | |
Array< double > | index (const idx_vector &i, const idx_vector &j) const |
Array< double > | index (const Array< idx_vector > &ia) const |
Array< double > | index (const idx_vector &i, bool resize_ok, const double &rfv) const |
Indexing with possible resizing and fill. More... | |
Array< double > | index (const idx_vector &i, bool resize_ok) const |
Array< double > | index (const idx_vector &i, const idx_vector &j, bool resize_ok, const double &rfv) const |
Array< double > | index (const idx_vector &i, const idx_vector &j, bool resize_ok) const |
Array< double > | index (const Array< idx_vector > &ia, bool resize_ok, const double &rfv) const |
Array< double > | index (const Array< idx_vector > &ia, bool resize_ok) const |
void | assign (const idx_vector &i, const Array< double > &rhs, const double &rfv) |
Indexed assignment (always with resize & fill). More... | |
void | assign (const idx_vector &i, const Array< double > &rhs) |
void | assign (const idx_vector &i, const idx_vector &j, const Array< double > &rhs, const double &rfv) |
void | assign (const idx_vector &i, const idx_vector &j, const Array< double > &rhs) |
void | assign (const Array< idx_vector > &ia, const Array< double > &rhs, const double &rfv) |
void | assign (const Array< idx_vector > &ia, const Array< double > &rhs) |
void | delete_elements (const idx_vector &i) |
Deleting elements. More... | |
void | delete_elements (int dim, const idx_vector &i) |
A(:,...,I,...,:) = [] (>= 2 subscripts, one of them is non-colon) More... | |
void | delete_elements (const Array< idx_vector > &ia) |
Dispatcher to the above two. More... | |
Array< U > | map (U(&fcn)(double)) const |
Overloads for function references. More... | |
Array< U > | map (U(&fcn)(const double &)) const |
bool | test_any (F fcn) const |
Simpler calls. More... | |
bool | test_all (F fcn) const |
bool | test_any (bool(&fcn)(double)) const |
Overloads for function references. More... | |
bool | test_any (bool(&fcn)(const double &)) const |
bool | test_all (bool(&fcn)(double)) const |
bool | test_all (bool(&fcn)(const double &)) const |
int * | jit_ref_count (void) |
WARNING: Only call these functions from jit. More... | |
double * | jit_slice_data (void) const |
octave_idx_type * | jit_dimensions (void) const |
void * | jit_array_rep (void) const |
Static Protected Member Functions | |
static Array< double > | cat (int dim, octave_idx_type n, const Array< double > *array_list) |
Concatenation along a specified (0-based) dimension, equivalent to cat(). More... | |
Protected Attributes | |
octave_idx_type | d1 |
octave_idx_type | d2 |
dim_vector | dimensions |
Array< double >::ArrayRep * | rep |
double * | slice_data |
octave_idx_type | slice_len |
Friends | |
class | ComplexSVD |
OCTAVE_API DiagMatrix | imag (const ComplexDiagMatrix &a) |
OCTAVE_API std::ostream & | operator<< (std::ostream &os, const DiagMatrix &a) |
OCTAVE_API DiagMatrix | real (const ComplexDiagMatrix &a) |
class | SVD |
Definition at line 34 of file dDiagMatrix.h.
|
inline |
Definition at line 43 of file dDiagMatrix.h.
|
inline |
Definition at line 45 of file dDiagMatrix.h.
|
inline |
Definition at line 48 of file dDiagMatrix.h.
|
inline |
Definition at line 51 of file dDiagMatrix.h.
|
inline |
Definition at line 53 of file dDiagMatrix.h.
|
inline |
Definition at line 56 of file dDiagMatrix.h.
Definition at line 58 of file dDiagMatrix.h.
|
inline |
Definition at line 60 of file dDiagMatrix.h.
DiagMatrix DiagMatrix::abs | ( | void | ) | const |
Definition at line 142 of file dDiagMatrix.cc.
References DiagArray2< double >::columns(), DiagMatrix(), extract_diag(), and DiagArray2< double >::rows().
Referenced by octave_diag_matrix::map().
|
inlineinherited |
Definition at line 72 of file MDiagArray2.h.
|
inherited |
Indexed assignment (always with resize & fill).
|
inlineinherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inlineinherited |
Definition at line 102 of file DiagArray2.h.
|
inlineinherited |
Definition at line 96 of file DiagArray2.h.
|
inlineinherited |
|
staticinherited |
Concatenation along a specified (0-based) dimension, equivalent to cat().
dim = -1 corresponds to dim = 0 and dim = -2 corresponds to dim = 1, but apply the looser matching rules of vertcat/horzcat.
|
inlineinherited |
Definition at line 127 of file DiagArray2.h.
|
inlineinherited |
Definition at line 141 of file DiagArray2.h.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 87 of file DiagArray2.h.
Referenced by column(), determinant(), inverse(), operator==(), pseudo_inverse(), and row().
ColumnVector DiagMatrix::column | ( | octave_idx_type | i | ) | const |
Definition at line 220 of file dDiagMatrix.cc.
References DiagArray2< double >::cols(), DiagArray2< double >::elem(), Array< T >::elem(), and DiagArray2< double >::rows().
Referenced by column().
ColumnVector DiagMatrix::column | ( | char * | s | ) | const |
Definition at line 238 of file dDiagMatrix.cc.
References DiagArray2< double >::cols(), and column().
|
inlineinherited |
Definition at line 88 of file DiagArray2.h.
Referenced by abs().
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 180 of file DiagArray2.h.
Referenced by operator==().
|
inherited |
Deleting elements.
A(I) = [] (with a single subscript)
|
inherited |
A(:,...,I,...,:) = [] (>= 2 subscripts, one of them is non-colon)
|
inherited |
Dispatcher to the above two.
DET DiagMatrix::determinant | ( | void | ) | const |
Definition at line 347 of file dDiagMatrix.cc.
References DiagArray2< double >::cols(), DiagArray2< double >::elem(), DiagArray2< double >::length(), and DiagArray2< double >::rows().
Referenced by Fdet().
|
inlineinherited |
Definition at line 121 of file DiagArray2.h.
|
inlineinherited |
Definition at line 124 of file DiagArray2.h.
|
inlineinherited |
Definition at line 163 of file DiagArray2.h.
|
inlineinherited |
Definition at line 166 of file DiagArray2.h.
|
inlineinherited |
Definition at line 94 of file MDiagArray2.h.
|
inherited |
|
inlineinherited |
Definition at line 90 of file DiagArray2.h.
|
inlineinherited |
Definition at line 83 of file DiagArray2.h.
|
inlineinherited |
Definition at line 84 of file DiagArray2.h.
|
inlineinherited |
|
inlineinherited |
Definition at line 98 of file DiagArray2.h.
|
inlineinherited |
Definition at line 110 of file DiagArray2.h.
Referenced by column(), determinant(), extract(), fill(), inverse(), pseudo_inverse(), and row().
|
inlineinherited |
Definition at line 115 of file DiagArray2.h.
|
inlineinherited |
Definition at line 380 of file Array.h.
Referenced by NDArray::all_integers(), Matrix::column_max(), Matrix::column_min(), NDArray::concat(), Matrix::determinant(), RowVector::extract(), ColumnVector::extract(), RowVector::extract_n(), ColumnVector::extract_n(), Matrix::is_symmetric(), Matrix::Matrix(), RowVector::max(), ColumnVector::max(), RowVector::min(), ColumnVector::min(), Matrix::operator+=(), Matrix::operator-=(), Matrix::row_max(), and Matrix::row_min().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Matrix DiagMatrix::extract | ( | octave_idx_type | r1, |
octave_idx_type | c1, | ||
octave_idx_type | r2, | ||
octave_idx_type | c2 | ||
) | const |
Definition at line 160 of file dDiagMatrix.cc.
References DiagArray2< double >::elem(), and Array< T >::elem().
|
inline |
Definition at line 105 of file dDiagMatrix.h.
References DiagArray2< T >::extract_diag().
Referenced by abs(), Fsvd(), octave_diag_matrix::map(), null(), Matrix::pseudo_inverse(), ComplexMatrix::pseudo_inverse(), rcond(), and octave_diag_matrix::save_binary().
DiagMatrix & DiagMatrix::fill | ( | double | val | ) |
Definition at line 55 of file dDiagMatrix.cc.
References DiagArray2< double >::elem(), and DiagArray2< double >::length().
DiagMatrix & DiagMatrix::fill | ( | double | val, |
octave_idx_type | beg, | ||
octave_idx_type | end | ||
) |
Definition at line 63 of file dDiagMatrix.cc.
References DiagArray2< double >::elem(), and DiagArray2< double >::length().
DiagMatrix & DiagMatrix::fill | ( | const ColumnVector & | a | ) |
Definition at line 78 of file dDiagMatrix.cc.
References DiagArray2< double >::elem(), Array< T >::elem(), DiagArray2< double >::length(), and Array< T >::length().
DiagMatrix & DiagMatrix::fill | ( | const RowVector & | a | ) |
Definition at line 94 of file dDiagMatrix.cc.
References DiagArray2< double >::elem(), Array< T >::elem(), DiagArray2< double >::length(), and Array< T >::length().
DiagMatrix & DiagMatrix::fill | ( | const ColumnVector & | a, |
octave_idx_type | beg | ||
) |
Definition at line 110 of file dDiagMatrix.cc.
References DiagArray2< double >::elem(), Array< T >::elem(), DiagArray2< double >::length(), and Array< T >::length().
DiagMatrix & DiagMatrix::fill | ( | const RowVector & | a, |
octave_idx_type | beg | ||
) |
Definition at line 126 of file dDiagMatrix.cc.
References DiagArray2< double >::elem(), Array< T >::elem(), DiagArray2< double >::length(), and Array< T >::length().
|
inherited |
Find indices of (at most n) nonzero elements.
If n is specified, backward specifies search from backward.
|
inlineinherited |
Definition at line 182 of file DiagArray2.h.
|
inlineinherited |
Definition at line 184 of file DiagArray2.h.
|
inlineinherited |
Definition at line 98 of file MDiagArray2.h.
|
inherited |
Indexing without resizing.
Referenced by Matrix::column(), Matrix::extract(), Matrix::extract_n(), and Matrix::row().
|
inherited |
|
inherited |
Indexing with possible resizing and fill.
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
Insert an array into another at a specified position.
If size (a) is [d1 d2 ... dN] and idx is [i1 i2 ... iN], this method is equivalent to x(i1:i1+d1-1, i2:i2+d2-1, ... , iN:iN+dN-1) = a.
|
inherited |
This is just a special case for idx = [r c 0 ...].
DiagMatrix DiagMatrix::inverse | ( | void | ) | const |
Definition at line 259 of file dDiagMatrix.cc.
Referenced by Finv().
DiagMatrix DiagMatrix::inverse | ( | octave_idx_type & | info | ) | const |
Definition at line 266 of file dDiagMatrix.cc.
References DiagArray2< double >::cols(), DiagMatrix(), DiagArray2< double >::elem(), DiagArray2< T >::elem(), DiagArray2< double >::length(), and DiagArray2< double >::rows().
|
inherited |
Ordering is auto-detected or can be specified.
Definition at line 92 of file Array-d.cc.
References ASCENDING, DESCENDING, UNSORTED, and xisnan().
Ordering is auto-detected or can be specified.
Definition at line 470 of file Array.h.
Referenced by Matrix::is_symmetric().
|
inlineinherited |
|
inlineinherited |
Definition at line 92 of file DiagArray2.h.
Referenced by determinant(), fill(), inverse(), operator==(), and pseudo_inverse().
|
inherited |
Extract a slice from this array as a column vector: A(:)(lo+1:up).
Must be 0 <= lo && up <= numel. May be up < lo.
|
inherited |
Do a binary lookup in a sorted array.
Must not contain NaNs. Mode can be specified or is auto-detected by comparing 1st and last element.
|
inherited |
Ditto, but for an array of values, specializing on the case when values are sorted.
NaNs get the value N.
Definition at line 104 of file Array.h.
Referenced by RowVector::fill(), ColumnVector::fill(), Matrix::fill(), RowVector::insert(), ColumnVector::insert(), and Matrix::insert().
|
inlineinherited |
Definition at line 93 of file DiagArray2.h.
|
inlineinherited |
Definition at line 77 of file MDiagArray2.h.
Returns the n-th element in increasing order, using the same ordering as used for sort.
n can either be a scalar index or a contiguous range.
|
inlineinherited |
Definition at line 94 of file DiagArray2.h.
bool DiagMatrix::operator!= | ( | const DiagMatrix & | a | ) | const |
Definition at line 49 of file dDiagMatrix.cc.
|
inlineinherited |
Definition at line 132 of file DiagArray2.h.
|
inlineinherited |
Definition at line 147 of file DiagArray2.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Definition at line 63 of file dDiagMatrix.h.
References MDiagArray2< T >::operator=().
bool DiagMatrix::operator== | ( | const DiagMatrix & | a | ) | const |
Definition at line 40 of file dDiagMatrix.cc.
References DiagArray2< double >::cols(), DiagArray2< T >::cols(), DiagArray2< T >::data(), DiagArray2< double >::data(), DiagArray2< double >::length(), mx_inline_equal(), DiagArray2< double >::rows(), and DiagArray2< T >::rows().
|
inherited |
Returns true if this->dims () == dv, and if so, replaces this->dimensions by a shallow copy of dv.
This is useful for maintaining several arrays with supposedly equal dimensions (e.g. structs in the interpreter).
|
inherited |
Extract page: A(:,:,k+1).
|
inlineinherited |
|
inherited |
|
inlineinherited |
Definition at line 186 of file DiagArray2.h.
DiagMatrix DiagMatrix::pseudo_inverse | ( | double | tol = 0.0 | ) | const |
Definition at line 295 of file dDiagMatrix.cc.
References abs(), DiagArray2< double >::cols(), DiagArray2< double >::elem(), DiagArray2< T >::elem(), DiagArray2< double >::length(), and DiagArray2< double >::rows().
Referenced by Fpinv().
double DiagMatrix::rcond | ( | void | ) | const |
Definition at line 366 of file dDiagMatrix.cc.
References extract_diag(), Array< T >::map(), ColumnVector::max(), and ColumnVector::min().
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inlineinherited |
Definition at line 170 of file DiagArray2.h.
|
inherited |
Referenced by NDArray::NDArray().
|
inlineinherited |
|
inherited |
|
inlineinherited |
|
inherited |
Resizing (with fill).
|
inlineinherited |
RowVector DiagMatrix::row | ( | octave_idx_type | i | ) | const |
Definition at line 181 of file dDiagMatrix.cc.
References DiagArray2< double >::cols(), DiagArray2< double >::elem(), Array< T >::elem(), and DiagArray2< double >::rows().
Referenced by row().
Definition at line 199 of file dDiagMatrix.cc.
References row(), and DiagArray2< double >::rows().
|
inlineinherited |
Definition at line 86 of file DiagArray2.h.
Referenced by abs(), column(), determinant(), inverse(), operator==(), pseudo_inverse(), and row().
Referenced by SCHUR::init().
|
inherited |
Sort by rows returns only indices.
Chop off leading singleton dimensions.
Definition at line 714 of file Array.h.
Referenced by NDArray::all_elements_are_int_or_inf_or_nan(), NDArray::all_elements_are_zero(), NDArray::all_integers(), NDArray::any_element_is_negative(), NDArray::any_element_is_positive(), and NDArray::any_element_not_one_or_zero().
Simpler calls.
Definition at line 710 of file Array.h.
Referenced by NDArray::too_large_for_float().
|
inline |
Definition at line 79 of file dDiagMatrix.h.
References MDiagArray2< T >::transpose().
|
inlineinherited |
Definition at line 158 of file DiagArray2.h.
|
inlineinherited |
Definition at line 353 of file Array.h.
Referenced by RowVector::fill(), ColumnVector::fill(), Matrix::fill(), RowVector::insert(), ColumnVector::insert(), Matrix::insert(), and NDArray::NDArray().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
friend |
Definition at line 39 of file dDiagMatrix.h.
|
friend |
Definition at line 154 of file dDiagMatrix.cc.
|
friend |
Definition at line 375 of file dDiagMatrix.cc.
|
friend |
Definition at line 148 of file dDiagMatrix.cc.
|
friend |
Definition at line 38 of file dDiagMatrix.h.
|
protectedinherited |
Definition at line 42 of file DiagArray2.h.
|
protectedinherited |
Definition at line 42 of file DiagArray2.h.
|
protectedinherited |
|
protectedinherited |