![]() |
SG++-Doxygen-Documentation
|
#include <DataVectorDistributed.hpp>
Public Member Functions | |
void | add (const DataVectorDistributed &x) |
Adds another vector to this vector, modifies this vector. | |
void | copyFrom (const DataVectorDistributed &other) |
Copies all values of another distributed data matrix to this object, resizes this object to the size of the other matrix. | |
DataVectorDistributed (double *input, std::shared_ptr< BlacsProcessGrid > grid, size_t globalSize, size_t blockSize) | |
Creates a distributed data vector with specified input data. | |
DataVectorDistributed (std::shared_ptr< BlacsProcessGrid > grid, size_t globalSize, size_t blockSize, double value=0.0) | |
Creates a distributed data vector of specified size and initializes the elements to value. | |
void | distribute (double *input, int masterRow=0, int masterCol=0) |
Distribute the input data to the process grid. | |
double | dot (const DataVectorDistributed &y) const |
double | get (size_t row) const |
Returns the value of the element at position [row]. | |
size_t | getBlockSize () const |
int * | getDescriptor () |
const int * | getDescriptor () const |
size_t | getGlobalRows () const |
Returns the number of rows of the DataMatrix. | |
double * | getLocalPointer () |
const double * | getLocalPointer () const |
size_t | getLocalRows () const |
DataMatrixDistributed & | getMatrix () |
const DataMatrixDistributed & | getMatrix () const |
std::shared_ptr< BlacsProcessGrid > | getProcessGrid () const |
size_t | globalToLocalRowIndex (size_t globalRowIndex) const |
Calculates the local row index from the globalRowIndex. | |
size_t | globalToRowProcessIndex (size_t globalRowIndex) const |
Calculates the row process index from the global row index. | |
bool | isProcessMapped () const |
size_t | localToGlobalRowIndex (size_t localRowIndex) const |
Calculates the global row index from the local row index. | |
double | operator() (size_t row) const |
Returns the value of the element at position [row]. | |
void | printVector () const |
Prints the vector on stdout on process 0. | |
void | resize (size_t rows) |
Resizes the vector to rows, discards the data. | |
void | scale (double a) |
Scales this vector by factor a. | |
void | set (size_t row, double value) |
Sets the element at global position [row] to value. | |
void | setAll (double value) |
Set all entries of the vector to one value. | |
DataVector | toLocalDataVector () const |
void | toLocalDataVector (DataVector &localVector) const |
DataVector | toLocalDataVectorBroadcast () const |
void | toLocalDataVectorBroadcast (DataVector &localVector) const |
Static Public Member Functions | |
static void | add (DataVectorDistributed &y, const DataVectorDistributed &x, double a=1.0) |
Performs the following operation sub(y) := sub(y) + a*sub(x) | |
static double | dot (const DataVectorDistributed &x, const DataVectorDistributed &y) |
sgpp::datadriven::DataVectorDistributed::DataVectorDistributed | ( | std::shared_ptr< BlacsProcessGrid > | grid, |
size_t | globalSize, | ||
size_t | blockSize, | ||
double | value = 0.0 |
||
) |
Creates a distributed data vector of specified size and initializes the elements to value.
grid | blacs grid for distribution |
globalSize | global size (rows) of this vector |
blockSize | size for each block (one process might receive multiple blocks) |
value | Initial value of all elements, default 0.0 |
sgpp::datadriven::DataVectorDistributed::DataVectorDistributed | ( | double * | input, |
std::shared_ptr< BlacsProcessGrid > | grid, | ||
size_t | globalSize, | ||
size_t | blockSize | ||
) |
Creates a distributed data vector with specified input data.
input | pointer to input values for this vector |
grid | blacs grid for distribution |
globalSize | global size (rows) of this vector |
blockSize | size for each block (one process might receive multiple blocks) |
void sgpp::datadriven::DataVectorDistributed::add | ( | const DataVectorDistributed & | x | ) |
Adds another vector to this vector, modifies this vector.
x | vector that is added to this vector |
References add().
Referenced by add(), and sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult_transpose().
|
static |
Performs the following operation sub(y) := sub(y) + a*sub(x)
y | |
x | |
a | factor for x, default 1.0 |
References getDescriptor(), getGlobalRows(), getLocalPointer(), and isProcessMapped().
void sgpp::datadriven::DataVectorDistributed::copyFrom | ( | const DataVectorDistributed & | other | ) |
Copies all values of another distributed data matrix to this object, resizes this object to the size of the other matrix.
References sgpp::datadriven::DataMatrixDistributed::copyFrom(), and getMatrix().
void sgpp::datadriven::DataVectorDistributed::distribute | ( | double * | input, |
int | masterRow = 0 , |
||
int | masterCol = 0 |
||
) |
Distribute the input data to the process grid.
Overwrites the current data. For more information, see DataMatrixDistributed::distribute
input | input data |
masterRow | row of the process that distributes the data |
masterCol | col of the process that distributes the data |
References sgpp::datadriven::DataMatrixDistributed::distribute().
Referenced by sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult_transpose().
|
static |
x | |
y |
References dot(), getDescriptor(), getGlobalRows(), getLocalPointer(), and isProcessMapped().
double sgpp::datadriven::DataVectorDistributed::dot | ( | const DataVectorDistributed & | y | ) | const |
double sgpp::datadriven::DataVectorDistributed::get | ( | size_t | row | ) | const |
Returns the value of the element at position [row].
row | Row |
References sgpp::datadriven::DataMatrixDistributed::get().
size_t sgpp::datadriven::DataVectorDistributed::getBlockSize | ( | ) | const |
References sgpp::datadriven::DataMatrixDistributed::getRowBlockSize().
Referenced by sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult_transpose().
int * sgpp::datadriven::DataVectorDistributed::getDescriptor | ( | ) |
References sgpp::datadriven::DataMatrixDistributed::getDescriptor().
Referenced by add(), dot(), sgpp::datadriven::DataMatrixDistributed::mult(), python.uq.parameters.ParameterBuilder.GeneralParameterBuilder::new(), and scale().
const int * sgpp::datadriven::DataVectorDistributed::getDescriptor | ( | ) | const |
References sgpp::datadriven::DataMatrixDistributed::getDescriptor().
Referenced by python.uq.parameters.ParameterBuilder.GeneralParameterBuilder::new().
size_t sgpp::datadriven::DataVectorDistributed::getGlobalRows | ( | ) | const |
Returns the number of rows of the DataMatrix.
References sgpp::datadriven::DataMatrixDistributed::getGlobalCols().
Referenced by add(), dot(), sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult_transpose(), and scale().
double * sgpp::datadriven::DataVectorDistributed::getLocalPointer | ( | ) |
References sgpp::datadriven::DataMatrixDistributed::getLocalPointer().
Referenced by add(), dot(), sgpp::datadriven::ModelFittingClassification::evaluate(), sgpp::datadriven::DataMatrixDistributed::mult(), sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult(), and scale().
const double * sgpp::datadriven::DataVectorDistributed::getLocalPointer | ( | ) | const |
References sgpp::datadriven::DataMatrixDistributed::getLocalPointer().
size_t sgpp::datadriven::DataVectorDistributed::getLocalRows | ( | ) | const |
References sgpp::datadriven::DataMatrixDistributed::getLocalColumns().
Referenced by sgpp::datadriven::ModelFittingClassification::evaluate(), and sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult().
DataMatrixDistributed & sgpp::datadriven::DataVectorDistributed::getMatrix | ( | ) |
Referenced by copyFrom().
const DataMatrixDistributed & sgpp::datadriven::DataVectorDistributed::getMatrix | ( | ) | const |
std::shared_ptr< BlacsProcessGrid > sgpp::datadriven::DataVectorDistributed::getProcessGrid | ( | ) | const |
References sgpp::datadriven::DataMatrixDistributed::getProcessGrid().
Referenced by sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult_transpose().
size_t sgpp::datadriven::DataVectorDistributed::globalToLocalRowIndex | ( | size_t | globalRowIndex | ) | const |
Calculates the local row index from the globalRowIndex.
globalRowIndex |
References sgpp::datadriven::DataMatrixDistributed::globalToLocalColumnIndex().
size_t sgpp::datadriven::DataVectorDistributed::globalToRowProcessIndex | ( | size_t | globalRowIndex | ) | const |
Calculates the row process index from the global row index.
globalRowIndex |
References sgpp::datadriven::DataMatrixDistributed::globalToColumnProcessIndex().
bool sgpp::datadriven::DataVectorDistributed::isProcessMapped | ( | ) | const |
References sgpp::datadriven::DataMatrixDistributed::isProcessMapped().
Referenced by add(), dot(), sgpp::datadriven::DataMatrixDistributed::mult(), sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult(), sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult_transpose(), and scale().
size_t sgpp::datadriven::DataVectorDistributed::localToGlobalRowIndex | ( | size_t | localRowIndex | ) | const |
Calculates the global row index from the local row index.
localRowIndex |
References sgpp::datadriven::DataMatrixDistributed::localToGlobalColumnIndex().
Referenced by sgpp::datadriven::ModelFittingClassification::evaluate(), and sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult().
double sgpp::datadriven::DataVectorDistributed::operator() | ( | size_t | row | ) | const |
Returns the value of the element at position [row].
Only a const version exists as setting an element is not necessarily done in local memory.
row | Row |
void sgpp::datadriven::DataVectorDistributed::printVector | ( | ) | const |
Prints the vector on stdout on process 0.
References toLocalDataVector(), and sgpp::base::DataVector::toString().
void sgpp::datadriven::DataVectorDistributed::resize | ( | size_t | rows | ) |
Resizes the vector to rows, discards the data.
rows |
References sgpp::datadriven::DataMatrixDistributed::resize().
Referenced by sgpp::datadriven::ModelFittingDensityEstimationOnOffParallel::adapt().
void sgpp::datadriven::DataVectorDistributed::scale | ( | double | a | ) |
Scales this vector by factor a.
a |
References getDescriptor(), getGlobalRows(), getLocalPointer(), and isProcessMapped().
Referenced by sgpp::datadriven::DBMatOnlineDE::evalParallel().
void sgpp::datadriven::DataVectorDistributed::set | ( | size_t | row, |
double | value | ||
) |
Sets the element at global position [row] to value.
row | Global row |
value | New value for element |
References sgpp::datadriven::DataMatrixDistributed::set().
void sgpp::datadriven::DataVectorDistributed::setAll | ( | double | value | ) |
Set all entries of the vector to one value.
value |
References sgpp::datadriven::DataMatrixDistributed::setAll().
Referenced by sgpp::datadriven::AlgorithmMultipleEvaluationDistributed< BASIS >::mult_transpose().
DataVector sgpp::datadriven::DataVectorDistributed::toLocalDataVector | ( | ) | const |
References sgpp::base::DataMatrix::getNcols(), and sgpp::datadriven::DataMatrixDistributed::toLocalDataMatrix().
Referenced by sgpp::datadriven::ModelFittingClassification::evaluate(), sgpp::datadriven::ModelFittingDensityEstimationOnOffParallel::evaluate(), and printVector().
void sgpp::datadriven::DataVectorDistributed::toLocalDataVector | ( | DataVector & | localVector | ) | const |
[out] | localVector | the gathered DataVector on process (0, 0) |
References sgpp::datadriven::DataMatrixDistributed::toLocalDataMatrix().
DataVector sgpp::datadriven::DataVectorDistributed::toLocalDataVectorBroadcast | ( | ) | const |
References sgpp::base::DataMatrix::getNcols(), and sgpp::datadriven::DataMatrixDistributed::toLocalDataMatrixBroadcast().
Referenced by sgpp::datadriven::ModelFittingDensityEstimationOnOffParallel::computeResidual(), sgpp::datadriven::ModelFittingDensityEstimationOnOffParallel::fit(), and sgpp::datadriven::ModelFittingDensityEstimationOnOffParallel::update().
void sgpp::datadriven::DataVectorDistributed::toLocalDataVectorBroadcast | ( | DataVector & | localVector | ) | const |
[out] | localVector | the broadcaster DataVector on all processes |
References sgpp::datadriven::DataMatrixDistributed::toLocalDataMatrixBroadcast().