class Mat

Matrix object.

Inheritance:


Public Fields

[more]int m
Size of the matrix
[more]real** ptr
Data of the matrix
[more]real* base
NULL if not allocated by Mat.

Public Methods

[more] Mat(real** ptr_, int n_rows, int n_cols)
Create a matrix from values in ptr_.
[more] Mat(real* ptr_, int n_rows, int n_cols)
Create a matrix from values in ptr_.
[more] Mat(int n_rows, int n_cols)
Create a new matrix
[more]void copy(Mat* mat)
Copy the matrix mat
[more]void zero()
Zero the matrix
[more]real norm1()
Compute the norm1
[more]real normFrobenius()
Compute the Frobenius norm
[more]real normInf()
Compute the norm inf
[more]Vec* getRow(int row, Vec* vec = NULL)
Return the row row of the matrix.
[more]Vec* getCol(int col, Vec* vec = NULL)
Return the column col of the matrix.
[more]void setRow(int row, Vec* vec)
Set the row row to values in vec
[more]void setCol(int row, Vec* vec)
Set the column col to values in vec
[more]Mat* subMat(int row1, int col1, int row2, int col2)
Return a sub-matrix.


Inherited from Object:

Public Fields

oAllocator* allocator

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="")
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="")
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="")
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
ovoid addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovoid setOOption(const char* name, Object* option)
ovirtual void loadXFile(XFile* file)
ovirtual void saveXFile(XFile* file)
ovoid load(const char* filename)
ovoid save(const char* filename)
ovoid* operator new(size_t size, Allocator* allocator_=NULL)
ovoid* operator new(size_t size, Allocator* allocator_, void* ptr_)
ovoid operator delete(void* ptr)


Documentation

Matrix object.

oint m
Size of the matrix

oreal** ptr
Data of the matrix

oreal* base
NULL if not allocated by Mat. (when you're using the first constructor of Mat, or for the matrix returned by subMat)

o Mat(real** ptr_, int n_rows, int n_cols)
Create a matrix from values in ptr_. (No memory copy).

o Mat(real* ptr_, int n_rows, int n_cols)
Create a matrix from values in ptr_. (No memory copy).

o Mat(int n_rows, int n_cols)
Create a new matrix

ovoid copy(Mat* mat)
Copy the matrix mat

ovoid zero()
Zero the matrix

oreal norm1()
Compute the norm1

oreal normFrobenius()
Compute the Frobenius norm

oreal normInf()
Compute the norm inf

oVec* getRow(int row, Vec* vec = NULL)
Return the row row of the matrix. If vec is NULL, return a new vector. Else copy the row in vec.

oVec* getCol(int col, Vec* vec = NULL)
Return the column col of the matrix. If vec is NULL, return a new vector. Else copy the column in vec.

ovoid setRow(int row, Vec* vec)
Set the row row to values in vec

ovoid setCol(int row, Vec* vec)
Set the column col to values in vec

oMat* subMat(int row1, int col1, int row2, int col2)
Return a sub-matrix. Note that the memory is shared with the original matrix, so *be carefull*. You have to destroy the returned matrix.


This class has no child classes.
Author:
Ronan Collobert (collober@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.