class Vec

Vector object.

Inheritance:


Public Fields

[more]int n
Size of the vector
[more]real* ptr
Data of the vector

Public Methods

[more] Vec(real* ptr_, int n_dim)
Create a vector from values in ptr_.
[more] Vec(int n_dim)
Create a new vector
[more]void copy(Vec* vec, int start_i = 0)
Copy the vector vec starting from index start_i
[more]void zero()
Zero the matrix
[more]real norm1(Vec* weights = NULL)
Compute the norm1
[more]real norm2(Vec* weights = NULL)
Compute the norm2
[more]real normInf()
Compute the norm inf
[more]real iP(Vec* vec, int start_i = 0)
Inner product of two vectors from start_i downwards
[more]Vec* subVec(int dim1, int dim2)
Return a sub-vector.


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

Vector object.

oint n
Size of the vector

oreal* ptr
Data of the vector

o Vec(real* ptr_, int n_dim)
Create a vector from values in ptr_. (No memory copy).

o Vec(int n_dim)
Create a new vector

ovoid copy(Vec* vec, int start_i = 0)
Copy the vector vec starting from index start_i

ovoid zero()
Zero the matrix

oreal norm1(Vec* weights = NULL)
Compute the norm1

oreal norm2(Vec* weights = NULL)
Compute the norm2

oreal normInf()
Compute the norm inf

oreal iP(Vec* vec, int start_i = 0)
Inner product of two vectors from start_i downwards

oVec* subVec(int dim1, int dim2)
Return a sub-vector. Note that the memory is shared with the original vector, so *be carefull*.


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++.