|
ParGeMSLR
|
Vector operations. More...
#include <vector>#include "../utils/utils.hpp"#include "vector.hpp"#include "int_vector.hpp"#include "sequential_vector.hpp"#include "parallel_vector.hpp"Go to the source code of this file.
Functions | |
| PrecisionEnum | pargemslr::GetVectorPrecision (const VectorVirtualClass< int > &vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPrecision (const VectorVirtualClass< long int > &vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPrecision (const VectorVirtualClass< float > &vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPrecision (const VectorVirtualClass< double > &vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPrecision (const VectorVirtualClass< complexs > &vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPrecision (const VectorVirtualClass< complexd > &vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPPrecision (const VectorVirtualClass< int > *vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPPrecision (const VectorVirtualClass< long int > *vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPPrecision (const VectorVirtualClass< float > *vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPPrecision (const VectorVirtualClass< double > *vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPPrecision (const VectorVirtualClass< complexs > *vec) |
| Get the precision of a vector. More... | |
| PrecisionEnum | pargemslr::GetVectorPPrecision (const VectorVirtualClass< complexd > *vec) |
| Get the precision of a vector. More... | |
| template<typename T > | |
| int | pargemslr::VectorPDotTemplate (int n, const T *x, const T *y, T &t) |
| DOT product of two float vectors. More... | |
| int | pargemslr::VectorDot (const vector_base_float &x, const vector_base_float &y, float &t) |
| DOT product of two float vectors. More... | |
| int | pargemslr::VectorDot (const vector_base_double &x, const vector_base_double &y, double &t) |
| DOT product of two double vectors. More... | |
| int | pargemslr::VectorDot (const vector_base_complexs &x, const vector_base_complexs &y, complexs &t) |
| DOTC product of two single complex vectors. More... | |
| int | pargemslr::VectorDot (const vector_base_complexd &x, const vector_base_complexd &y, complexd &t) |
| DOTC product of two double complex vectors. More... | |
| template<typename T > | |
| int | pargemslr::VectorPScaleTemplate (int n, T *x, const T &a) |
| Scale a float vector. More... | |
| int | pargemslr::VectorScale (VectorClass< float > &x, const float &a) |
| Scale a float vector. More... | |
| int | pargemslr::VectorScale (VectorClass< double > &x, const double &a) |
| Scale a double vector. More... | |
| int | pargemslr::VectorScale (VectorClass< complexs > &x, const complexs &a) |
| Scale a single complex vector. More... | |
| int | pargemslr::VectorScale (VectorClass< complexd > &x, const complexd &a) |
| Scale a double complex vector. More... | |
| template<typename T > | |
| int | pargemslr::VectorPAxpyTemplate (int n, const T &a, const T *x, T *y) |
| AXPY of two float vectors, in place version. y = a*x + y. More... | |
| int | pargemslr::VectorAxpy (const float &a, const VectorClass< float > &x, VectorClass< float > &y) |
| AXPY of two float vectors, in place version. y = a*x + y. More... | |
| int | pargemslr::VectorAxpy (const double &a, const VectorClass< double > &x, VectorClass< double > &y) |
| AXPY of two double vectors, in place version. y = a*x + y. More... | |
| int | pargemslr::VectorAxpy (const complexs &a, const VectorClass< complexs > &x, VectorClass< complexs > &y) |
| AXPY of two single complex vectors, in place version. y = a*x + y. More... | |
| int | pargemslr::VectorAxpy (const complexd &a, const VectorClass< complexd > &x, VectorClass< complexd > &y) |
| AXPY of two double complex vectors, in place version. y = a*x + y. Currenlty we don't support x == y. More... | |
| template<typename T > | |
| int | pargemslr::VectorPBsearchHost (const T *v, const T &val, int s, int e, int &idx, bool ascending) |
| Binary search between [s, e] inside an array. More... | |
| template<typename T > | |
| int | pargemslr::VectorPlotHost (const VectorVirtualClass< T > &x, int conditiona, int conditionb, int width) |
| Print the vector. More... | |
| int | pargemslr::SequentialVectorReadFromFile (SequentialVectorClass< float > &vec, const char *vecfile, int idxin) |
| Read a vector from matrix marker format file. More... | |
| int | pargemslr::SequentialVectorReadFromFile (SequentialVectorClass< double > &vec, const char *vecfile, int idxin) |
| Read a vector from matrix marker format file. More... | |
| int | pargemslr::SequentialVectorReadFromFile (SequentialVectorClass< complexs > &vec, const char *vecfile, int idxin) |
| Read a vector from matrix marker format file. More... | |
| int | pargemslr::SequentialVectorReadFromFile (SequentialVectorClass< complexd > &vec, const char *vecfile, int idxin) |
| Read a vector from matrix marker format file. More... | |
| template<typename T1 , typename T2 > | |
| int | pargemslr::VectorCopy (VectorClass< T1 > &vec_in, VectorClass< T2 > &vec2_out) |
| Copy data from vector of type T1 to vector of type T2. More... | |
Vector operations.
VectorXxx: functions for base vector.
SequentialVectorXxx: functions for sequential vector.
| PrecisionEnum pargemslr::GetVectorPPrecision | ( | const VectorVirtualClass< complexd > * | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPPrecision | ( | const VectorVirtualClass< complexs > * | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPPrecision | ( | const VectorVirtualClass< double > * | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPPrecision | ( | const VectorVirtualClass< float > * | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPPrecision | ( | const VectorVirtualClass< int > * | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPPrecision | ( | const VectorVirtualClass< long int > * | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPrecision | ( | const VectorVirtualClass< complexd > & | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPrecision | ( | const VectorVirtualClass< complexs > & | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPrecision | ( | const VectorVirtualClass< double > & | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPrecision | ( | const VectorVirtualClass< float > & | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPrecision | ( | const VectorVirtualClass< int > & | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| PrecisionEnum pargemslr::GetVectorPrecision | ( | const VectorVirtualClass< long int > & | vec | ) |
Get the precision of a vector.
| [in] | vec | the vector type. |
| int pargemslr::SequentialVectorReadFromFile | ( | SequentialVectorClass< complexd > & | vec, |
| const char * | vecfile, | ||
| int | idxin | ||
| ) |
Read a vector from matrix marker format file.
| [out] | vec | The return vector. |
| [in] | vecfile | The file name. |
| [in] | idxin | The index base of the input vector, 0-based or 1-based. |
| int pargemslr::SequentialVectorReadFromFile | ( | SequentialVectorClass< complexs > & | vec, |
| const char * | vecfile, | ||
| int | idxin | ||
| ) |
Read a vector from matrix marker format file.
| [out] | vec | The return vector. |
| [in] | vecfile | The file name. |
| [in] | idxin | The index base of the input vector, 0-based or 1-based. |
| int pargemslr::SequentialVectorReadFromFile | ( | SequentialVectorClass< double > & | vec, |
| const char * | vecfile, | ||
| int | idxin | ||
| ) |
Read a vector from matrix marker format file.
| [out] | vec | The return vector. |
| [in] | vecfile | The file name. |
| [in] | idxin | The index base of the input vector, 0-based or 1-based. |
| int pargemslr::SequentialVectorReadFromFile | ( | SequentialVectorClass< float > & | vec, |
| const char * | vecfile, | ||
| int | idxin | ||
| ) |
Read a vector from matrix marker format file.
| [out] | vec | The return vector. |
| [in] | vecfile | The file name. |
| [in] | idxin | The index base of the input vector, 0-based or 1-based. |
| int pargemslr::VectorAxpy | ( | const complexd & | a, |
| const VectorClass< complexd > & | x, | ||
| VectorClass< complexd > & | y | ||
| ) |
AXPY of two double complex vectors, in place version. y = a*x + y. Currenlty we don't support x == y.
| [in] | a | The scaling scalar. |
| [in] | x | The left vector. |
| [in,out] | y | The right vector. |
| int pargemslr::VectorAxpy | ( | const complexs & | a, |
| const VectorClass< complexs > & | x, | ||
| VectorClass< complexs > & | y | ||
| ) |
AXPY of two single complex vectors, in place version. y = a*x + y.
| [in] | a | The scaling scalar. |
| [in] | x | The left vector. |
| [in,out] | y | The right vector. |
| int pargemslr::VectorAxpy | ( | const double & | a, |
| const VectorClass< double > & | x, | ||
| VectorClass< double > & | y | ||
| ) |
AXPY of two double vectors, in place version. y = a*x + y.
| [in] | a | The scaling scalar. |
| [in] | x | The left vector. |
| [in,out] | y | The right vector. |
| int pargemslr::VectorAxpy | ( | const float & | a, |
| const VectorClass< float > & | x, | ||
| VectorClass< float > & | y | ||
| ) |
AXPY of two float vectors, in place version. y = a*x + y.
| [in] | a | The scaling scalar. |
| [in] | x | The left vector. |
| [in,out] | y | The right vector. |
| int pargemslr::VectorCopy | ( | VectorClass< T1 > & | vec_in, |
| VectorClass< T2 > & | vec2_out | ||
| ) |
Copy data from vector of type T1 to vector of type T2.
Currently only supports float <-> double and complexs <-> conplexd
| [in] | vec_in | The input vector. |
| [out] | vec_out | The output vector. |
| int pargemslr::VectorDot | ( | const vector_base_complexd & | x, |
| const vector_base_complexd & | y, | ||
| complexd & | t | ||
| ) |
DOTC product of two double complex vectors.
| [in] | x | The left vector. |
| [in] | y | The right vector. |
| [out] | t | The dot product. |
| int pargemslr::VectorDot | ( | const vector_base_complexs & | x, |
| const vector_base_complexs & | y, | ||
| complexs & | t | ||
| ) |
DOTC product of two single complex vectors.
| [in] | x | The left vector. |
| [in] | y | The right vector. |
| [out] | t | The dot product. |
| int pargemslr::VectorDot | ( | const vector_base_double & | x, |
| const vector_base_double & | y, | ||
| double & | t | ||
| ) |
DOT product of two double vectors.
| [in] | x | The left vector. |
| [in] | y | The right vector. |
| [out] | t | The dot product. |
| int pargemslr::VectorDot | ( | const vector_base_float & | x, |
| const vector_base_float & | y, | ||
| float & | t | ||
| ) |
DOT product of two float vectors.
| [in] | x | The left vector. |
| [in] | y | The right vector. |
| [out] | t | The dot product. |
| int pargemslr::VectorPAxpyTemplate | ( | int | n, |
| const T & | a, | ||
| const T * | x, | ||
| T * | y | ||
| ) |
AXPY of two float vectors, in place version. y = a*x + y.
| [in] | n | The length of the vectors. |
| [in] | a | The scaling scalar. |
| [in] | x | The left vector. |
| [in,out] | y | The right vector. |
| int pargemslr::VectorPBsearchHost | ( | const T * | v, |
| const T & | val, | ||
| int | s, | ||
| int | e, | ||
| int & | idx, | ||
| bool | ascending | ||
| ) |
Binary search between [s, e] inside an array.
| [in] | v | The target vector. |
| [in] | val | The target value. |
| [in] | s | The start location in the array |
| [in] | e | The end(include) location in the array |
| [out] | idx | If found the value, set to the index of the value. Otherwise the position to insert, or -1 if s > e. |
| [in] | descend | The array is descend or ascend. |
| int pargemslr::VectorPDotTemplate | ( | int | n, |
| const T * | x, | ||
| const T * | y, | ||
| T & | t | ||
| ) |
DOT product of two float vectors.
| [in] | n | The length of the vectors. |
| [in] | x | The left vector. |
| [in] | y | The right vector. |
| [out] | t | The dot product. |
| int pargemslr::VectorPlotHost | ( | const VectorVirtualClass< T > & | x, |
| int | conditiona, | ||
| int | conditionb, | ||
| int | width | ||
| ) |
Print the vector.
| [in] | x | The target vector. |
| [in] | conditiona | First condition. |
| [in] | conditionb | Secend condition, only print when conditiona == conditionb. |
| [in] | width | The plot width. |
| int pargemslr::VectorPScaleTemplate | ( | int | n, |
| T * | x, | ||
| const T & | a | ||
| ) |
Scale a float vector.
| [in] | n | The length of the vectors. |
| [in,out] | x | The target vector. |
| [in] | a | The scaling scalar. |
| int pargemslr::VectorScale | ( | VectorClass< complexd > & | x, |
| const complexd & | a | ||
| ) |
Scale a double complex vector.
| [in,out] | x | The target vector. |
| [in] | a | The scaling scalar. |
| int pargemslr::VectorScale | ( | VectorClass< complexs > & | x, |
| const complexs & | a | ||
| ) |
Scale a single complex vector.
| [in,out] | x | The target vector. |
| [in] | a | The scaling scalar. |
| int pargemslr::VectorScale | ( | VectorClass< double > & | x, |
| const double & | a | ||
| ) |
Scale a double vector.
| [in,out] | x | The target vector. |
| [in] | a | The scaling scalar. |
| int pargemslr::VectorScale | ( | VectorClass< float > & | x, |
| const float & | a | ||
| ) |
Scale a float vector.
| [in,out] | x | The target vector. |
| [in] | a | The scaling scalar. |
1.8.18