arbitraryprecisioncalculation::vectoroperations Namespace Reference

Contains a large set of operations for calculations with vectors of the mpf_t data type. More...

Functions

std::vector< mpf_t * > Add (const std::vector< mpf_t * > &a, const std::vector< mpf_t * > &b)
 Performs element wise addition of the two vectors. More...
 
mpf_t * Add (const std::vector< mpf_t * > &a)
 Calculates the sum of the vector entries. More...
 
std::vector< mpf_t * > Clone (const std::vector< mpf_t * > &a)
 Creates a copy of the supplied vector where each entry is cloned. More...
 
std::vector< mpf_t * > Divide (const std::vector< mpf_t * > &a, const std::vector< mpf_t * > &b)
 Performs element wise division of the two vectors. More...
 
bool Equals (const std::vector< mpf_t * > &a, const std::vector< mpf_t * > &b)
 Checks whether two mpf_t* vectors are equal. More...
 
std::vector< mpf_t * > GetConstantVector (int dimension, const double &value)
 Creates a vector with the specified number of entries. Each entry represents the supplied value. More...
 
std::vector< mpf_t * > GetConstantVector (int dimension, const mpf_t *value)
 Creates a vector with the specified number of entries. Each entry represents the supplied value. More...
 
std::vector< mpf_t * > GetRandomVector (int dimensions)
 Creates a random mpf_t* vector with the specified number of entries, which contains random values in the interval [0,1]. More...
 
std::vector< mpf_t * > GetVector (const std::vector< double > &a)
 Transforms the vector with double entries to a vector with mpf_t* values. More...
 
std::vector< double > MpftToDouble (const std::vector< mpf_t * > &a)
 Converts the values of a vector with mpf_t* entries to a vector with double entries. More...
 
std::vector< mpf_t * > Multiply (const std::vector< mpf_t * > &a, const std::vector< mpf_t * > &b)
 Performs element wise multiplication of the two vectors. More...
 
std::vector< mpf_t * > Multiply (const std::vector< mpf_t * > &a, const std::vector< double > &b)
 Performs element wise multiplication of the two vectors. More...
 
std::vector< mpf_t * > Multiply (const std::vector< mpf_t * > &a, const double &b)
 Performs for each element in the input vector a multiplication with the specified factor. More...
 
std::vector< mpf_t * > Multiply (const std::vector< mpf_t * > &a, mpf_t *b)
 Performs for each element in the input vector a multiplication with the specified factor. More...
 
std::vector< mpf_t * > OrthogonalProjection (const std::vector< mpf_t * > &vec, const std::vector< mpf_t * > &projection_vector)
 Calculates the orthogonal projection of the vector vec on the projection vector. More...
 
std::vector< mpf_t * > Randomize (const std::vector< mpf_t * > &a)
 Randomizes the supplied vector. Each entry will be multiplied by a random mpf_t value in the interval [0,1]. More...
 
void ReleaseValues (const std::vector< mpf_t * > &a)
 Release the reserved memory for the entries of the supplied vector. More...
 
void Sort (std::vector< mpf_t * > *vec)
 Sorts the elements of the supplied vector in increasing order. More...
 
mpf_t * SquaredEuclideanLength (const std::vector< mpf_t * > &vec)
 Calculates the squared euclidean length of the supplied vector. More...
 
std::vector< mpf_t * > Subtract (const std::vector< mpf_t * > &a, const std::vector< mpf_t * > &b)
 Performs element wise subtraction of the two vectors. More...
 

Detailed Description

Contains a large set of operations for calculations with vectors of the mpf_t data type.

Function Documentation

std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::Add ( const std::vector< mpf_t * > &  a,
const std::vector< mpf_t * > &  b 
)

Performs element wise addition of the two vectors.

Parameters
aThe first vector.
bThe second vector.
Returns
The result vector of the element wise addition.
mpf_t* arbitraryprecisioncalculation::vectoroperations::Add ( const std::vector< mpf_t * > &  a)

Calculates the sum of the vector entries.

Parameters
aThe input vector.
Returns
The sum.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::Clone ( const std::vector< mpf_t * > &  a)

Creates a copy of the supplied vector where each entry is cloned.

The result vector can be stored for later use.

Parameters
aThe supplied vector.
Returns
The copy.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::Divide ( const std::vector< mpf_t * > &  a,
const std::vector< mpf_t * > &  b 
)

Performs element wise division of the two vectors.

Parameters
aThe first vector.
bThe second vector.
Returns
The result vector of the element wise division.
bool arbitraryprecisioncalculation::vectoroperations::Equals ( const std::vector< mpf_t * > &  a,
const std::vector< mpf_t * > &  b 
)

Checks whether two mpf_t* vectors are equal.

Parameters
aThe first vector.
bThe second vector.
Returns
true if the two vectors contain equal values.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::GetConstantVector ( int  dimension,
const double &  value 
)

Creates a vector with the specified number of entries. Each entry represents the supplied value.

Parameters
dimensionThe specified number of entries.
valueThe supplied value.
Returns
The created vector.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::GetConstantVector ( int  dimension,
const mpf_t *  value 
)

Creates a vector with the specified number of entries. Each entry represents the supplied value.

Parameters
dimensionThe specified number of entries.
valueThe supplied value.
Returns
The created vector.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::GetRandomVector ( int  dimensions)

Creates a random mpf_t* vector with the specified number of entries, which contains random values in the interval [0,1].

Parameters
dimensionsThe number of entries.
Returns
The random vector.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::GetVector ( const std::vector< double > &  a)

Transforms the vector with double entries to a vector with mpf_t* values.

Parameters
aThe vector with double entries.
Returns
The transformed vector.
std::vector<double> arbitraryprecisioncalculation::vectoroperations::MpftToDouble ( const std::vector< mpf_t * > &  a)

Converts the values of a vector with mpf_t* entries to a vector with double entries.

Parameters
aThe vector with mpf_t* entries.
Returns
The converted vector.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::Multiply ( const std::vector< mpf_t * > &  a,
const std::vector< mpf_t * > &  b 
)

Performs element wise multiplication of the two vectors.

Parameters
aThe first vector.
bThe second vector.
Returns
The result vector of the element wise multiplication.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::Multiply ( const std::vector< mpf_t * > &  a,
const std::vector< double > &  b 
)

Performs element wise multiplication of the two vectors.

Parameters
aThe first vector.
bThe second vector.
Returns
The result vector of the element wise multiplication.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::Multiply ( const std::vector< mpf_t * > &  a,
const double &  b 
)

Performs for each element in the input vector a multiplication with the specified factor.

Parameters
aThe input vector.
bThe specified factor.
Returns
The result vector of multiplications.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::Multiply ( const std::vector< mpf_t * > &  a,
mpf_t *  b 
)

Performs for each element in the input vector a multiplication with the specified factor.

Parameters
aThe input vector.
bThe specified factor.
Returns
The result vector of multiplications.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::OrthogonalProjection ( const std::vector< mpf_t * > &  vec,
const std::vector< mpf_t * > &  projection_vector 
)

Calculates the orthogonal projection of the vector vec on the projection vector.

The following formula is used:
( ( vec . projection_vector ) / ( projection_vector . projection_vector ) ) · projection_vector,
where ( a . b ) is dot product or scalar product.

Parameters
vecThe vector which should be projected.
projection_vectorThe projection vector.
Returns
The projection of the vector vec on the vector projection_vector.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::Randomize ( const std::vector< mpf_t * > &  a)

Randomizes the supplied vector. Each entry will be multiplied by a random mpf_t value in the interval [0,1].

Parameters
aThe supplied vector.
Returns
The randomized vector.
void arbitraryprecisioncalculation::vectoroperations::ReleaseValues ( const std::vector< mpf_t * > &  a)

Release the reserved memory for the entries of the supplied vector.

The supplied mpf_t objects will be reused soon.

Parameters
aThe supplied vector.
void arbitraryprecisioncalculation::vectoroperations::Sort ( std::vector< mpf_t * > *  vec)

Sorts the elements of the supplied vector in increasing order.

Parameters
vecThe vector.
mpf_t* arbitraryprecisioncalculation::vectoroperations::SquaredEuclideanLength ( const std::vector< mpf_t * > &  vec)

Calculates the squared euclidean length of the supplied vector.

Parameters
vecThe vector.
Returns
The squared euclidean length.
std::vector<mpf_t*> arbitraryprecisioncalculation::vectoroperations::Subtract ( const std::vector< mpf_t * > &  a,
const std::vector< mpf_t * > &  b 
)

Performs element wise subtraction of the two vectors.

Parameters
aThe first vector.
bThe second vector.
Returns
The result vector of the element wise subtraction.