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
-
a The first vector. b The 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
-
a The 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
-
a The 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
-
a The first vector. b The 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
-
a The first vector. b The 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
-
dimension The specified number of entries. value The 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
-
dimension The specified number of entries. value The 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
-
dimensions The 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
-
a The 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
-
a The 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
-
a The first vector. b The 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
-
a The first vector. b The 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
-
a The input vector. b The 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
-
a The input vector. b The 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
-
vec The vector which should be projected. projection_vector The 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
-
a The 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
-
a The supplied vector.
void arbitraryprecisioncalculation::vectoroperations::Sort | ( | std::vector< mpf_t * > * | vec | ) |
Sorts the elements of the supplied vector in increasing order.
- Parameters
-
vec The vector.
mpf_t* arbitraryprecisioncalculation::vectoroperations::SquaredEuclideanLength | ( | const std::vector< mpf_t * > & | vec | ) |
Calculates the squared euclidean length of the supplied vector.
- Parameters
-
vec The 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
-
a The first vector. b The second vector.
- Returns
- The result vector of the element wise subtraction.