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
data.FileDataCollection Class Reference

FileDataCollection: Basic class for storing data given a hashable key value. More...

Detailed Description

FileDataCollection: Basic class for storing data given a hashable key value.

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

This class is part of the framework

KerMor - Model Order Reduction using Kernels

Definition at line 18 of file FileDataCollection.m.

Public Member Functions

 FileDataCollection (data_dir)
 Creates a new FileDataCollection in a file folder. More...
 
function  delete ()
 Destructor for FileDataCollection. More...
 
function struct data = getData (rowvec< double > keydata, varargin)
 methods(Access=protected) Retrieves data from the collection element of a given key. More...
 
function n = getCollectionSize ()
 
function struct data = getDataNr (nr, varargin)
 Retrieves data from the nr-st collection element. More...
 
function res = hasData (keydata)
 
function  addData (keydata, data)
 
function  clear ()
 
- Public Member Functions inherited from data.FileData
 FileData (data_dir)
 
function  relocate (char new_root)
 Relocates this FileData instance to a different folder. More...
 
function  delete ()
 

Static Public Member Functions

static function res = test_FileDataCollection ()
 Quickly tests if the directory is persisted(deleted) when (not) saved to a mat file. More...
 

Public Attributes

 KeepFiles = false
 Tells the FileDataCollection to keep any stored files if the instance is deleted but has not been previously saved. More...
 
- Public Attributes inherited from data.FileData
char Host = ""
 The host machine this file data is created on. More...
 
char DataDirectory = ""
 The root folder where the FileData's files are saved. More...
 
- 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...
 

Static Protected Member Functions

static function this = loadobj (this, initfrom)
 
- Static Protected Member Functions inherited from data.FileData
static function this = loadobj (this, initfrom)
 Loads a FileData instance. More...
 

Additional Inherited Members

- Protected Member Functions inherited from data.FileData
function file = getfile (file)
 
function this = saveobj ()
 Set saved flag so that the data files do not get deleted on the delete method. More...
 
- Protected Attributes inherited from data.FileData
logical isSaved = false
 This flag indicates that this FileData instance has been stored to disk via the save method somewhere. More...
 

Constructor & Destructor Documentation

data.FileDataCollection.FileDataCollection (   data_dir)

Creates a new FileDataCollection in a file folder.

Parameters
data_dirEither a data.ModelData instance to infer the storage root from, or a string containing a valid folder. Default: A temporary folder within the KerMor.TempDirectory

Definition at line 61 of file FileDataCollection.m.

References KerMor.App(), clear(), and IDGenerator.generateID().

Here is the call graph for this function:

Member Function Documentation

function data.FileDataCollection.addData (   keydata,
  data 
)

Definition at line 171 of file FileDataCollection.m.

References data.FileData.DataDirectory, handle.fieldnames, and Utils.getHash().

Referenced by data.FileTrajectoryData.addTrajectory().

Here is the call graph for this function:

Here is the caller graph for this function:

function data.FileDataCollection.clear ( )

Definition at line 187 of file FileDataCollection.m.

References data.FileData.getfile().

Referenced by data.FileTrajectoryData.clearTrajectories(), delete(), FileDataCollection(), and test_FileDataCollection().

Here is the call graph for this function:

Here is the caller graph for this function:

function data.FileDataCollection.delete ( )

Destructor for FileDataCollection.

Deletes the DataDirectory if no trajectories are stored in it or it has not been saved somewhere.

Definition at line 84 of file FileDataCollection.m.

References clear(), data.FileData.isSaved, and KeepFiles.

Here is the call graph for this function:

function n = data.FileDataCollection.getCollectionSize ( )

Definition at line 137 of file FileDataCollection.m.

Referenced by data.FileTrajectoryData.getNumTrajectories().

Here is the caller graph for this function:

function struct data = data.FileDataCollection.getData ( rowvec< double keydata,
  varargin 
)

methods(Access=protected) Retrieves data from the collection element of a given key.

Todo:
make varargout instead of data struct
Parameters
keydataThe unique key data to identify a collection object
vararginContains the name of the fields to obtain as strings
Return values
dataA struct with the fields as specified in varargin.

Definition at line 100 of file FileDataCollection.m.

References data.FileData.DataDirectory, data.FileData.getfile(), and Utils.getHash().

Referenced by data.FileTrajectoryData.consolidate(), and data.FileTrajectoryData.getTrajectory().

Here is the call graph for this function:

Here is the caller graph for this function:

function struct data = data.FileDataCollection.getDataNr (   nr,
  varargin 
)

Retrieves data from the nr-st collection element.

Todo:
make varargout instead of data struct
Parameters
nrThe element number
vararginContains the name of the fields to obtain as strings
Return values
dataA struct with the fields as specified in varargin.

Definition at line 142 of file FileDataCollection.m.

References data.FileData.getfile().

Referenced by data.FileTrajectoryData.getTrajectoryNr().

Here is the call graph for this function:

Here is the caller graph for this function:

function res = data.FileDataCollection.hasData (   keydata)

Definition at line 162 of file FileDataCollection.m.

References data.FileData.DataDirectory, and Utils.getHash().

Referenced by data.FileTrajectoryData.addTrajectory().

Here is the call graph for this function:

Here is the caller graph for this function:

static function this = data.FileDataCollection.loadobj (   this,
  initfrom 
)
staticprotected

Definition at line 205 of file FileDataCollection.m.

function res = data.FileDataCollection.test_FileDataCollection ( )
static

Quickly tests if the directory is persisted(deleted) when (not) saved to a mat file.

Definition at line 223 of file FileDataCollection.m.

References KerMor.App(), clear(), and k.

Here is the call graph for this function:

Member Data Documentation

data.FileDataCollection.KeepFiles = false

Tells the FileDataCollection to keep any stored files if the instance is deleted but has not been previously saved.


Default: false

Definition at line 49 of file FileDataCollection.m.

Referenced by delete().


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