GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include <cassert>
#include <cfloat>
#include <cmath>
#include <iostream>
#include <vector>
#include "oct-cmplx.h"
#include "lo-error.h"
#include "lo-ieee.h"
#include "mx-cm-s.h"
#include "mx-s-cm.h"
#include "mx-fcm-fs.h"
#include "mx-fs-fcm.h"
#include "Array.h"
#include "Array-util.h"
#include "CMatrix.h"
#include "dMatrix.h"
#include "fCMatrix.h"
#include "fMatrix.h"
#include "CColVector.h"
#include "dColVector.h"
#include "CRowVector.h"
#include "dRowVector.h"
#include "fCColVector.h"
#include "fColVector.h"
#include "fCRowVector.h"
#include "fRowVector.h"
#include "CSparse.h"
#include "dSparse.h"
#include "dbleSVD.h"
#include "CmplxSVD.h"
#include "floatSVD.h"
#include "fCmplxSVD.h"
Go to the source code of this file.
Classes | |
class | norm_accumulator_0< R > |
class | norm_accumulator_1< R > |
class | norm_accumulator_2< R > |
class | norm_accumulator_inf< R > |
class | norm_accumulator_minf< R > |
class | norm_accumulator_mp< R > |
class | norm_accumulator_p< R > |
Macros | |
#define | DEFINE_COLROW_NORM_FUNCS(PREFIX, RPREFIX, RTYPE) |
#define | DEFINE_DISPATCHER(FUNC_NAME, ARG_TYPE, RES_TYPE) |
#define | DEFINE_XNORM_FUNCS(PREFIX, RTYPE) |
#define | DEFINE_XNORM_SPARSE_FUNCS(PREFIX, RTYPE) |
Functions | |
template<class T , class R > | |
void | array_norm_2 (const T *v, octave_idx_type n, R &res) |
template<class T , class R , class ACC > | |
void | column_norms (const MArray< T > &m, MArray< R > &res, ACC acc) |
template<class T , class R , class ACC > | |
void | column_norms (const MSparse< T > &m, MArray< R > &res, ACC acc) |
template<class T , class R > | |
MArray< R > | column_norms (const MArray< T > &v, R p) |
template<class T , class R > | |
MArray< R > | column_norms (const MSparse< T > &v, R p) |
template<class VectorT , class R > | |
VectorT | dual_p (const VectorT &x, R p, R q) |
template<class T , class R > | |
T | elem_dual_p (T x, R p) |
template<class MatrixT , class VectorT , class R > | |
R | higham (const MatrixT &m, R p, R tol, int maxiter, VectorT &x) |
template<class ColVectorT , class R > | |
static void | higham_subp (const ColVectorT &y, const ColVectorT &col, octave_idx_type nsamp, R p, R &lambda, R &mu) |
template<class ColVectorT , class R > | |
static void | higham_subp (const ColVectorT &y, const ColVectorT &col, octave_idx_type nsamp, R p, std::complex< R > &lambda, std::complex< R > &mu) |
template<class MatrixT , class VectorT , class SVDT , class R > | |
R | matrix_norm (const MatrixT &m, R p, VectorT, SVDT) |
template<class MatrixT , class VectorT , class R > | |
R | matrix_norm (const MatrixT &m, R p, VectorT) |
template<class T , class R , class ACC > | |
void | row_norms (const MArray< T > &m, MArray< R > &res, ACC acc) |
template<class T , class R , class ACC > | |
void | row_norms (const MSparse< T > &m, MArray< R > &res, ACC acc) |
template<class T , class R > | |
MArray< R > | row_norms (const MArray< T > &v, R p) |
template<class T , class R > | |
MArray< R > | row_norms (const MSparse< T > &v, R p) |
template<class T , class R , class ACC > | |
void | vector_norm (const Array< T > &v, R &res, ACC acc) |
template<class T , class R > | |
R | vector_norm (const MArray< T > &v, R p) |
OCTAVE_API RowVector | xcolnorms (const Matrix &m, double p) |
OCTAVE_API RowVector | xcolnorms (const ComplexMatrix &m, double p) |
OCTAVE_API FloatRowVector | xcolnorms (const FloatMatrix &m, float p) |
OCTAVE_API FloatRowVector | xcolnorms (const FloatComplexMatrix &m, float p) |
OCTAVE_API RowVector | xcolnorms (const SparseMatrix &m, double p) |
OCTAVE_API RowVector | xcolnorms (const SparseComplexMatrix &m, double p) |
OCTAVE_API double | xfrobnorm (const Matrix &x) |
OCTAVE_API double | xfrobnorm (const ComplexMatrix &x) |
OCTAVE_API float | xfrobnorm (const FloatMatrix &x) |
OCTAVE_API float | xfrobnorm (const FloatComplexMatrix &x) |
OCTAVE_API double | xfrobnorm (const SparseMatrix &x) |
OCTAVE_API double | xfrobnorm (const SparseComplexMatrix &x) |
OCTAVE_API double | xnorm (const RowVector &x, double p) |
OCTAVE_API double | xnorm (const ColumnVector &x, double p) |
OCTAVE_API double | xnorm (const Matrix &x, double p) |
OCTAVE_API double | xnorm (const ComplexMatrix &x, double p) |
OCTAVE_API double | xnorm (const ComplexRowVector &x, double p) |
OCTAVE_API double | xnorm (const ComplexColumnVector &x, double p) |
OCTAVE_API float | xnorm (const FloatRowVector &x, float p) |
OCTAVE_API float | xnorm (const FloatMatrix &x, float p) |
OCTAVE_API float | xnorm (const FloatColumnVector &x, float p) |
OCTAVE_API float | xnorm (const FloatComplexMatrix &x, float p) |
OCTAVE_API float | xnorm (const FloatComplexRowVector &x, float p) |
OCTAVE_API float | xnorm (const FloatComplexColumnVector &x, float p) |
OCTAVE_API double | xnorm (const SparseMatrix &x, double p) |
OCTAVE_API double | xnorm (const SparseComplexMatrix &x, double p) |
OCTAVE_API ColumnVector | xrownorms (const Matrix &m, double p) |
OCTAVE_API ColumnVector | xrownorms (const ComplexMatrix &m, double p) |
OCTAVE_API FloatColumnVector | xrownorms (const FloatMatrix &m, float p) |
OCTAVE_API FloatColumnVector | xrownorms (const FloatComplexMatrix &m, float p) |
OCTAVE_API ColumnVector | xrownorms (const SparseMatrix &m, double p) |
OCTAVE_API ColumnVector | xrownorms (const SparseComplexMatrix &m, double p) |
Variables | |
static int | max_norm_iter = 100 |
static const char * | p_less1_gripe = "xnorm: p must be at least 1" |
#define DEFINE_COLROW_NORM_FUNCS | ( | PREFIX, | |
RPREFIX, | |||
RTYPE | |||
) |
Definition at line 565 of file oct-norm.cc.
#define DEFINE_DISPATCHER | ( | FUNC_NAME, | |
ARG_TYPE, | |||
RES_TYPE | |||
) |
Definition at line 291 of file oct-norm.cc.
#define DEFINE_XNORM_FUNCS | ( | PREFIX, | |
RTYPE | |||
) |
Definition at line 526 of file oct-norm.cc.
#define DEFINE_XNORM_SPARSE_FUNCS | ( | PREFIX, | |
RTYPE | |||
) |
Definition at line 552 of file oct-norm.cc.
|
inline |
Definition at line 543 of file oct-norm.cc.
References norm_accumulator_2< R >::accum().
void column_norms | ( | const MArray< T > & | m, |
MArray< R > & | res, | ||
ACC | acc | ||
) |
Definition at line 232 of file oct-norm.cc.
References Array< T >::columns(), Array< T >::rows(), and Array< T >::xelem().
void column_norms | ( | const MSparse< T > & | m, |
MArray< R > & | res, | ||
ACC | acc | ||
) |
Definition at line 262 of file oct-norm.cc.
References Sparse< T >::cidx(), Sparse< T >::columns(), Sparse< T >::data(), and Array< T >::xelem().
Definition at line 317 of file oct-norm.cc.
Definition at line 319 of file oct-norm.cc.
VectorT dual_p | ( | const VectorT & | x, |
R | p, | ||
R | q | ||
) |
Definition at line 409 of file oct-norm.cc.
References elem_dual_p(), vector_norm(), and x.
Referenced by higham().
|
inline |
R higham | ( | const MatrixT & | m, |
R | p, | ||
R | tol, | ||
int | maxiter, | ||
VectorT & | x | ||
) |
Definition at line 419 of file oct-norm.cc.
References dual_p(), gamma(), higham_subp(), vector_norm(), and x.
Referenced by matrix_norm().
|
static |
Definition at line 327 of file oct-norm.cc.
References abs(), fi, pow(), and vector_norm().
Referenced by higham().
|
static |
Definition at line 355 of file oct-norm.cc.
References abs(), fi, pow(), and vector_norm().
R matrix_norm | ( | const MatrixT & | m, |
R | p, | ||
VectorT | , | ||
SVDT | |||
) |
Definition at line 479 of file oct-norm.cc.
References current_liboctave_error_handler, higham(), lo_ieee_isinf, RowVector::max(), ColumnVector::max(), p_less1_gripe, SVD::sigma_only, x, xcolnorms(), and xrownorms().
R matrix_norm | ( | const MatrixT & | m, |
R | p, | ||
VectorT | |||
) |
Definition at line 505 of file oct-norm.cc.
References current_liboctave_error_handler, higham(), lo_ieee_isinf, RowVector::max(), ColumnVector::max(), p_less1_gripe, x, xcolnorms(), and xrownorms().
void row_norms | ( | const MArray< T > & | m, |
MArray< R > & | res, | ||
ACC | acc | ||
) |
Definition at line 246 of file oct-norm.cc.
References Array< T >::columns(), Array< T >::rows(), and Array< T >::xelem().
void row_norms | ( | const MSparse< T > & | m, |
MArray< R > & | res, | ||
ACC | acc | ||
) |
Definition at line 276 of file oct-norm.cc.
References Sparse< T >::cidx(), Sparse< T >::columns(), Sparse< T >::data(), Sparse< T >::ridx(), Sparse< T >::rows(), and Array< T >::xelem().
Definition at line 318 of file oct-norm.cc.
Definition at line 320 of file oct-norm.cc.
|
inline |
Definition at line 222 of file oct-norm.cc.
References Array< T >::numel().
Referenced by dual_p(), higham(), and higham_subp().
R vector_norm | ( | const MArray< T > & | v, |
R | p | ||
) |
Definition at line 316 of file oct-norm.cc.
Definition at line 571 of file oct-norm.cc.
Referenced by Fnorm(), and matrix_norm().
OCTAVE_API RowVector xcolnorms | ( | const ComplexMatrix & | m, |
double | p | ||
) |
Definition at line 572 of file oct-norm.cc.
OCTAVE_API FloatRowVector xcolnorms | ( | const FloatMatrix & | m, |
float | p | ||
) |
Definition at line 573 of file oct-norm.cc.
OCTAVE_API FloatRowVector xcolnorms | ( | const FloatComplexMatrix & | m, |
float | p | ||
) |
Definition at line 574 of file oct-norm.cc.
OCTAVE_API RowVector xcolnorms | ( | const SparseMatrix & | m, |
double | p | ||
) |
Definition at line 576 of file oct-norm.cc.
OCTAVE_API RowVector xcolnorms | ( | const SparseComplexMatrix & | m, |
double | p | ||
) |
Definition at line 577 of file oct-norm.cc.
Definition at line 536 of file oct-norm.cc.
OCTAVE_API double xfrobnorm | ( | const ComplexMatrix & | x | ) |
Definition at line 537 of file oct-norm.cc.
OCTAVE_API float xfrobnorm | ( | const FloatMatrix & | x | ) |
Definition at line 538 of file oct-norm.cc.
OCTAVE_API float xfrobnorm | ( | const FloatComplexMatrix & | x | ) |
Definition at line 539 of file oct-norm.cc.
OCTAVE_API double xfrobnorm | ( | const SparseMatrix & | x | ) |
Definition at line 562 of file oct-norm.cc.
OCTAVE_API double xfrobnorm | ( | const SparseComplexMatrix & | x | ) |
Definition at line 563 of file oct-norm.cc.
Definition at line 536 of file oct-norm.cc.
OCTAVE_API double xnorm | ( | const ColumnVector & | x, |
double | p | ||
) |
Definition at line 536 of file oct-norm.cc.
Referenced by Matrix::determinant(), FloatMatrix::determinant(), ComplexMatrix::determinant(), FloatComplexMatrix::determinant(), do_mgorth(), do_sqrtm(), Fnorm(), CHOL::init(), FloatCHOL::init(), ComplexCHOL::init(), and FloatComplexCHOL::init().
Definition at line 536 of file oct-norm.cc.
OCTAVE_API double xnorm | ( | const ComplexMatrix & | x, |
double | p | ||
) |
Definition at line 537 of file oct-norm.cc.
OCTAVE_API double xnorm | ( | const ComplexRowVector & | x, |
double | p | ||
) |
Definition at line 537 of file oct-norm.cc.
OCTAVE_API double xnorm | ( | const ComplexColumnVector & | x, |
double | p | ||
) |
Definition at line 537 of file oct-norm.cc.
OCTAVE_API float xnorm | ( | const FloatRowVector & | x, |
float | p | ||
) |
Definition at line 538 of file oct-norm.cc.
OCTAVE_API float xnorm | ( | const FloatMatrix & | x, |
float | p | ||
) |
Definition at line 538 of file oct-norm.cc.
OCTAVE_API float xnorm | ( | const FloatColumnVector & | x, |
float | p | ||
) |
Definition at line 538 of file oct-norm.cc.
OCTAVE_API float xnorm | ( | const FloatComplexMatrix & | x, |
float | p | ||
) |
Definition at line 539 of file oct-norm.cc.
OCTAVE_API float xnorm | ( | const FloatComplexRowVector & | x, |
float | p | ||
) |
Definition at line 539 of file oct-norm.cc.
OCTAVE_API float xnorm | ( | const FloatComplexColumnVector & | x, |
float | p | ||
) |
Definition at line 539 of file oct-norm.cc.
OCTAVE_API double xnorm | ( | const SparseMatrix & | x, |
double | p | ||
) |
Definition at line 562 of file oct-norm.cc.
OCTAVE_API double xnorm | ( | const SparseComplexMatrix & | x, |
double | p | ||
) |
Definition at line 563 of file oct-norm.cc.
OCTAVE_API ColumnVector xrownorms | ( | const Matrix & | m, |
double | p | ||
) |
Definition at line 571 of file oct-norm.cc.
Referenced by Fnorm(), and matrix_norm().
OCTAVE_API ColumnVector xrownorms | ( | const ComplexMatrix & | m, |
double | p | ||
) |
Definition at line 572 of file oct-norm.cc.
OCTAVE_API FloatColumnVector xrownorms | ( | const FloatMatrix & | m, |
float | p | ||
) |
Definition at line 573 of file oct-norm.cc.
OCTAVE_API FloatColumnVector xrownorms | ( | const FloatComplexMatrix & | m, |
float | p | ||
) |
Definition at line 574 of file oct-norm.cc.
OCTAVE_API ColumnVector xrownorms | ( | const SparseMatrix & | m, |
double | p | ||
) |
Definition at line 576 of file oct-norm.cc.
OCTAVE_API ColumnVector xrownorms | ( | const SparseComplexMatrix & | m, |
double | p | ||
) |
Definition at line 577 of file oct-norm.cc.
|
static |
Definition at line 475 of file oct-norm.cc.
|
static |
Definition at line 470 of file oct-norm.cc.
Referenced by matrix_norm().