SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::base::DataMatrixSP Class Reference

A class to store two-dimensional data. More...

#include <DataMatrixSP.hpp>

Inheritance diagram for sgpp::base::DataMatrixSP:

Public Member Functions

void abs ()
 Sets all elements to their absolute value.
 
void add (const DataMatrixSP &matr)
 Adds the values from another DataMatrixSP to the current values.
 
void addReduce (DataVectorSP &reduction)
 Reduce the DataMatrixSP along the columns by adding all entries in one row.
 
void addReduce (DataVectorSP &reduction, DataVectorSP &beta, size_t start_beta)
 Reduce the DataMatrixSP along the columns by adding all entries in one row.
 
size_t appendCol (const DataVectorSP &vec)
 Appends a new Col with data contained in DataVectorSP vec and returns index of new col.
 
size_t appendRow ()
 Appends a new row and returns index of it.
 
size_t appendRow (const DataVectorSP &vec)
 Appends a new row with data contained in DataVectorSP vec and returns index of new row.
 
void componentwise_div (const DataMatrixSP &matr)
 Divides the current DataMatrixSP component-wise by another DataMatrixSP.
 
void componentwise_mult (const DataMatrixSP &matr)
 Multiplies the current DataMatrixSP component-wise with another DataMatrixSP.
 
void copyFrom (const DataMatrixSP &matr)
 Copies the data from another DataMatrixSP matr.
 
 DataMatrixSP ()
 Creates an empty two-dimensional DataMatrixSP.
 
 DataMatrixSP (const DataMatrixSP &)=default
 Copy constructor.
 
 DataMatrixSP (const float *input, size_t nrows, size_t ncols)
 Create a new DataMatrixSP from a float array.
 
 DataMatrixSP (DataMatrixSP &&)=default
 Move constructor.
 
 DataMatrixSP (size_t nrows, size_t ncols)
 Create a two-dimensional DataMatrixSP with nrows rows and ncols columns (uninitialized values).
 
 DataMatrixSP (size_t nrows, size_t ncols, float value)
 Create a two-dimensional DataMatrixSP with nrows rows and ncols columns and initializes all elements with the same value.
 
 DataMatrixSP (std::initializer_list< float > input, size_t nrows)
 Create a new DataMatrixSP from a std::initializer_list<float>.
 
 DataMatrixSP (std::vector< float > input, size_t nrows)
 Create a new DataMatrixSP from a std::vector<float>.
 
void expand (const DataVectorSP &expand)
 expands a given DataVectorSP into a DataMatrixSP.
 
float get (size_t row, size_t col) const
 Returns the value of the element at position [row,col].
 
size_t getAdditionallyReservedRows () const
 Returns the number of unused rows.
 
void getColumn (size_t col, DataVectorSP &vec) const
 Copies the values of a column to the DataVectorSP vec.
 
size_t getNcols () const
 Returns the number of columns of the DataMatrixSP.
 
size_t getNrows () const
 Returns the number of rows of the DataMatrixSP.
 
size_t getNumberNonZero () const
 Determines the number of non-zero elements in the vector.
 
float * getPointer ()
 Returns pointer to float array containing underlying data.
 
const float * getPointer () const
 Returns const pointer to float array containing underlying data.
 
void getRow (size_t row, DataVectorSP &vec) const
 Copies the values of a row to the DataVectorSP vec.
 
void getRow (size_t row, std::vector< float > &vec) const
 Copies the values of a row to the std::vector vec.
 
size_t getSize () const
 Returns the total number of (used) elements, i.e., getNrows()*getNCols()
 
float max () const
 Returns the maximum over all entries.
 
float max (size_t col) const
 Returns the maximum value of column col.
 
float min () const
 Returns the minimum over all entries.
 
float min (size_t col) const
 Returns the minimum value of column col.
 
void minmax (float *min, float *max) const
 Determines minimum and maximum over all entries.
 
void minmax (size_t col, float *min, float *max) const
 Determines minimum and maximum of column col.
 
void mult (const DataVectorSP &x, DataVectorSP &y) const
 Multiplies the matrix with a vector x and stores the result in another vector y.
 
void mult (float scalar)
 Multiplies all elements by a constant factor.
 
void normalizeDimension (size_t d)
 Normalizes the d-th dimension (entries in the d-th column) to \([0,1]\).
 
void normalizeDimension (size_t d, float border)
 Normalizes the d-th dimension (entries in the d-th column) to \([border,1-border]\).
 
float & operator() (size_t row, size_t col)
 Returns the value of the element at position [row,col].
 
const float & operator() (size_t row, size_t col) const
 Returns the value of the element at position [row,col].
 
DataMatrixSPoperator= (const DataMatrixSP &)=default
 Copy assignment operator.
 
DataMatrixSPoperator= (DataMatrixSP &&)=default
 Move assignment operator.
 
void reserveAdditionalRows (size_t inc_nrows)
 Reserves memory for potentially inc_nrows new rows; the actual number of rows remains unchanged.
 
void resize (size_t nrows)
 Resizes the DataMatrixSP to nrows rows.
 
void resize (size_t nrows, size_t ncols)
 Resizes the DataMatrixSP to nrows rows and ncols columns.
 
void resizeQuadratic (size_t size)
 Resizes the quadratic DataMatrixSP to size rows and size columns.
 
void resizeRows (size_t nrows)
 Resizes the DataMatrixSP to nrows rows.
 
void resizeRowsCols (size_t nrows, size_t ncols)
 Resizes the DataMatrixSP to nrows rows and ncols columns.
 
void resizeToSubMatrix (size_t row_1, size_t col_1, size_t row_2, size_t col_2)
 Resize current matrix to the submatrix Mat[row_1:row_2, col_1:col_2].
 
void resizeZero (size_t nrows)
 Resizes the DataMatrixSP to nrows rows.
 
void resizeZero (size_t nrows, size_t ncols)
 Resizes the DataMatrixSP to nrows rows and ncols columns.
 
void set (size_t row, size_t col, float value)
 Sets the element at position [row,col] to value.
 
void setAll (float value)
 Sets all entries of DataMatrixSP to value.
 
void setColumn (size_t col, const DataVectorSP &vec)
 Sets a column of the DataMatrixSP to the values of a DataVectorSP vec.
 
void setRow (size_t row, const DataVectorSP &vec)
 Sets a row of the DataMatrixSP to the values of a DataVectorSP vec.
 
void sqr ()
 Squares all elements of the DataMatrixSP.
 
void sqrt ()
 Takes the square root of all elements of the DataMatrixSP.
 
void sub (const DataMatrixSP &matr)
 Subtracts the values from another DataMatrixSP of the current values.
 
float sum () const
 Returns the sum of all elements.
 
void toFile (const std::string &fileName) const
 
std::string toString () const
 Returns a description of the DataMatrixSP as a string.
 
void toString (std::string &text) const
 Writes the data stored in the DataMatrixSP into a string.
 
void transpose ()
 Transposes this DataMatrixSP.
 
 ~DataMatrixSP ()=default
 Destructor.
 

Static Public Member Functions

static DataMatrixSP fromFile (const std::string &fileName)
 
static DataMatrixSP fromString (const std::string &serializedVector)
 

Detailed Description

A class to store two-dimensional data.

Typically, DataMatrixSP would contain a set of (d-dimensional) data or evaluation points, i.e., the DataMatrixSP consists of d columns, and each row is one of the points. Thus, typical functionality like obtaining the maximum for a certain dimension (or attribute), or normalizing all data points to the unit interval for a certain dimension are provided.

This is an re-implementation of the standard DataMatrix for single precision floating point numbers in order to increase support for GPUs.

Constructor & Destructor Documentation

◆ DataMatrixSP() [1/8]

sgpp::base::DataMatrixSP::DataMatrixSP ( )

Creates an empty two-dimensional DataMatrixSP.

◆ DataMatrixSP() [2/8]

sgpp::base::DataMatrixSP::DataMatrixSP ( const DataMatrixSP )
default

Copy constructor.

◆ DataMatrixSP() [3/8]

sgpp::base::DataMatrixSP::DataMatrixSP ( DataMatrixSP &&  )
default

Move constructor.

◆ ~DataMatrixSP()

sgpp::base::DataMatrixSP::~DataMatrixSP ( )
default

Destructor.

◆ DataMatrixSP() [4/8]

sgpp::base::DataMatrixSP::DataMatrixSP ( size_t  nrows,
size_t  ncols 
)

Create a two-dimensional DataMatrixSP with nrows rows and ncols columns (uninitialized values).

Parameters
nrowsNumber of rows
ncolsNumber of columns

◆ DataMatrixSP() [5/8]

sgpp::base::DataMatrixSP::DataMatrixSP ( size_t  nrows,
size_t  ncols,
float  value 
)

Create a two-dimensional DataMatrixSP with nrows rows and ncols columns and initializes all elements with the same value.

Parameters
nrowsNumber of rows
ncolsNumber of columns
valueValue for all entries

◆ DataMatrixSP() [6/8]

sgpp::base::DataMatrixSP::DataMatrixSP ( const float *  input,
size_t  nrows,
size_t  ncols 
)

Create a new DataMatrixSP from a float array.

The float array contains the entries row-wise: x0_0,x0_1,...,x0_ncol-1, x1_0,x1_1,... ... xnrow_0, xnrow_1,...,xnrow_ncol-1

Parameters
inputfloat array that contains the data
nrowsnumber of rows
ncolsnumber of columns

◆ DataMatrixSP() [7/8]

sgpp::base::DataMatrixSP::DataMatrixSP ( std::vector< float >  input,
size_t  nrows 
)
explicit

Create a new DataMatrixSP from a std::vector<float>.

Parameters
inputstd::vector<float> that contains the data
nrowsnumber of rows

◆ DataMatrixSP() [8/8]

sgpp::base::DataMatrixSP::DataMatrixSP ( std::initializer_list< float >  input,
size_t  nrows 
)
explicit

Create a new DataMatrixSP from a std::initializer_list<float>.

Parameters
inputstd::initializer_list<float> that contains the data
nrowsnumber of rows

Member Function Documentation

◆ abs()

void sgpp::base::DataMatrixSP::abs ( )

Sets all elements to their absolute value.

◆ add()

void sgpp::base::DataMatrixSP::add ( const DataMatrixSP matr)

Adds the values from another DataMatrixSP to the current values.

Modifies the current values.

Parameters
matrThe DataMatrixSP which is added to the current values

◆ addReduce() [1/2]

void sgpp::base::DataMatrixSP::addReduce ( DataVectorSP reduction)

Reduce the DataMatrixSP along the columns by adding all entries in one row.

Parameters
reductionDataVectorSP into which the reduce columns are stored

References sgpp::base::DataVectorSP::getSize(), and sgpp::base::DataVectorSP::set().

◆ addReduce() [2/2]

void sgpp::base::DataMatrixSP::addReduce ( DataVectorSP reduction,
DataVectorSP beta,
size_t  start_beta 
)

Reduce the DataMatrixSP along the columns by adding all entries in one row.

Parameters
reductionDataVectorSP to which the reduce columns are added
betavector with length of number of columns beta[i] is multiplied to each element row[j][i]
start_betawhere to start using the beta coefficients

References sgpp::base::DataVectorSP::getSize(), and sgpp::base::DataVectorSP::set().

◆ appendCol()

size_t sgpp::base::DataMatrixSP::appendCol ( const DataVectorSP vec)

Appends a new Col with data contained in DataVectorSP vec and returns index of new col.

Parameters
vecDataVectorSP (length has to match getNcols()) with data
Returns
Index of new col

References sgpp::base::DataVectorSP::getSize().

◆ appendRow() [1/2]

size_t sgpp::base::DataMatrixSP::appendRow ( )

Appends a new row and returns index of it.

Returns
Index of new row

◆ appendRow() [2/2]

size_t sgpp::base::DataMatrixSP::appendRow ( const DataVectorSP vec)

Appends a new row with data contained in DataVectorSP vec and returns index of new row.

Parameters
vecDataVectorSP (length has to match getNcols()) with data
Returns
Index of new row

References sgpp::base::DataVectorSP::getSize().

◆ componentwise_div()

void sgpp::base::DataMatrixSP::componentwise_div ( const DataMatrixSP matr)

Divides the current DataMatrixSP component-wise by another DataMatrixSP.

Modifies the current values. Performs

for i from 1 to this.getTotalSize()
this[i] /= matr[i]

Note: No check for division by zero!

Parameters
matrthe DataMatrixSP which the current DataMatrixSP is divided by

◆ componentwise_mult()

void sgpp::base::DataMatrixSP::componentwise_mult ( const DataMatrixSP matr)

Multiplies the current DataMatrixSP component-wise with another DataMatrixSP.

Modifies the current values. Performs

for i from 1 to this.getSize()
this[i] *= matr[i]
size_t getSize() const
Returns the total number of (used) elements, i.e., getNrows()*getNCols()
Definition DataMatrixSP.hpp:516
Parameters
matrthe DataMatrixSP which is multiplied to current DataMatrixSP

◆ copyFrom()

void sgpp::base::DataMatrixSP::copyFrom ( const DataMatrixSP matr)

Copies the data from another DataMatrixSP matr.

Disregards the number of rows and columns set for the two matrices, i.e., just copies the data entry by entry (and row by row). If the dimensions match (nrows, ncols), the current DataMatrixSP is an exact copy of matr. If not, as many elements as possible are copied, and everything else is left untouched.

Parameters
matrThe source DataMatrixSP containing the data

◆ expand()

void sgpp::base::DataMatrixSP::expand ( const DataVectorSP expand)

expands a given DataVectorSP into a DataMatrixSP.

Parameters
expandDataVectorSP that should be expanded

References expand().

Referenced by expand().

◆ fromFile()

DataMatrixSP sgpp::base::DataMatrixSP::fromFile ( const std::string &  fileName)
static

References f, fileName, and fromString().

◆ fromString()

DataMatrixSP sgpp::base::DataMatrixSP::fromString ( const std::string &  serializedVector)
static

◆ get()

float sgpp::base::DataMatrixSP::get ( size_t  row,
size_t  col 
) const
inline

Returns the value of the element at position [row,col].

Parameters
rowRow
colColumn
Returns
Value of the element

Referenced by sgpp::base::PrecisionConverter::convertDataMatrixSPToDataMatrix().

◆ getAdditionallyReservedRows()

size_t sgpp::base::DataMatrixSP::getAdditionallyReservedRows ( ) const
inline

Returns the number of unused rows.

Returns
number of unused rows

◆ getColumn()

void sgpp::base::DataMatrixSP::getColumn ( size_t  col,
DataVectorSP vec 
) const

Copies the values of a column to the DataVectorSP vec.

Parameters
colThe column
vecDataVectorSP into which the data is written

References sgpp::base::DataVectorSP::getSize().

◆ getNcols()

size_t sgpp::base::DataMatrixSP::getNcols ( ) const
inline

Returns the number of columns of the DataMatrixSP.

Returns
Number of columns

Referenced by sgpp::base::PrecisionConverter::convertDataMatrixSPToDataMatrix(), and sgpp::datadriven::LearnerBaseSP::predict().

◆ getNrows()

size_t sgpp::base::DataMatrixSP::getNrows ( ) const
inline

◆ getNumberNonZero()

size_t sgpp::base::DataMatrixSP::getNumberNonZero ( ) const

Determines the number of non-zero elements in the vector.

Returns
The number of non-zero elements

◆ getPointer() [1/2]

float * sgpp::base::DataMatrixSP::getPointer ( )

Returns pointer to float array containing underlying data.

Returns
Pointer to data

◆ getPointer() [2/2]

const float * sgpp::base::DataMatrixSP::getPointer ( ) const

Returns const pointer to float array containing underlying data.

Returns
Const pointer to data

◆ getRow() [1/2]

void sgpp::base::DataMatrixSP::getRow ( size_t  row,
DataVectorSP vec 
) const

Copies the values of a row to the DataVectorSP vec.

Parameters
rowThe row
vecDataVectorSP into which the data is written

References sgpp::base::DataVectorSP::getSize().

◆ getRow() [2/2]

void sgpp::base::DataMatrixSP::getRow ( size_t  row,
std::vector< float > &  vec 
) const

Copies the values of a row to the std::vector vec.

Parameters
rowThe row
vecstd::vector into which the data is written

◆ getSize()

size_t sgpp::base::DataMatrixSP::getSize ( ) const
inline

◆ max() [1/2]

float sgpp::base::DataMatrixSP::max ( ) const

Returns the maximum over all entries.

Returns
Maximal value of all entries

References max().

Referenced by max(), and max().

◆ max() [2/2]

float sgpp::base::DataMatrixSP::max ( size_t  col) const

Returns the maximum value of column col.

Parameters
colNumber of the column
Returns
Maximum value

References max().

◆ min() [1/2]

float sgpp::base::DataMatrixSP::min ( ) const

Returns the minimum over all entries.

Returns
Minimal value of all entries

References min().

Referenced by min(), and min().

◆ min() [2/2]

float sgpp::base::DataMatrixSP::min ( size_t  col) const

Returns the minimum value of column col.

Parameters
colNumber of the column
Returns
Minimum value

References min().

◆ minmax() [1/2]

void sgpp::base::DataMatrixSP::minmax ( float *  min,
float *  max 
) const

Determines minimum and maximum over all entries.

Parameters
minReference variable for the minimum
maxReference variable for the maximum

◆ minmax() [2/2]

void sgpp::base::DataMatrixSP::minmax ( size_t  col,
float *  min,
float *  max 
) const

Determines minimum and maximum of column col.

Parameters
colNumber of the column
minReference variable for the minimum
maxReference variable for the maximum

Referenced by normalizeDimension().

◆ mult() [1/2]

void sgpp::base::DataMatrixSP::mult ( const DataVectorSP x,
DataVectorSP y 
) const

Multiplies the matrix with a vector x and stores the result in another vector y.

Parameters
[in]xvector to be multiplied
[out]yvector in which the result should be stored

References sgpp::base::DataVectorSP::getSize().

◆ mult() [2/2]

void sgpp::base::DataMatrixSP::mult ( float  scalar)

Multiplies all elements by a constant factor.

Parameters
scalarthe constant

◆ normalizeDimension() [1/2]

void sgpp::base::DataMatrixSP::normalizeDimension ( size_t  d)

Normalizes the d-th dimension (entries in the d-th column) to \([0,1]\).

Considers contents of DataMatrixSP as a d-dimensional dataset, one data point per row.

Parameters
dThe dimension (column) that should be normalized (starting with 0)

References normalizeDimension().

Referenced by normalizeDimension().

◆ normalizeDimension() [2/2]

void sgpp::base::DataMatrixSP::normalizeDimension ( size_t  d,
float  border 
)

Normalizes the d-th dimension (entries in the d-th column) to \([border,1-border]\).

Considers contents of DataMatrixSP as a d-dimensional dataset, one data point per row.

Parameters
dThe dimension (column) that should be normalized (starting with 0)
borderWidth of the border

References minmax().

◆ operator()() [1/2]

float & sgpp::base::DataMatrixSP::operator() ( size_t  row,
size_t  col 
)
inline

Returns the value of the element at position [row,col].

Parameters
rowRow
colColumn
Returns
reference to the element

◆ operator()() [2/2]

const float & sgpp::base::DataMatrixSP::operator() ( size_t  row,
size_t  col 
) const
inline

Returns the value of the element at position [row,col].

Parameters
rowRow
colColumn
Returns
constant reference to the element

◆ operator=() [1/2]

DataMatrixSP & sgpp::base::DataMatrixSP::operator= ( const DataMatrixSP )
default

Copy assignment operator.

◆ operator=() [2/2]

DataMatrixSP & sgpp::base::DataMatrixSP::operator= ( DataMatrixSP &&  )
default

Move assignment operator.

◆ reserveAdditionalRows()

void sgpp::base::DataMatrixSP::reserveAdditionalRows ( size_t  inc_nrows)

Reserves memory for potentially inc_nrows new rows; the actual number of rows remains unchanged.

Corresponds to a resize to nrows+inc_nrows new rows while leaving the current matrix' size unchanged.

Parameters
inc_nrowsNumber of additional rows for which storage is to be reserved.

Referenced by resizeToSubMatrix().

◆ resize() [1/2]

void sgpp::base::DataMatrixSP::resize ( size_t  nrows)

Resizes the DataMatrixSP to nrows rows.

All new additional entries are uninitialized. If nrows is smaller than the current number of rows, all superfluous entries are removed.

Deprecated:
use resizeRows
Parameters
nrowsNew number of rows of the DataMatrixSP

References resizeRows().

Referenced by resizeQuadratic(), resizeToSubMatrix(), and transpose().

◆ resize() [2/2]

void sgpp::base::DataMatrixSP::resize ( size_t  nrows,
size_t  ncols 
)

Resizes the DataMatrixSP to nrows rows and ncols columns.

All new additional entries are uninitialized. If nrows*ncols is smaller than the current number of entries, all superfluous entries are removed.

Deprecated:
use resizeRowsCols
Parameters
nrowsNew number of rows of the DataMatrixSP
ncolsNew number of columns of the DataMatrixSP

References resizeRowsCols().

◆ resizeQuadratic()

void sgpp::base::DataMatrixSP::resizeQuadratic ( size_t  size)

Resizes the quadratic DataMatrixSP to size rows and size columns.

All new additional entries are uninitialized. If size is smaller than the current size of the quadratic DataMatrixSP, all superfluous entries are removed.

Parameters
sizeNew dimension of quadratic data DataMatrixSP

References resize().

◆ resizeRows()

void sgpp::base::DataMatrixSP::resizeRows ( size_t  nrows)

Resizes the DataMatrixSP to nrows rows.

All new additional entries are uninitialized. If nrows is smaller than the current number of rows, all superfluous entries are removed.

Parameters
nrowsNew number of rows of the DataMatrixSP

Referenced by resize(), and resizeZero().

◆ resizeRowsCols()

void sgpp::base::DataMatrixSP::resizeRowsCols ( size_t  nrows,
size_t  ncols 
)

Resizes the DataMatrixSP to nrows rows and ncols columns.

All new additional entries are uninitialized. If nrows*ncols is smaller than the current number of entries, all superfluous entries are removed.

Parameters
nrowsNew number of rows of the DataMatrixSP
ncolsNew number of columns of the DataMatrixSP

Referenced by resize(), and resizeZero().

◆ resizeToSubMatrix()

void sgpp::base::DataMatrixSP::resizeToSubMatrix ( size_t  row_1,
size_t  col_1,
size_t  row_2,
size_t  col_2 
)

Resize current matrix to the submatrix Mat[row_1:row_2, col_1:col_2].

Parameters
row_1,col_1corresponding to left upper index of desired submatrix
row_2,col_2corresponding to right lower index of desired submatrix

References reserveAdditionalRows(), and resize().

◆ resizeZero() [1/2]

void sgpp::base::DataMatrixSP::resizeZero ( size_t  nrows)

Resizes the DataMatrixSP to nrows rows.

All new additional entries are set to zero. If nrows is smaller than the current number of rows, all superfluous entries are removed.

Deprecated:
use resizeRows
Parameters
nrowsNew number of rows of the DataMatrixSP

References resizeRows().

◆ resizeZero() [2/2]

void sgpp::base::DataMatrixSP::resizeZero ( size_t  nrows,
size_t  ncols 
)

Resizes the DataMatrixSP to nrows rows and ncols columns.

All new additional entries are set to zero. If nrows*ncols is smaller than the current number of entries, all superfluous entries are removed.

Deprecated:
use resizeRowsCols
Parameters
nrowsNew number of rows of the DataMatrixSP
ncolsNew number of columns of the DataMatrixSP

References resizeRowsCols().

◆ set()

void sgpp::base::DataMatrixSP::set ( size_t  row,
size_t  col,
float  value 
)
inline

Sets the element at position [row,col] to value.

Parameters
rowRow
colColumn
valueNew value for element

Referenced by sgpp::base::HashGridStorage::getLevelIndexArraysForEval(), and sgpp::base::HashGridStorage::getLevelIndexMaskArraysForModEval().

◆ setAll()

void sgpp::base::DataMatrixSP::setAll ( float  value)

Sets all entries of DataMatrixSP to value.

Parameters
valueNew value for all entries

◆ setColumn()

void sgpp::base::DataMatrixSP::setColumn ( size_t  col,
const DataVectorSP vec 
)

Sets a column of the DataMatrixSP to the values of a DataVectorSP vec.

Parameters
colThe column which is to be overwritten
vecDataVectorSP containing the data of the column

References sgpp::base::DataVectorSP::get(), and sgpp::base::DataVectorSP::getSize().

◆ setRow()

void sgpp::base::DataMatrixSP::setRow ( size_t  row,
const DataVectorSP vec 
)

Sets a row of the DataMatrixSP to the values of a DataVectorSP vec.

Parameters
rowThe row which is to be overwritten
vecDataVectorSP containing the data of the row

References sgpp::base::DataVectorSP::get(), and sgpp::base::DataVectorSP::getSize().

◆ sqr()

void sgpp::base::DataMatrixSP::sqr ( )

Squares all elements of the DataMatrixSP.

◆ sqrt()

void sgpp::base::DataMatrixSP::sqrt ( )

Takes the square root of all elements of the DataMatrixSP.

◆ sub()

void sgpp::base::DataMatrixSP::sub ( const DataMatrixSP matr)

Subtracts the values from another DataMatrixSP of the current values.

Modifies the current values.

Parameters
matrThe DataMatrixSP which is subtracted from the current values

◆ sum()

float sgpp::base::DataMatrixSP::sum ( ) const

Returns the sum of all elements.

Returns
The sum of all elements

◆ toFile()

void sgpp::base::DataMatrixSP::toFile ( const std::string &  fileName) const

References f, fileName, and toString().

◆ toString() [1/2]

◆ toString() [2/2]

◆ transpose()

void sgpp::base::DataMatrixSP::transpose ( )

Transposes this DataMatrixSP.

References resize().


The documentation for this class was generated from the following files: