Class Vector Reference Manual

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 3

DownloadClass Vector Reference Manual
Open PDF In BrowserView PDF
CLASS VECTOR REFERENCE MANUAL

RETURN

METHOD NAME

PARAMETERS

DESCRIPTION

INITIALIZATION
void
New Vector
* X
Convert array X of size N to a vector
int N
Vector
int Length
New Vector of start dimension Length
Clone
void
Copy of a vector
GetLength
void
Get length of the vector
GetStepSize
void
Get amount of new memory allocated when
vector is full
SetStepSize
int StepSize
Set amount of new memory allocated when
vector is full
GetValue
int Index
Get an array element
ADD / REMOVE METHODS
Clear
void
Remove all elements from the vector
Add
 X
Add a new element in the vector
AddAt
 X
Add a new element in the vector on Index
int Index
position
RemoveAt
int Index
Remove element on Index position from the
vector
Extract
int FromIndex
Build a new vector with elements from position
FromIndex to ToIndex
int ToIndex
PRE–BUILT VECTORS
ZeroVector
int Length
Build a new vector of zeros with Length
elements
RandVector
int Length
Build a new vector with Length random
elements
GetSequence
 Start
Build a new vector with elements from Start to
 Step
End, with step Step
 End
MATHEMATICAL METHODS
SumScalar
 X
Sum X to each vector element
ProductScalar
 X
Multiply X to each vector element
DivideScalar
 X
Divide X to each vector element
PowScalar
 X
Pow X to each vector element
SumVector
Vector* V
Sum vector with another one
SumVector
Vector* V1
Sum vectors V1 and V2
Vector* V2
SubtractVector
Vector* V
Subtract vector with another one
SubtractVector
Vector* V1
Subtract vectors V1 and V2
Vector* V2
ProductVector
Vector* V
Multiply vector with another one
ProductVector
Vector* V1
Multiply vectors V1 and V2
Vector* V2
ProductVectorScalar Vector* V
Scalar product of two vectors
ProductVectorScalar Vector* V1
Scalar product of vectors V1 and V2
Vector* V2
Sum
void
Sum all vector elements
AbsSum
void
Sum all vector absolute values
Vector
Vector

Vector*
int
int
void
T
void
void
void
void
Vector*

Vector*
Vector*
Vector*

void
void
void
void
void
Vector*
void
Vector*
void
Vector*





1/3

CLASS VECTOR REFERENCE GUIDE

RETURN

METHOD NAME

PARAMETERS

DESCRIPTION

COMPARISON METHODS
void
Min vector value
* MinValue
Min vector value and position
int* MinIndex

MinAbs
void
Min vector absolute value
void
MinAbs
* MinValue
Min vector absolute value and position
int* MinIndex

Max
void
Max vector value
void
Max
* MinValue
Max vector value and position
int* MinIndex

MaxAbs
void
Max vector absolute value
void
MaxAbs
* MinValue
Max vector absolute value and position
int* MinIndex

Mean
void
Mean vector value

MeanAbs
void
Mean vector absolute value
SORTING METHODS
void
Sort
void
Sort vector
void
RemoveDuplicates
void
Remove duplicates from vector
int
Find
 X
Find position of X in the vector
INPUT / OUTPUT METHODS
Vector* Load
char* Filename
Load vector from file
void
Save
char* Filename
Save vector to file
void
Print
void
Print vector to output
void
Print
char* VectorName
Print vector to output

void

Min
Min

2/3

CLASS VECTOR EXAMPLES

#include "Vector.h"
using namespace onlinesvr;

int main ()
{
// Make a new vector
Vector* V1 = new Vector();
// Fill vector
for (int i=0; i<5; i++) {
V1->Add(i);
}
// Add 5 to each vector element
V1->SumScalar(5);
// Copy vector
Vector* V2 = V1->Clone();
// Normalize vector
int MaxValue = V2->Max();
V2->DivideScalar(MaxValue);
// Print vectors
V1->Print("V1");
V2->Print("V2");
// Vector sum
Vector* V3 = V1->SumVector(V1,V2);
V3->Print("V3");
// Rand Vector of 4 elements
Vector* V4 = Vector::RandVector(4);
V4->Print("V4");
// Sort
V4->Sort();
V4->Print("Vsort");
// Save vector
V4->Save("V4.vec");
// Delete vectors
delete V1;
delete V2;
delete V3;
delete V4;
}

3/3



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
Page Count                      : 3
Producer                        : GPL Ghostscript 8.54
Create Date                     : 2006:11:30 17:38:29+01:00
Modify Date                     : 2006:11:30 17:38:29
Title                           : Class Vector Reference Manual
Creator                         : PDFCreator Version 0.9.3
Author                          : Parrella Francesco
Subject                         : 
EXIF Metadata provided by EXIF.tools

Navigation menu