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
Util Class Reference

Util: Utility functions for export of matrices and vectors to files. More...

Detailed Description

Util: Utility functions for export of matrices and vectors to files.

Documentation Update:
Author
Daniel Wirtz
Date
2013-07-23
New in 0.7:
(Daniel Wirtz, 2013-07-23) Added this class.

This class is part of the framework

KerMor - Model Order Reduction using Kernels

Definition at line 17 of file Util.m.

Static Public Member Functions

static function  saveRealMatrix (mat, file, folder)
 Stores a real double matrix in little endian format. More...
 
static function  saveRealVector (vec, file, folder)
 Stores a real double vector in little endian format. More...
 
static function char
jsonobj = 
matrixToJSON (double value)
 Takes a matrix and returns a JSON representation as JSONObject with the fields "dim" and "values". More...
 

Static Public Attributes

static const  MachineFormat = "ieee-be"
 The machine format (little/big endian, 32/64bit) to use upon export. More...
 

Member Function Documentation

function char jsonobj = Util.matrixToJSON ( double  value)
static

Takes a matrix and returns a JSON representation as JSONObject with the fields "dim" and "values".

The elements are stored inside the values array as double values, iterating through the (multi-dimensional) matrix in the order of the dimensions given in "dim". For a simple matrix this is a column-wise from left to right storage.

Parameters
valueA double matrix
Return values
jsonobjA string representation of a JSON object

Definition at line 140 of file Util.m.

Referenced by kernels.KernelExpansion.toJSON().

Here is the caller graph for this function:

function Util.saveRealMatrix (   mat,
  file,
  folder 
)
static

Stores a real double matrix in little endian format.

The first 64bits are used to encode the row and column numbers as int32, then the next bytes contain rows*cols*8bytes of double values. The matrix is addressed linearly in a row-wise fashion, i.e. first row, second row ...

Definition at line 52 of file Util.m.

References MachineFormat, and t.

Referenced by create_testdata(), and kernels.KernelExpansion.exportToDirectory().

Here is the caller graph for this function:

function Util.saveRealVector (   vec,
  file,
  folder 
)
static

Stores a real double vector in little endian format.

The first 64bits are used to encode the vector size as int32, then the next bytes contain size*8bytes of double values.

Definition at line 99 of file Util.m.

References MachineFormat.

Referenced by kernels.KernelExpansion.exportToDirectory().

Here is the caller graph for this function:

Member Data Documentation

Util.MachineFormat = "ieee-be"
static

The machine format (little/big endian, 32/64bit) to use upon export.

Default: ieee-be (Big Endian, as Java implements it)

See doc fopen for more details.

Definition at line 38 of file Util.m.

Referenced by saveRealMatrix(), and saveRealVector().


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