fml  0.1-0
Fused Matrix Library
dimops Namespace Reference

Row/column operations. More...

Functions

template<typename REAL >
void rowsums (const cpumat< REAL > &x, cpuvec< REAL > &s)
 Compute the row sums. More...
 
template<typename REAL >
void rowmeans (const cpumat< REAL > &x, cpuvec< REAL > &s)
 Compute the row means. More...
 
template<typename REAL >
void colsums (const cpumat< REAL > &x, cpuvec< REAL > &s)
 Compute the column sums. More...
 
template<typename REAL >
void colmeans (const cpumat< REAL > &x, cpuvec< REAL > &s)
 Compute the column means. More...
 
template<typename REAL >
void scale (const bool rm_mean, const bool rm_sd, cpumat< REAL > &x)
 Remove the mean and/or the sd from a matrix. More...
 
template<typename REAL >
void rowsums (const gpumat< REAL > &x, gpuvec< REAL > &s)
 Compute the row sums. More...
 
template<typename REAL >
void rowmeans (const gpumat< REAL > &x, gpuvec< REAL > &s)
 Compute the row means. More...
 
template<typename REAL >
void colsums (const gpumat< REAL > &x, gpuvec< REAL > &s)
 Compute the column sums. More...
 
template<typename REAL >
void colmeans (const gpumat< REAL > &x, gpuvec< REAL > &s)
 Compute the column means. More...
 
template<typename REAL >
void scale (const bool rm_mean, const bool rm_sd, gpumat< REAL > &x)
 Remove the mean and/or the sd from a matrix. More...
 
template<typename REAL >
void rowsums (const mpimat< REAL > &x, cpuvec< REAL > &s)
 Compute the row sums. More...
 
template<typename REAL >
void rowmeans (const mpimat< REAL > &x, cpuvec< REAL > &s)
 Compute the row means. More...
 
template<typename REAL >
void colsums (const mpimat< REAL > &x, cpuvec< REAL > &s)
 Compute the column sums. More...
 
template<typename REAL >
void colmeans (const mpimat< REAL > &x, cpuvec< REAL > &s)
 Compute the column means. More...
 
template<typename REAL >
void scale (const bool rm_mean, const bool rm_sd, mpimat< REAL > &x)
 Remove the mean and/or the sd from a matrix. More...
 

Detailed Description

Row/column operations.

Function Documentation

◆ colmeans() [1/3]

template<typename REAL >
void dimops::colmeans ( const cpumat< REAL > &  x,
cpuvec< REAL > &  s 
)

Compute the column means.

Parameters
[in]xInput data.
[out]sColumn means.
Template Parameters
REALshould be 'float' or 'double'.

◆ colmeans() [2/3]

template<typename REAL >
void dimops::colmeans ( const gpumat< REAL > &  x,
gpuvec< REAL > &  s 
)

Compute the column means.

Parameters
[in]xInput data.
[out]sColumn means.
Implementation Details\n Uses linalg::matmult() on a vector of ones.
Memory Allocations\n If the output is inappropriately sized, it will automatically be
re-allocated. Additionally, some temporary work storage is needed.
Exceptions\n If a (re-)allocation is triggered and fails, a bad_alloc
exception will be thrown.
Template Parameters
REALshould be 'float' or 'double'.

◆ colmeans() [3/3]

template<typename REAL >
void dimops::colmeans ( const mpimat< REAL > &  x,
cpuvec< REAL > &  s 
)

Compute the column means.

Parameters
[in]xInput data.
[out]sColumn means.
Template Parameters
REALshould be 'float' or 'double'.

◆ colsums() [1/3]

template<typename REAL >
void dimops::colsums ( const cpumat< REAL > &  x,
cpuvec< REAL > &  s 
)

Compute the column sums.

Parameters
[in]xInput data.
[out]sColumn sums.
Template Parameters
REALshould be 'float' or 'double'.

◆ colsums() [2/3]

template<typename REAL >
void dimops::colsums ( const gpumat< REAL > &  x,
gpuvec< REAL > &  s 
)

Compute the column sums.

Parameters
[in]xInput data.
[out]sColumn sums.
Implementation Details\n Uses linalg::matmult() on a vector of ones.
Memory Allocations\n If the output is inappropriately sized, it will automatically be
re-allocated. Additionally, some temporary work storage is needed.
Exceptions\n If a (re-)allocation is triggered and fails, a bad_alloc
exception will be thrown.
Template Parameters
REALshould be 'float' or 'double'.

◆ colsums() [3/3]

template<typename REAL >
void dimops::colsums ( const mpimat< REAL > &  x,
cpuvec< REAL > &  s 
)

Compute the column sums.

Parameters
[in]xInput data.
[out]sColumn sums.
Template Parameters
REALshould be 'float' or 'double'.

◆ rowmeans() [1/3]

template<typename REAL >
void dimops::rowmeans ( const cpumat< REAL > &  x,
cpuvec< REAL > &  s 
)

Compute the row means.

Parameters
[in]xInput data.
[out]sRow means.
Template Parameters
REALshould be 'float' or 'double'.

◆ rowmeans() [2/3]

template<typename REAL >
void dimops::rowmeans ( const gpumat< REAL > &  x,
gpuvec< REAL > &  s 
)

Compute the row means.

Parameters
[in]xInput data.
[out]sRow means.
Implementation Details\n Uses linalg::matmult() on a vector of ones.
Memory Allocations\n If the output is inappropriately sized, it will automatically be
re-allocated. Additionally, some temporary work storage is needed.
Exceptions\n If a (re-)allocation is triggered and fails, a bad_alloc
exception will be thrown.
Template Parameters
REALshould be 'float' or 'double'.

◆ rowmeans() [3/3]

template<typename REAL >
void dimops::rowmeans ( const mpimat< REAL > &  x,
cpuvec< REAL > &  s 
)

Compute the row means.

Parameters
[in]xInput data.
[out]sRow means.
Template Parameters
REALshould be 'float' or 'double'.

◆ rowsums() [1/3]

template<typename REAL >
void dimops::rowsums ( const cpumat< REAL > &  x,
cpuvec< REAL > &  s 
)

Compute the row sums.

Parameters
[in]xInput data.
[out]sRow sums.
Template Parameters
REALshould be 'float' or 'double'.

◆ rowsums() [2/3]

template<typename REAL >
void dimops::rowsums ( const gpumat< REAL > &  x,
gpuvec< REAL > &  s 
)

Compute the row sums.

Parameters
[in]xInput data.
[out]sRow sums.
Implementation Details\n Uses linalg::matmult() on a vector of ones.
Memory Allocations\n If the output is inappropriately sized, it will automatically be
re-allocated. Additionally, some temporary work storage is needed.
Exceptions\n If a (re-)allocation is triggered and fails, a bad_alloc
exception will be thrown.
Template Parameters
REALshould be 'float' or 'double'.

◆ rowsums() [3/3]

template<typename REAL >
void dimops::rowsums ( const mpimat< REAL > &  x,
cpuvec< REAL > &  s 
)

Compute the row sums.

Parameters
[in]xInput data.
[out]sRow sums.
Template Parameters
REALshould be 'float' or 'double'.

◆ scale() [1/3]

template<typename REAL >
void dimops::scale ( const bool  rm_mean,
const bool  rm_sd,
cpumat< REAL > &  x 
)

Remove the mean and/or the sd from a matrix.

Parameters
[in]rm_meanRemove the column means?
[in]rm_sdRemove the column sds?
[in,out]xData to center/scale.
Template Parameters
REALshould be 'float' or 'double'.

◆ scale() [2/3]

template<typename REAL >
void dimops::scale ( const bool  rm_mean,
const bool  rm_sd,
gpumat< REAL > &  x 
)

Remove the mean and/or the sd from a matrix.

Parameters
[in]rm_meanRemove the column means?
[in]rm_sdRemove the column sds?
[in,out]xData to center/scale.
Memory Allocations\n Some temporary work storage is needed to store vectors of means
and/or standard deviations, depending on what is requested.
Exceptions\n If an allocation fails, a bad_alloc exception will be thrown.
Template Parameters
REALshould be 'float' or 'double'.

◆ scale() [3/3]

template<typename REAL >
void dimops::scale ( const bool  rm_mean,
const bool  rm_sd,
mpimat< REAL > &  x 
)

Remove the mean and/or the sd from a matrix.

Parameters
[in]rm_meanRemove the column means?
[in]rm_sdRemove the column sds?
[in,out]xData to center/scale.
Template Parameters
REALshould be 'float' or 'double'.