DDMat

This class is used to represent [nrows][ncols] Distributed Dense Matrix by a 1D vector. More…

#include "DDMat.h"

Inherited by DDMat_CPU

Public Functions

Name
DDMat & operator=(DDMat const & other)
Copy operator.
iReg get_nrows()
Retrieve the number of rows.
iReg get_nrows() const
iReg get_ncols()
Retrieve the number of columns.
iReg get_ncols() const
rExt * get_ptr_coef_data()
Retrieve the pointer to the coef data.
const rExt * get_ptr_coef_data() const
void Orthonorm_RLGS()
Orthonormalize a matrix using the Right-Looking Gram-Schmidt process which should be numerically equivalent to modified Gram-Schmidt. The matrix is orthonormalized in place. reduc is an optional argument.
virtual ~DDMat() =0
Deletes the object.
virtual void clear() =0
Deletes the object.
virtual void copy(DDMat const & other) =0
virtual void resize(const iReg new_nrows, const iReg new_ncols) =0
Resize the structure.
virtual void overlap(const iReg nrows, const iReg ncols, rExt *const coef) =0
Fills object assigning pointer.
virtual void assign_nullptr() =0
Assign null pointer.
virtual void dxpay(const VEC_CPU< rExt > & da, const DDMat & x) =0
Performs dxpay: y = da * y + x.
virtual void daxpy(const VEC_CPU< rExt > & da, const DDMat & x) =0
Performs daxpy: y = y + da * x.
virtual void daxpy_xFix(const VEC_CPU< rExt > & da, const DDMat & x, const iReg icol) =0
Performs daxpy: y = y + da * x with icol-x fixed.
virtual void dot(const DDMat & x, VEC_CPU< rExt > & dot) =0
Performs scalar product: y * x = dot.
virtual void DxV(const VEC< rExt > & D, const DDMat & x) =0
Permorms the product with a diagonal matrix y = D * x.
virtual void dot_xFix(const DDMat & x, const iReg icol, VEC_CPU< rExt > & dot) =0
Performs scalar product: y * x = dot (fixing the icol-column of x)
virtual void MtxM_dot(const rExt alpha, const rExt beta, const DDMat & B, DDMat & C, VEC_CPU< rExt > * vec_reduc =nullptr) const =0
Computes the matrix by matrix product:
virtual void MxLocalM(const rExt alpha, const rExt beta, const DDMat & B, DDMat & C) const =0
Computes the matrix by matrix product:
virtual void nrm2(VEC_CPU< rExt > & nrm) =0
Performs the norm-2.
virtual void scal(const VEC_CPU< rExt > & fac) =0
Performs the product witha scalar: y = y * fac.
virtual void set_all_coef(const rExt input_value) =0
Set all coef values.
virtual void set_random_coef(const DDMat & V0) =0
Set random values for all coef values.
virtual void set_col_coef(const iReg input_icol, const rExt input_value) =0
Set column coef values.
virtual void CreateFromCPU(const DDMat & Mat) =0
Creates a DDMat (this) from a DDMat_CPU.
virtual void CreateFromGPU(const DDMat & Mat) =0
Creates a DDMat (this) from a DDMat_GPU.
virtual void accumulate_rows(const DDMat & V0) =0
Accumulate the coefficient of each row into a DDMat with a only one column.
virtual void CompactVECDDMat2DDMat(VEC_CPU< DDMat * > & vecddmat) =0

Protected Functions

Name
void copy_DDMat(DDMat const & other)
Copy protected members.

Public Attributes

Name
iReg nrows
number of rows.
iReg ncols
number of columns.
VEC< rExt > * coef
Coefficients of the dense matrix.

Detailed Description

class DDMat;

This class is used to represent [nrows][ncols] Distributed Dense Matrix by a 1D vector.

class DDMat.

Public Functions Documentation

function operator=

DDMat & operator=(
    DDMat const & other
)

Copy operator.

function get_nrows

iReg get_nrows()

Retrieve the number of rows.

function get_nrows

iReg get_nrows() const

function get_ncols

iReg get_ncols()

Retrieve the number of columns.

function get_ncols

iReg get_ncols() const

function get_ptr_coef_data

rExt * get_ptr_coef_data()

Retrieve the pointer to the coef data.

function get_ptr_coef_data

const rExt * get_ptr_coef_data() const

function Orthonorm_RLGS

void Orthonorm_RLGS()

Orthonormalize a matrix using the Right-Looking Gram-Schmidt process which should be numerically equivalent to modified Gram-Schmidt. The matrix is orthonormalized in place. reduc is an optional argument.

function ~DDMat

virtual ~DDMat() =0

Deletes the object.

function clear

virtual void clear() =0

Deletes the object.

Reimplemented by: DDMat_CPU::clear

function copy

virtual void copy(
    DDMat const & other
) =0

Reimplemented by: DDMat_CPU::copy

@ brief Copy.

function resize

virtual void resize(
    const iReg new_nrows,
    const iReg new_ncols
) =0

Resize the structure.

Parameters:

  • new_nrows number of rows.
  • new_ncols number of columns.

Reimplemented by: DDMat_CPU::resize

function overlap

virtual void overlap(
    const iReg nrows,
    const iReg ncols,
    rExt *const coef
) =0

Fills object assigning pointer.

Parameters:

  • nrows number of rows.
  • ncols number of columns.
  • coef pointer to overlap

Reimplemented by: DDMat_CPU::overlap

function assign_nullptr

virtual void assign_nullptr() =0

Assign null pointer.

Reimplemented by: DDMat_CPU::assign_nullptr

function dxpay

virtual void dxpay(
    const VEC_CPU< rExt > & da,
    const DDMat & x
) =0

Performs dxpay: y = da * y + x.

Reimplemented by: DDMat_CPU::dxpay

function daxpy

virtual void daxpy(
    const VEC_CPU< rExt > & da,
    const DDMat & x
) =0

Performs daxpy: y = y + da * x.

Reimplemented by: DDMat_CPU::daxpy

function daxpy_xFix

virtual void daxpy_xFix(
    const VEC_CPU< rExt > & da,
    const DDMat & x,
    const iReg icol
) =0

Performs daxpy: y = y + da * x with icol-x fixed.

Reimplemented by: DDMat_CPU::daxpy_xFix

function dot

virtual void dot(
    const DDMat & x,
    VEC_CPU< rExt > & dot
) =0

Performs scalar product: y * x = dot.

Reimplemented by: DDMat_CPU::dot

function DxV

virtual void DxV(
    const VEC< rExt > & D,
    const DDMat & x
) =0

Permorms the product with a diagonal matrix y = D * x.

Reimplemented by: DDMat_CPU::DxV

function dot_xFix

virtual void dot_xFix(
    const DDMat & x,
    const iReg icol,
    VEC_CPU< rExt > & dot
) =0

Performs scalar product: y * x = dot (fixing the icol-column of x)

Reimplemented by: DDMat_CPU::dot_xFix

function MtxM_dot

virtual void MtxM_dot(
    const rExt alpha,
    const rExt beta,
    const DDMat & B,
    DDMat & C,
    VEC_CPU< rExt > * vec_reduc =nullptr
) const =0

Computes the matrix by matrix product:

Parameters:

  • alpha scalar factor to multily A and B.
  • berta scalar factor to multily C.
  • B matrix multiplied by this.
  • C resulting matrix.
  • vec_reduc optional reduction vector.

Reimplemented by: DDMat_CPU::MtxM_dot

   C = alpha*At*B + beta*C,   with A = this

   The scratch vector must be of size at least A.ncols*B.ncols*nthread
   The same result is stored in each rank of the communicator

function MxLocalM

virtual void MxLocalM(
    const rExt alpha,
    const rExt beta,
    const DDMat & B,
    DDMat & C
) const =0

Computes the matrix by matrix product:

Parameters:

  • alpha scalar factor to multily A and B.
  • berta scalar factor to multily C.
  • B matrix multiplied by this.
  • C resulting matrix.

Reimplemented by: DDMat_CPU::MxLocalM

   C = alpha*A*B + beta*C,   with A = this and B store on each process

function nrm2

virtual void nrm2(
    VEC_CPU< rExt > & nrm
) =0

Performs the norm-2.

Reimplemented by: DDMat_CPU::nrm2

function scal

virtual void scal(
    const VEC_CPU< rExt > & fac
) =0

Performs the product witha scalar: y = y * fac.

Reimplemented by: DDMat_CPU::scal

function set_all_coef

virtual void set_all_coef(
    const rExt input_value
) =0

Set all coef values.

Parameters:

  • input_value value to set.

Reimplemented by: DDMat_CPU::set_all_coef

function set_random_coef

virtual void set_random_coef(
    const DDMat & V0
) =0

Set random values for all coef values.

Reimplemented by: DDMat_CPU::set_random_coef

function set_col_coef

virtual void set_col_coef(
    const iReg input_icol,
    const rExt input_value
) =0

Set column coef values.

Parameters:

  • input_icol column index to set.
  • input_value value to set.

Reimplemented by: DDMat_CPU::set_col_coef

function CreateFromCPU

virtual void CreateFromCPU(
    const DDMat & Mat
) =0

Creates a DDMat (this) from a DDMat_CPU.

Reimplemented by: DDMat_CPU::CreateFromCPU

function CreateFromGPU

virtual void CreateFromGPU(
    const DDMat & Mat
) =0

Creates a DDMat (this) from a DDMat_GPU.

Reimplemented by: DDMat_CPU::CreateFromGPU

function accumulate_rows

virtual void accumulate_rows(
    const DDMat & V0
) =0

Accumulate the coefficient of each row into a DDMat with a only one column.

Reimplemented by: DDMat_CPU::accumulate_rows

function CompactVECDDMat2DDMat

virtual void CompactVECDDMat2DDMat(
    VEC_CPU< DDMat * > & vecddmat
) =0

Reimplemented by: DDMat_CPU::CompactVECDDMat2DDMat

Protected Functions Documentation

function copy_DDMat

void copy_DDMat(
    DDMat const & other
)

Copy protected members.

Public Attributes Documentation

variable nrows

iReg nrows;

number of rows.

variable ncols

iReg ncols;

number of columns.

variable coef

VEC< rExt > * coef = nullptr;

Coefficients of the dense matrix.


Updated on 19 November 2024 at 10:20:48 CET