1 #ifndef PARALUTION_HOST_MATRIX_COO_HPP_
2 #define PARALUTION_HOST_MATRIX_COO_HPP_
4 #include "../base_vector.hpp"
5 #include "../base_matrix.hpp"
6 #include "../matrix_formats.hpp"
10 template <
typename ValueType>
11 class HostMatrixCOO :
public HostMatrix<ValueType> {
16 HostMatrixCOO(
const Paralution_Backend_Descriptor local_backend);
19 virtual void info(
void)
const;
22 virtual void Clear(
void);
23 virtual void AllocateCOO(
const int nnz,
const int nrow,
const int ncol);
25 virtual void SetDataPtrCOO(
int **row,
int **col, ValueType **val,
26 const int nnz,
const int nrow,
const int ncol);
29 virtual bool Scale(
const ValueType alpha);
32 virtual bool AddScalar(
const ValueType alpha);
41 virtual void CopyFromCOO(
const int *row,
const int *col,
const ValueType *val);
42 virtual void CopyToCOO(
int *row,
int *col, ValueType *val)
const;
75 #endif // PARALUTION_HOST_MATRIX_COO_HPP_
virtual void SetDataPtrCOO(int **row, int **col, ValueType **val, const int nnz, const int nrow, const int ncol)
Initialize a COO matrix on the Host with externally allocated data.
Definition: host_matrix_coo.cpp:116
virtual bool AddScalar(const ValueType alpha)
Add alpha to all values.
Definition: host_matrix_coo.cpp:608
Definition: base_matrix.hpp:24
virtual bool Permute(const BaseVector< int > &permutation)
Perform (forward) permutation of the matrix.
Definition: host_matrix_coo.cpp:496
Definition: base_matrix.hpp:80
Definition: base_matrix.hpp:14
virtual bool Scale(const ValueType alpha)
Scale all values.
Definition: host_matrix_coo.cpp:567
virtual bool ConvertFrom(const BaseMatrix< ValueType > &mat)
Convert the matrix from another matrix (with different structure)
Definition: host_matrix_coo.cpp:263
virtual void Clear(void)
Clear (free) the matrix.
Definition: host_matrix_coo.cpp:73
virtual bool ScaleDiagonal(const ValueType alpha)
Scale the diagonal entries of the matrix with alpha.
Definition: host_matrix_coo.cpp:580
nnz
Definition: pcg_example.m:8
virtual bool AddScalarOffDiagonal(const ValueType alpha)
Add alpha to the off-diagonal entries of the matrix.
Definition: host_matrix_coo.cpp:635
virtual void CopyFrom(const BaseMatrix< ValueType > &mat)
Copy from another matrix.
Definition: host_matrix_coo.cpp:213
const IndexType const IndexType const IndexType const ValueType const ValueType scalar
Definition: cuda_kernels_coo.hpp:91
virtual void ApplyAdd(const BaseVector< ValueType > &in, const ValueType scalar, BaseVector< ValueType > *out) const
Apply and add the matrix to vector, out = out + scalar*this*in;.
Definition: host_matrix_coo.cpp:473
virtual void CopyFromCOO(const int *row, const int *col, const ValueType *val)
Copy from COO array (the matrix has to be allocated)
Definition: host_matrix_coo.cpp:161
Definition: base_vector.hpp:10
virtual void CopyTo(BaseMatrix< ValueType > *mat) const
Copy to another matrix.
Definition: host_matrix_coo.cpp:256
MatrixCOO< ValueType, int > mat_
Definition: host_matrix_coo.hpp:56
Definition: base_matrix.hpp:61
virtual bool PermuteBackward(const BaseVector< int > &permutation)
Perform (backward) permutation of the matrix.
Definition: host_matrix_coo.cpp:526
virtual unsigned int get_mat_format(void) const
Return the matrix format id (see matrix_formats.hpp)
Definition: host_matrix_coo.hpp:20
virtual bool WriteFileMTX(const std::string) const
Write matrix to MTX (Matrix Market Format) file.
Definition: host_matrix_coo.cpp:324
virtual bool ReadFileMTX(const std::string)
Read matrix from MTX (Matrix Market Format) file.
Definition: host_matrix_coo.cpp:297
Definition: base_matrix.hpp:42
Definition: base_matrix.hpp:20
Definition: base_matrix.hpp:22
virtual void Apply(const BaseVector< ValueType > &in, BaseVector< ValueType > *out) const
Apply the matrix to vector, out = this*in;.
Definition: host_matrix_coo.cpp:446
virtual void LeaveDataPtrCOO(int **row, int **col, ValueType **val)
Leave a COO matrix to Host pointers.
Definition: host_matrix_coo.cpp:139
Base class for all host/accelerator matrices.
Definition: base_matrix.hpp:92
virtual void AllocateCOO(const int nnz, const int nrow, const int ncol)
Allocate COO Matrix.
Definition: host_matrix_coo.cpp:89
virtual void info(void) const
Shows simple info about the object.
Definition: host_matrix_coo.cpp:65
Definition: backend_manager.cpp:43
virtual void CopyToCOO(int *row, int *col, ValueType *val) const
Copy to COO array (the arrays have to be allocated)
Definition: host_matrix_coo.cpp:187
virtual ~HostMatrixCOO()
Definition: host_matrix_coo.cpp:56
HostMatrixCOO()
Definition: host_matrix_coo.cpp:34
Definition: matrix_formats.hpp:24
virtual bool AddScalarDiagonal(const ValueType alpha)
Add alpha to the diagonal entries of the matrix.
Definition: host_matrix_coo.cpp:621
virtual bool ScaleOffDiagonal(const ValueType alpha)
Scale the off-diagonal entries of the matrix with alpha.
Definition: host_matrix_coo.cpp:594
Definition: base_matrix.hpp:18