monolish
0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
|
Go to the documentation of this file.
12 template <
typename Float>
class vector;
13 template <
typename TYPE,
typename Float>
class view1D;
21 template <
typename Float>
class Dense {
47 std::vector<Float>
val;
104 Dense(
const size_t M,
const size_t N);
116 Dense(
const size_t M,
const size_t N,
const Float *value);
128 Dense(
const size_t M,
const size_t N,
const std::vector<Float> &value);
152 Dense(
const size_t M,
const size_t N,
153 const std::initializer_list<Float> &list);
166 Dense(
const size_t M,
const size_t N,
const Float
min,
const Float
max);
178 Dense(
const size_t M,
const size_t N,
const Float value);
190 void set_ptr(
const size_t M,
const size_t N,
const std::vector<Float> &value);
253 std::string
type()
const {
return "Dense"; }
296 Float
at(
const size_t i,
const size_t j)
const;
308 Float
at(
const size_t i,
const size_t j) {
309 return static_cast<const Dense *
>(
this)->
at(i, j);
323 void insert(
const size_t i,
const size_t j,
const Float Val);
333 void print_all(
bool force_cpu =
false)
const;
441 void fill(Float value);
467 bool compare_cpu_and_device =
false)
const;
void min(const matrix::CRS< double > &A, const matrix::CRS< double > &B, matrix::CRS< double > &C)
Create a new CRS matrix with smallest elements of two matrices (C[0:nnz] = min(A[0:nnz],...
void diag_div(const Float alpha)
Scalar and diag. vector of dense matrix div.
~Dense()
destructor of CRS matrix, free GPU memory
bool get_device_mem_stat() const
true: sended, false: not send
void max(const matrix::CRS< double > &A, const matrix::CRS< double > &B, matrix::CRS< double > &C)
Create a new CRS matrix with greatest elements of two matrices (C[0:nnz] = max(A[0:nnz],...
void set_ptr(const size_t M, const size_t N, const std::vector< Float > &value)
Set Dense array from std::vector.
size_t get_row() const
get # of row
std::vector< Float > val
Dense format value(size M x N)
Dense & transpose()
get transposed matrix (A^T)
double get_data_size() const
Memory data space required by the matrix.
void nonfree_recv()
recv. data to GPU (w/o free)
void set_col(const size_t M)
Set column number.
void convert(const COO< Float > &coo)
Create Dense matrix from COO matrix.
void col(const size_t c, vector< Float > &vec) const
get column vector
void diag_add(const Float alpha)
Scalar and diag. vector of dense matrix add.
void insert(const size_t i, const size_t j, const Float Val)
get element A[i][j]
bool operator==(const Dense< Float > &mat) const
Comparing matricies (A == mat)
void diag_sub(const Float alpha)
Scalar and diag. vector of dense matrix sub.
size_t nnz
# of non-zero element (M * N)
bool gpu_status
true: sended, false: not send
void recv()
recv. data to GPU, and free data on GPU
void diag_mul(const Float alpha)
Scalar and diag. vector of dense matrix mul.
bool equal(const Dense< Float > &mat, bool compare_cpu_and_device=false) const
Comparing matricies (A == mat)
void set_nnz(const size_t NZ)
Set # of non-zero elements.
std::string type() const
get format name "Dense"
Coodinate (COO) format Matrix (need to sort)
void device_free() const
free data on GPU
void fill(Float value)
fill matrix elements with a scalar value
size_t get_col() const
get # of col
void operator=(const Dense< Float > &mat)
matrix copy
size_t get_nnz() const
get # of non-zeros
Float at(const size_t i, const size_t j)
get element A[i][j] (only CPU)
Float at(const size_t i, const size_t j) const
get element A[i][j]
Dense(const COO< Float > &coo)
Create dense matrix from COO matrix.
void print_all(bool force_cpu=false) const
print all elements to standard I/O
void row(const size_t r, vector< Float > &vec) const
get row vector
void send() const
send data to GPU
void set_row(const size_t N)
Set row number.
void diag(vector< Float > &vec) const
get diag. vector
bool operator!=(const Dense< Float > &mat) const
Comparing matricies (A != mat)