1# ifndef _RHEO_NEW_ASR_H
2# define _RHEO_NEW_ASR_H
23#include "rheolef/disarray.h"
24#include "rheolef/pair_set.h"
25#include "rheolef/diststream.h"
31template<
class T,
class M>
class csr;
32template<
class T,
class M>
class csr_rep;
48template<
class T,
class M = rheo_default_memory_model,
class A = std::allocator<T> >
91 const communicator&
comm()
const {
return base::comm(); }
134template <
class T,
class M,
class A>
138 _col_ownership(a.col_ownership()),
140 _dis_nnz(a.dis_nnz())
144template <
class T,
class M,
class A>
148 _col_ownership(a.col_ownership()),
150 _dis_nnz(a.dis_nnz())
154template <
class T,
class M,
class A>
161template <
class T,
class M,
class A>
168template <
class T,
class M,
class A>
173 typename row_type::const_iterator pos_aij = base::operator[](i).find(dis_j);
174 if (pos_aij != base::operator[](i).end()) {
175 return (*pos_aij).second;
180template <
class T,
class M,
class A>
185 row_type& row_i = base::operator[](i);
186 std::pair<typename row_type::iterator,bool> status
187 = row_i.insert (std::pair<size_type,T>(dis_j,
T(0)));
188 return (*(status.first)).second;
190template <
class T,
class M,
class A>
196 "indexes ("<<dis_i<<
" "<<dis_j<<
") out of range [0:"
197 << dis_nrow() <<
"[x[0:" << dis_ncol() <<
"[");
field::size_type size_type
size_type dis_nnz() const
void dis_entry_assembly_end()
T & semi_dis_entry(size_type i, size_type dis_j)
disarray< row_type, M, A > base
void dis_entry_assembly()
odiststream & put_seq_sparse_matlab(odiststream &ops, size_type first_dis_i=0) const
void dis_entry_assembly_begin()
idiststream & get(idiststream &ips)
pair_set< T, A > row_type
const distributor & col_ownership() const
size_type dis_ncol() const
odiststream & put_mpi(odiststream &ops) const
odiststream & put(odiststream &ops) const
base::size_type size_type
void build_from_csr(const csr_rep< T, M > &)
dis_reference dis_entry(size_type dis_i, size_type dis_j)
const distributor & row_ownership() const
odiststream & put_seq(odiststream &ops, size_type first_dis_i=0) const
T operator()(size_type i, size_type dis_j) const
distributor _col_ownership
asr(const distributor &row_ownership, const distributor &col_ownership, const A &alloc=A())
void resize(const distributor &row_ownership, const distributor &col_ownership)
odiststream & put_seq_matrix_market(odiststream &ops, size_type first_dis_i=0) const
size_type dis_nrow() const
const communicator & comm() const
see the csr page for the full documentation
see the disarray page for the full documentation
rep::base::size_type size_type
see the distributor page for the full documentation
size_type dis_size() const
global and local sizes
size_type size(size_type iproc) const
idiststream: see the diststream page for the full documentation
odiststream: see the diststream page for the full documentation
#define assert_macro(ok_condition, message)
This file is part of Rheolef.
std::ostream & operator<<(std::ostream &os, const catchmark &m)
std::istream & operator>>(std::istream &is, const catchmark &m)
base::dis_reference _row_dis_i
dis_reference(typename base::dis_reference row_dis_i, size_type dis_j)
dis_reference & operator+=(const T &value)