KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MonomialIterator Class Reference

MonomialIterator: Create list of d-dim monomials. More...

Detailed Description

MonomialIterator: Create list of d-dim monomials.

For a given dimension, this class produces an infinite list of monomials which increase in degree as all monomials of the last degree have been listed. The natural ordering of the monomials is degree first, then lexographically. Example for d=3: \(0,z,x,y,zz,zy,zx,yy,yx,xx,zzz,zzy,zzx,zyy,zyx\ldots\)

Note that the zero-monomial is not included in the list, however, it can be accessed via the extra method getNullMonomial.

Author
Daniel Wirtz
Date
2012-01-20
New in 0.6:
(Daniel Wirtz, 2012-01-20) Added this class.

This class is part of the framework

KerMor - Model Order Reduction using Kernels

Definition at line 17 of file MonomialIterator.m.

Public Member Functions

 MonomialIterator (integer dim)
 Creates a new monomial iterator. More...
 
function colvec
< double > alpha = 
getNullMonomial ()
 Get the monomial of degree zero. More...
 
function [ colvec< double > alpha ,
int32 deg ,
exps ] = 
nextMonomial ()
 Returns the next monomial in the sequence. More...
 
function colvec< int32 >
alpha = 
getRandMonomial (int32 deg)
 Returns a random monomial. More...
 

Static Public Member Functions

static function logical res = test_MonomialIterator ()
 Tests the MonomialIterator for two test cases. More...
 

Public Attributes

 Dim
 
- Public Attributes inherited from handle
 addlistener
 Creates a listener for the specified event and assigns a callback function to execute when the event occurs. More...
 
 notify
 Broadcast a notice that a specific event is occurring on a specified handle object or array of handle objects. More...
 
 delete
 Handle object destructor method that is called when the object's lifecycle ends. More...
 
 disp
 Handle object disp method which is called by the display method. See the MATLAB disp function. More...
 
 display
 Handle object display method called when MATLAB software interprets an expression returning a handle object that is not terminated by a semicolon. See the MATLAB display function. More...
 
 findobj
 Finds objects matching the specified conditions from the input array of handle objects. More...
 
 findprop
 Returns a meta.property objects associated with the specified property name. More...
 
 fields
 Returns a cell array of string containing the names of public properties. More...
 
 fieldnames
 Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames function. More...
 
 isvalid
 Returns a logical array in which elements are true if the corresponding elements in the input array are valid handles. This method is Sealed so you cannot override it in a handle subclass. More...
 
 eq
 Relational functions example. See details for more information. More...
 
 transpose
 Transposes the elements of the handle object array. More...
 
 permute
 Rearranges the dimensions of the handle object array. See the MATLAB permute function. More...
 
 reshape
 hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape function. More...
 
 sort
 ort the handle objects in any array in ascending or descending order. More...
 

Constructor & Destructor Documentation

MonomialIterator.MonomialIterator ( integer  dim)

Creates a new monomial iterator.

Parameters
dimThe target dimension \(d\in\N\)

Definition at line 62 of file MonomialIterator.m.

References Dim.

Referenced by test_MonomialIterator().

Here is the caller graph for this function:

Member Function Documentation

function colvec< double > alpha = MonomialIterator.getNullMonomial ( )

Get the monomial of degree zero.

Return values
alphaThe multiindex of size \(1\times d\) with zero entries, corresponding to the zero degree monomial.

Definition at line 80 of file MonomialIterator.m.

References Dim.

function colvec< int32 > alpha = MonomialIterator.getRandMonomial ( int32  deg)

Returns a random monomial.

Parameters
degThe degree \(p = |\alpha|\) of the monomial.
Return values
alphaThe multiindex \(\alpha\in\Z^d\) corresponding to the exponents of the current monomial

Definition at line 141 of file MonomialIterator.m.

References Dim.

function [ colvec< double > alpha , int32 deg , exps ] = MonomialIterator.nextMonomial ( )

Returns the next monomial in the sequence.

Return values
alphaThe multiindex \(\alpha\in\Z^d\) corresponding to the exponents of the current monomial
degThe degree \(p = |\alpha|\) of the monomial
exps(Debug) The indices of \((1 \ldots d)\) at which an exponent is to be added.
ConnectionA histogram search of exps with bins \((1 \ldots d)\) results in \(\alpha\)

Definition at line 92 of file MonomialIterator.m.

References Dim, and t.

function logical res = MonomialIterator.test_MonomialIterator ( )
static

Tests the MonomialIterator for two test cases.

Return values
resTrue if successful, false else

Definition at line 163 of file MonomialIterator.m.

References all(), Dim, Utils.implode(), and MonomialIterator().

Here is the call graph for this function:

Member Data Documentation

MonomialIterator.Dim

The documentation for this class was generated from the following file: