csr.h
Go to the documentation of this file.
# ifndef _RHEOLEF_CSR_H
# define _RHEOLEF_CSR_H
//
// This file is part of Rheolef.
//
// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
//
// Rheolef is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Rheolef is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rheolef; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// =========================================================================
// AUTHORS: Pierre.Saramito@imag.fr
// DATE: 10 february 1999
namespace rheolef {
} // namespace rheolef
#include "rheolef/vec.h"
#include "rheolef/asr.h"
#include "rheolef/vector_of_iterator.h"
#include "rheolef/scatter_message.h"
#include "rheolef/pair_util.h"
namespace rheolef {
// -------------------------------------------------------------
// the sequential representation
// -------------------------------------------------------------
template<class T, class M> class csr_rep {};
template<class T>
class csr_rep<T,sequential> : public vector_of_iterator<std::pair<typename std::vector<T>::size_type,T> > {
public:
typedef typename std::vector<T>::size_type size_type;
typedef T element_type;
typedef sequential memory_type;
typedef typename std::pair<size_type,T> pair_type;
typedef typename vector_of_iterator<pair_type>::iterator iterator;
typedef typename vector_of_iterator<pair_type>::const_iterator const_iterator;
typedef typename vector_of_iterator<pair_type>::difference_type difference_type;
typedef typename vector_of_iterator<pair_type>::value_type data_iterator;
typedef typename vector_of_iterator<pair_type>::const_value_type const_data_iterator;
csr_rep (size_type loc_nrow1 = 0, size_type loc_ncol1 = 0, size_type loc_nnz1 = 0);
void resize (size_type loc_nrow1 = 0, size_type loc_ncol1 = 0, size_type loc_nnz1 = 0);
csr_rep (const distributor& row_ownership, const distributor& col_ownership, size_type nnz1 = 0);
void resize (const distributor& row_ownership, const distributor& col_ownership, size_type nnz1 = 0);
csr_rep (const csr_rep<T,sequential>& a);
template<class A> void build_from_asr (const asr<T,sequential,A>& a);
template<class A> explicit csr_rep (const asr<T,sequential,A>& a);
template<class A> void build_from_diag (const disarray_rep<T,sequential,A>& d);
const distributor& row_ownership() const { return _row_ownership; }
const distributor& col_ownership() const { return _col_ownership; }
const_iterator begin() const { return vector_of_iterator<pair_type>::begin(); }
const_iterator end() const { return vector_of_iterator<pair_type>::end(); }
iterator begin() { return vector_of_iterator<pair_type>::begin(); }
iterator end() { return vector_of_iterator<pair_type>::end(); }
size_type nrow() const { return vector_of_iterator<pair_type>::size()-1; }
size_type ncol() const { return _col_ownership.size(); }
size_type nnz() const { return _data.size(); }
size_type dis_nrow() const { return nrow(); }
size_type dis_ncol() const { return ncol(); }
size_type dis_nnz() const { return nnz(); }
T max_abs () const;
bool is_symmetric() const { return _is_symmetric; }
void set_symmetry (bool is_symm) const { _is_symmetric = is_symm; }
void set_symmetry_by_check (const T& tol = std::numeric_limits<T>::epsilon()) const;
bool is_definite_positive() const { return _is_definite_positive; }
void set_definite_positive (bool is_defpos) const { _is_definite_positive = is_defpos; }
size_type pattern_dimension() const { return _pattern_dimension; }
void set_pattern_dimension(size_type dim) const { _pattern_dimension = dim; }
size_type row_first_index () const { return 0; }
size_type row_last_index () const { return nrow(); }
size_type col_first_index () const { return 0; }
size_type col_last_index () const { return ncol(); }
idiststream& get (idiststream&);
odiststream& put (odiststream&, size_type istart = 0) const;
odiststream& put_matrix_market (odiststream&, size_type istart = 0) const;
odiststream& put_sparse_matlab (odiststream&, size_type istart = 0) const;
void dump (const std::string& name, size_type istart = 0) const;
void mult (const vec<T,sequential>& x, vec<T,sequential>& y) const;
void trans_mult (const vec<T,sequential>& x, vec<T,sequential>& y) const;
csr_rep<T,sequential>& operator*= (const T& lambda);
template <class BinaryOp>
void assign_add (const csr_rep<T,sequential>& a, const csr_rep<T,sequential>& b, BinaryOp binop);
void build_transpose (csr_rep<T,sequential>& b) const;
void assign_mult (const csr_rep<T,sequential>& a, const csr_rep<T,sequential>& b);
// accessors, only for distributed (for interface compatibility)
size_type ext_nnz() const { return 0; }
size_type dis_ext_nnz() const { return 0; }
const_iterator ext_begin() const { return const_iterator(); }
const_iterator ext_end() const { return const_iterator(); }
size_type jext2dis_j (size_type jext) const { return 0; }
//protected:
distributor _row_ownership;
distributor _col_ownership;
std::vector<std::pair<typename std::vector<T>::size_type,T> > _data;
mutable bool _is_symmetric;
mutable bool _is_definite_positive;
mutable size_type _pattern_dimension; // e.g. FEM 3d-pattern
};
template<class T>
template<class A>
inline
csr_rep<T,sequential>::csr_rep(const asr<T,sequential,A>& a)
: vector_of_iterator<pair_type>(a.nrow()+1),
_row_ownership (a.row_ownership()),
_col_ownership (a.col_ownership()),
_data(a.nnz()),
_is_symmetric(false),
_is_definite_positive(false),
_pattern_dimension(0)
{
build_from_asr (a);
}
template<class T>
inline
idiststream&
csr_rep<T,sequential>::get (idiststream& ids)
{
typedef std::allocator<T> A; // TODO: use heap_allocator for asr
asr<T,sequential,A> a;
a.get(ids);
build_from_asr (a);
return ids;
}
// -------------------------------------------------------------
// the distributed representation
// -------------------------------------------------------------
#ifdef _RHEOLEF_HAVE_MPI
template<class T>
class csr_rep<T,distributed> : public csr_rep<T,sequential> {
public:
typedef csr_rep<T,sequential> base;
typedef distributed memory_type;
typedef typename base::size_type size_type;
typedef typename base::element_type element_type;
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
typedef typename base::data_iterator data_iterator;
typedef typename base::const_data_iterator const_data_iterator;
csr_rep ();
csr_rep (const csr_rep<T,distributed>& a);
template<class A> explicit csr_rep (const asr<T,distributed,A>& a);
template<class A> void build_from_asr (const asr<T,distributed,A>& a);
void resize (const distributor& row_ownership, const distributor& col_ownership, size_type nnz1 = 0);
template<class A> void build_from_diag (const disarray_rep<T,distributed,A>& d);
const distributor& row_ownership() const { return base::_row_ownership; }
const distributor& col_ownership() const { return base::_col_ownership; }
const communicator& comm() const { return row_ownership().comm(); }
const_iterator begin() const { return base::begin(); }
const_iterator end() const { return base::end(); }
iterator begin() { return base::begin(); }
iterator end() { return base::end(); }
size_type ext_nnz() const { return _ext.nnz(); }
const_iterator ext_begin() const { return _ext.begin(); }
const_iterator ext_end() const { return _ext.end(); }
iterator ext_begin() { return _ext.begin(); }
iterator ext_end() { return _ext.end(); }
size_type nrow() const { return base::nrow(); }
size_type ncol() const { return base::ncol(); }
size_type nnz() const { return base::nnz(); }
size_type dis_nrow() const { return row_ownership().dis_size(); }
size_type dis_ncol() const { return col_ownership().dis_size(); }
size_type dis_nnz() const { return _dis_nnz; }
size_type dis_ext_nnz() const { return _dis_ext_nnz; }
T max_abs () const;
bool is_symmetric() const { return base::is_symmetric(); }
void set_symmetry (bool is_symm) const { base::set_symmetry(is_symm); }
void set_symmetry_by_check (const T& tol = std::numeric_limits<T>::epsilon()) const;
bool is_definite_positive() const { return base::is_definite_positive(); }
void set_definite_positive (bool is_defpos) const { base::set_definite_positive(is_defpos); }
size_type pattern_dimension() const { return base::pattern_dimension(); }
void set_pattern_dimension(size_type dim) const { base::set_pattern_dimension(dim); }
size_type row_first_index () const { return row_ownership().first_index(); }
size_type row_last_index () const { return row_ownership().last_index(); }
size_type col_first_index () const { return col_ownership().first_index(); }
size_type col_last_index () const { return col_ownership().last_index(); }
size_type jext2dis_j (size_type jext) const;
idiststream& get (idiststream&);
odiststream& put (odiststream&) const;
void dump (const std::string& name) const;
void mult (const vec<T,distributed>& x, vec<T,distributed>& y) const;
void trans_mult (const vec<T,distributed>& x, vec<T,distributed>& y) const;
csr_rep<T,distributed>& operator*= (const T& lambda);
template <class BinaryOp>
void assign_add (const csr_rep<T,distributed>& a, const csr_rep<T,distributed>& b, BinaryOp binop);
void build_transpose (csr_rep<T,distributed>& b) const;
void assign_mult (const csr_rep<T,distributed>& a, const csr_rep<T,distributed>& b);
protected:
// data:
// diagonal part is the basic csr_rep<seq> type
// extra-diagonal blocs are sequential csr also:
csr_rep<T,sequential> _ext;
std::vector<size_type> _jext2dis_j;
size_type _dis_nnz;
size_type _dis_ext_nnz;
// A*x internal stuff: scatter and buffer (lazy initialization):
mutable bool _scatter_initialized;
mutable scatter_message<std::vector<T> > _from;
mutable scatter_message<std::vector<T> > _to;
mutable std::vector<T> _buffer;
// internal:
void _scatter_init() const;
void _scatter_init_guard() const {
if (_scatter_initialized) return;
_scatter_initialized = true;
_scatter_init();
}
};
template<class T>
inline
typename csr_rep<T,distributed>::size_type
csr_rep<T,distributed>::jext2dis_j (size_type jext) const
{
check_macro (jext < _jext2dis_j.size(), "jext2dis_j: jext="<<jext<<" is out of range [0:"<<_jext2dis_j.size()<<"[");
return _jext2dis_j [jext];
}
template<class T>
template<class A>
inline
csr_rep<T,distributed>::csr_rep(const asr<T,distributed,A>& a)
: csr_rep<T,sequential>(),
_ext (),
_jext2dis_j(),
_dis_nnz(0),
_dis_ext_nnz(0),
_scatter_initialized(false),
_from(),
_to(),
_buffer()
{
build_from_asr (a);
}
template<class T>
inline
idiststream&
csr_rep<T,distributed>::get (idiststream& ips)
{
typedef std::allocator<T> A; // TODO: use heap_alloc for asr
asr<T,distributed,A> a;
a.get (ips);
build_from_asr (a);
return ips;
}
#endif // _RHEOLEF_HAVE_MPI
namespace details {
// these classes are used for allocator from the std::initializer_list
template <class T, class M> class csr_concat_value;
template <class T, class M> class csr_concat_line;
} // namespace details
// -------------------------------------------------------------
// the basic class with a smart pointer to representation
// the user-level class with memory-model parameter
// -------------------------------------------------------------
template <class T, class M = rheo_default_memory_model>
class csr {
public:
typedef M memory_type;
};
// [verbatim_csr]
template<class T>
class csr<T,sequential> : public smart_pointer<csr_rep<T,sequential> > {
public:
// typedefs:
typedef csr_rep<T,sequential> rep;
typedef smart_pointer<rep> base;
typedef typename rep::memory_type memory_type;
typedef typename rep::size_type size_type;
typedef typename rep::element_type element_type;
typedef typename rep::iterator iterator;
typedef typename rep::const_iterator const_iterator;
typedef typename rep::data_iterator data_iterator;
typedef typename rep::const_data_iterator const_data_iterator;
// allocators/deallocators:
csr() : base(new_macro(rep())) {}
template<class A>
explicit csr(const asr<T,sequential,A>& a) : base(new_macro(rep(a))) {}
void resize (size_type loc_nrow1 = 0, size_type loc_ncol1 = 0, size_type loc_nnz1 = 0)
{ base::data().resize(loc_nrow1, loc_ncol1, loc_nnz1); }
void resize (const distributor& row_ownership, const distributor& col_ownership, size_type nnz1 = 0)
{ base::data().resize(row_ownership, col_ownership, nnz1); }
// allocators from initializer list
csr (const std::initializer_list<details::csr_concat_value<T,sequential> >& init_list);
csr (const std::initializer_list<details::csr_concat_line<T,sequential> >& init_list);
// accessors:
// global sizes
const distributor& row_ownership() const { return base::data().row_ownership(); }
const distributor& col_ownership() const { return base::data().col_ownership(); }
size_type dis_nrow () const { return row_ownership().dis_size(); }
size_type dis_ncol () const { return col_ownership().dis_size(); }
size_type dis_nnz () const { return base::data().nnz(); }
size_type dis_ext_nnz () const { return 0; }
bool is_symmetric() const { return base::data().is_symmetric(); }
void set_symmetry (bool is_symm) const { base::data().set_symmetry(is_symm); }
void set_symmetry_by_check (const T& tol = std::numeric_limits<T>::epsilon()) const
{ base::data().set_symmetry_by_check(); }
bool is_definite_positive() const { return base::data().is_definite_positive(); }
void set_definite_positive (bool is_defpos) const { base::data().set_definite_positive(is_defpos); }
size_type pattern_dimension() const { return base::data().pattern_dimension(); }
void set_pattern_dimension(size_type dim) const { base::data().set_pattern_dimension(dim); }
T max_abs () const { return base::data().max_abs(); }
// local sizes
size_type nrow () const { return base::data().nrow(); }
size_type ncol () const { return base::data().ncol(); }
size_type nnz () const { return base::data().nnz(); }
// range on local memory
size_type row_first_index () const { return base::data().row_first_index(); }
size_type row_last_index () const { return base::data().row_last_index(); }
size_type col_first_index () const { return base::data().col_first_index(); }
size_type col_last_index () const { return base::data().col_last_index(); }
const_iterator begin() const { return base::data().begin(); }
const_iterator end() const { return base::data().end(); }
iterator begin_nonconst() { return base::data().begin(); }
iterator end_nonconst() { return base::data().end(); }
// accessors, only for distributed (for interface compatibility)
size_type ext_nnz() const { return 0; }
const_iterator ext_begin() const { return const_iterator(); }
const_iterator ext_end() const { return const_iterator(); }
iterator ext_begin_nonconst() { return iterator(); }
iterator ext_end_nonconst() { return iterator(); }
size_type jext2dis_j (size_type jext) const { return 0; }
int constraint_process_rank() const;
// algebra:
// y := a*x
void mult (const vec<element_type,sequential>& x, vec<element_type,sequential>& y) const {
base::data().mult (x,y);
}
vec<element_type,sequential> operator* (const vec<element_type,sequential>& x) const {
vec<element_type,sequential> y (row_ownership(), element_type());
mult (x, y);
return y;
}
void trans_mult (const vec<element_type,sequential>& x, vec<element_type,sequential>& y) const {
base::data().trans_mult (x,y);
}
vec<element_type,sequential> trans_mult (const vec<element_type,sequential>& x) const {
vec<element_type,sequential> y (col_ownership(), element_type());
trans_mult (x, y);
return y;
}
// a+b, a-b, a*b
csr<T,sequential> operator+ (const csr<T,sequential>& b) const;
csr<T,sequential> operator- (const csr<T,sequential>& b) const;
csr<T,sequential> operator* (const csr<T,sequential>& b) const;
// lambda*a
csr<T,sequential>& operator*= (const T& lambda) {
base::data().operator*= (lambda);
return *this;
}
// output:
void dump (const std::string& name) const { base::data().dump(name); }
};
// [verbatim_csr]
// lambda*a
template<class T>
inline
csr<T,sequential>
operator* (const T& lambda, const csr<T,sequential>& a)
{
csr<T,sequential> b = a;
b.operator*= (lambda);
return b;
}
// -a
template<class T>
inline
csr<T,sequential>
operator- (const csr<T,sequential>& a)
{
return T(-1)*a;
}
template<class T>
inline
csr<T,sequential>
trans (const csr<T,sequential>& a)
{
csr<T,sequential> b;
a.data().build_transpose (b.data());
return b;
}
//>verbatim:
#ifdef _RHEOLEF_HAVE_MPI
//<verbatim:
template<class T>
class csr<T,distributed> : public smart_pointer<csr_rep<T,distributed> > {
public:
// typedefs:
typedef csr_rep<T,distributed> rep;
typedef smart_pointer<rep> base;
typedef typename rep::memory_type memory_type;
typedef typename rep::size_type size_type;
typedef typename rep::element_type element_type;
typedef typename rep::iterator iterator;
typedef typename rep::const_iterator const_iterator;
typedef typename rep::data_iterator data_iterator;
typedef typename rep::const_data_iterator const_data_iterator;
// allocators/deallocators:
csr() : base(new_macro(rep())) {}
template<class A>
explicit csr(const asr<T,memory_type,A>& a) : base(new_macro(rep(a))) {}
void resize (const distributor& row_ownership, const distributor& col_ownership, size_type nnz1 = 0)
{ base::data().resize(row_ownership, col_ownership, nnz1); }
// allocators from initializer list (c++ 2011):
csr (const std::initializer_list<details::csr_concat_value<T,distributed> >& init_list);
csr (const std::initializer_list<details::csr_concat_line<T,distributed> >& init_list);
// accessors:
// global sizes
const distributor& row_ownership() const { return base::data().row_ownership(); }
const distributor& col_ownership() const { return base::data().col_ownership(); }
size_type dis_nrow () const { return row_ownership().dis_size(); }
size_type dis_ncol () const { return col_ownership().dis_size(); }
size_type dis_nnz () const { return base::data().dis_nnz(); }
size_type dis_ext_nnz () const { return base::data().dis_ext_nnz(); }
bool is_symmetric() const { return base::data().is_symmetric(); }
void set_symmetry (bool is_symm) const { base::data().set_symmetry(is_symm); }
void set_symmetry_by_check (const T& tol = std::numeric_limits<T>::epsilon()) const
{ base::data().set_symmetry_by_check(); }
bool is_definite_positive() const { return base::data().is_definite_positive(); }
void set_definite_positive (bool is_defpos) const { base::data().set_definite_positive(is_defpos); }
size_type pattern_dimension() const { return base::data().pattern_dimension(); }
void set_pattern_dimension(size_type dim) const { base::data().set_pattern_dimension(dim); }
T max_abs () const { return base::data().max_abs(); }
// local sizes
size_type nrow () const { return base::data().nrow(); }
size_type ncol () const { return base::data().ncol(); }
size_type nnz () const { return base::data().nnz(); }
// range on local memory
size_type row_first_index () const { return base::data().row_first_index(); }
size_type row_last_index () const { return base::data().row_last_index(); }
size_type col_first_index () const { return base::data().col_first_index(); }
size_type col_last_index () const { return base::data().col_last_index(); }
const_iterator begin() const { return base::data().begin(); }
const_iterator end() const { return base::data().end(); }
iterator begin_nonconst() { return base::data().begin(); }
iterator end_nonconst() { return base::data().end(); }
// accessors, only for distributed
size_type ext_nnz() const { return base::data().ext_nnz(); }
const_iterator ext_begin() const { return base::data().ext_begin(); }
const_iterator ext_end() const { return base::data().ext_end(); }
iterator ext_begin_nonconst() { return base::data().ext_begin(); }
iterator ext_end_nonconst() { return base::data().ext_end(); }
size_type jext2dis_j (size_type jext) const { return base::data().jext2dis_j(jext); }
int constraint_process_rank() const;
// algebra:
// y := a*x
void mult (const vec<element_type,distributed>& x, vec<element_type,distributed>& y) const {
base::data().mult (x,y);
}
vec<element_type,distributed> operator* (const vec<element_type,distributed>& x) const {
vec<element_type,distributed> y (row_ownership(), element_type());
mult (x, y);
return y;
}
void trans_mult (const vec<element_type,distributed>& x, vec<element_type,distributed>& y) const {
base::data().trans_mult (x,y);
}
vec<element_type,distributed> trans_mult (const vec<element_type,distributed>& x) const {
vec<element_type,distributed> y (col_ownership(), element_type());
trans_mult (x, y);
return y;
}
// a+b, a-b, a*b
csr<T,distributed> operator+ (const csr<T,distributed>& b) const;
csr<T,distributed> operator- (const csr<T,distributed>& b) const;
csr<T,distributed> operator* (const csr<T,distributed>& b) const;
// lambda*a
csr<T,distributed>& operator*= (const T& lambda) {
base::data().operator*= (lambda);
return *this;
}
// output:
void dump (const std::string& name) const { base::data().dump(name); }
};
// lambda*a
template<class T>
inline
csr<T,distributed>
operator* (const T& lambda, const csr<T,distributed>& a)
{
csr<T,distributed> b = a;
b.operator*= (lambda);
return b;
}
// -a
template<class T>
inline
csr<T,distributed>
operator- (const csr<T,distributed>& a)
{
return T(-1)*a;
}
// trans(a)
template<class T>
inline
csr<T,distributed>
trans (const csr<T,distributed>& a)
{
csr<T,distributed> b;
a.data().build_transpose (b.data());
return b;
}
#endif // _RHEOLEF_HAVE_MPI
// b = f(a); f as a class-function or usual fct
template<class T, class M, class Function>
csr<T,M>
csr_apply (Function f, const csr<T,M>& a)
{
csr<T,M> b = a;
typename csr<T,M>::size_type n = a.nrow();
typename csr<T,M>::const_iterator dia_ia = a.begin();
typename csr<T,M>::iterator dia_ib = b.begin_nonconst();
pair_transform_second (dia_ia[0], dia_ia[n], dia_ib[0], f);
if (a.ext_nnz() != 0) {
typename csr<T,M>::const_iterator ext_ia = a.ext_begin();
typename csr<T,M>::iterator ext_ib = b.ext_begin_nonconst();
pair_transform_second (ext_ia[0], ext_ia[n], ext_ib[0], f);
}
return b;
}
template<class T, class M, class Function>
csr<T,M>
csr_apply (T (*f)(const T&), const csr<T,M>& a)
{
return csr_apply (std::ptr_fun(f), a);
}
//>verbatim:
template<class T, class M>
csr<T,M>
diag (const vec<T,M>&);
// ------------------------------
// i/o
// ------------------------------
template <class T, class M>
inline
idiststream&
operator >> (idiststream& s, csr<T,M>& x)
{
return x.data().get(s);
}
template <class T, class M>
inline
odiststream&
operator << (odiststream& s, const csr<T,M>& x)
{
return x.data().put(s);
}
// ------------------------------
// a+b, a-b
// ------------------------------
template <class T>
inline
csr<T,sequential>
csr<T,sequential>::operator+ (const csr<T,sequential>& b) const {
csr<T,sequential> c;
c.data().assign_add (this->data(), b.data(), std::plus<T>());
return c;
}
template <class T>
inline
csr<T,sequential>
csr<T,sequential>::operator- (const csr<T,sequential>& b) const {
csr<T,sequential> c;
c.data().assign_add (this->data(), b.data(), std::minus<T>());
return c;
}
#ifdef _RHEOLEF_HAVE_MPI
template <class T>
inline
csr<T,distributed>
csr<T,distributed>::operator+ (const csr<T,distributed>& b) const {
csr<T,distributed> c;
c.data().assign_add (this->data(), b.data(), std::plus<T>());
return c;
}
template <class T>
inline
csr<T,distributed>
csr<T,distributed>::operator- (const csr<T,distributed>& b) const {
csr<T,distributed> c;
c.data().assign_add (this->data(), b.data(), std::minus<T>());
return c;
}
#endif // _RHEOLEF_HAVE_MPI
// ------------------------------
// a*b
// ------------------------------
template <class T>
inline
csr<T,sequential>
csr<T,sequential>::operator* (const csr<T,sequential>& b) const {
csr<T,sequential> c;
c.data().assign_mult (this->data(), b.data());
return c;
}
#ifdef _RHEOLEF_HAVE_MPI
template <class T>
inline
csr<T,distributed>
csr<T,distributed>::operator* (const csr<T,distributed>& b) const {
csr<T,distributed> c;
c.data().assign_mult (this->data(), b.data());
return c;
}
#endif // _RHEOLEF_HAVE_MPI
// ------------------------------
// a.max_abs
// ------------------------------
template <class T>
inline
T
csr_rep<T,sequential>::max_abs () const
{
T val = 0;
typename csr<T,sequential>::const_iterator ia = begin();
for (typename csr_rep<T,sequential>::const_data_iterator iter = ia[0], last = ia[nrow()]; iter != last; ++iter) {
val = std::max (val, abs((*iter).second));
}
return val;
}
#ifdef _RHEOLEF_HAVE_MPI
template <class T>
inline
T
csr_rep<T,distributed>::max_abs () const
{
T val = csr_rep<T,sequential>::max_abs();
val = mpi::all_reduce (comm(), val, mpi::maximum<T>());
return val;
}
#endif // _RHEOLEF_HAVE_MPI
} // namespace rheolef
# endif // _RHEOLEF_CSR_H
size_type
field::size_type size_type
Definition: branch.cc:425
rheolef::asr
Definition: asr.h:49
rheolef::csr< T, distributed >
Definition: csr.h:466
rheolef::csr< T, distributed >::dis_nnz
size_type dis_nnz() const
Definition: csr.h:501
rheolef::csr< T, distributed >::const_data_iterator
rep::const_data_iterator const_data_iterator
Definition: csr.h:479
rheolef::csr< T, distributed >::element_type
rep::element_type element_type
Definition: csr.h:475
rheolef::csr< T, distributed >::jext2dis_j
size_type jext2dis_j(size_type jext) const
Definition: csr.h:535
rheolef::csr< T, distributed >::resize
void resize(const distributor &row_ownership, const distributor &col_ownership, size_type nnz1=0)
Definition: csr.h:486
rheolef::csr< T, distributed >::const_iterator
rep::const_iterator const_iterator
Definition: csr.h:477
rheolef::csr< T, distributed >::max_abs
T max_abs() const
Definition: csr.h:511
rheolef::csr< T, distributed >::mult
void mult(const vec< element_type, distributed > &x, vec< element_type, distributed > &y) const
Definition: csr.h:542
rheolef::csr< T, distributed >::row_last_index
size_type row_last_index() const
Definition: csr.h:520
rheolef::csr< T, distributed >::begin
const_iterator begin() const
Definition: csr.h:524
rheolef::csr< T, distributed >::pattern_dimension
size_type pattern_dimension() const
Definition: csr.h:509
rheolef::csr< T, distributed >::trans_mult
void trans_mult(const vec< element_type, distributed > &x, vec< element_type, distributed > &y) const
Definition: csr.h:550
rheolef::csr< T, distributed >::is_definite_positive
bool is_definite_positive() const
Definition: csr.h:507
rheolef::csr< T, distributed >::col_last_index
size_type col_last_index() const
Definition: csr.h:522
rheolef::csr< T, distributed >::set_pattern_dimension
void set_pattern_dimension(size_type dim) const
Definition: csr.h:510
rheolef::csr< T, distributed >::rep
csr_rep< T, distributed > rep
Definition: csr.h:471
rheolef::csr< T, distributed >::ext_begin_nonconst
iterator ext_begin_nonconst()
Definition: csr.h:533
rheolef::csr< T, distributed >::col_ownership
const distributor & col_ownership() const
Definition: csr.h:498
rheolef::csr< T, distributed >::ext_end_nonconst
iterator ext_end_nonconst()
Definition: csr.h:534
rheolef::csr< T, distributed >::ext_end
const_iterator ext_end() const
Definition: csr.h:532
rheolef::csr< T, distributed >::dis_ncol
size_type dis_ncol() const
Definition: csr.h:500
rheolef::csr< T, distributed >::set_symmetry
void set_symmetry(bool is_symm) const
Definition: csr.h:504
rheolef::csr< T, distributed >::set_symmetry_by_check
void set_symmetry_by_check(const T &tol=std::numeric_limits< T >::epsilon()) const
Definition: csr.h:505
rheolef::csr< T, distributed >::nrow
size_type nrow() const
Definition: csr.h:514
rheolef::csr< T, distributed >::csr
csr()
Definition: csr.h:483
rheolef::csr< T, distributed >::begin_nonconst
iterator begin_nonconst()
Definition: csr.h:526
rheolef::csr< T, distributed >::trans_mult
vec< element_type, distributed > trans_mult(const vec< element_type, distributed > &x) const
Definition: csr.h:553
rheolef::csr< T, distributed >::ext_nnz
size_type ext_nnz() const
Definition: csr.h:530
rheolef::csr< T, distributed >::iterator
rep::iterator iterator
Definition: csr.h:476
rheolef::csr< T, distributed >::ncol
size_type ncol() const
Definition: csr.h:515
rheolef::csr< T, distributed >::base
smart_pointer< rep > base
Definition: csr.h:472
rheolef::csr< T, distributed >::is_symmetric
bool is_symmetric() const
Definition: csr.h:503
rheolef::csr< T, distributed >::csr
csr(const std::initializer_list< details::csr_concat_line< T, distributed > > &init_list)
rheolef::csr< T, distributed >::csr
csr(const std::initializer_list< details::csr_concat_value< T, distributed > > &init_list)
rheolef::csr< T, distributed >::row_first_index
size_type row_first_index() const
Definition: csr.h:519
rheolef::csr< T, distributed >::dis_ext_nnz
size_type dis_ext_nnz() const
Definition: csr.h:502
rheolef::csr< T, distributed >::row_ownership
const distributor & row_ownership() const
Definition: csr.h:497
rheolef::csr< T, distributed >::end_nonconst
iterator end_nonconst()
Definition: csr.h:527
rheolef::csr< T, distributed >::memory_type
rep::memory_type memory_type
Definition: csr.h:473
rheolef::csr< T, distributed >::set_definite_positive
void set_definite_positive(bool is_defpos) const
Definition: csr.h:508
rheolef::csr< T, distributed >::size_type
rep::size_type size_type
Definition: csr.h:474
rheolef::csr< T, distributed >::end
const_iterator end() const
Definition: csr.h:525
rheolef::csr< T, distributed >::constraint_process_rank
int constraint_process_rank() const
rheolef::csr< T, distributed >::csr
csr(const asr< T, memory_type, A > &a)
Definition: csr.h:485
rheolef::csr< T, distributed >::nnz
size_type nnz() const
Definition: csr.h:516
rheolef::csr< T, distributed >::data_iterator
rep::data_iterator data_iterator
Definition: csr.h:478
rheolef::csr< T, distributed >::col_first_index
size_type col_first_index() const
Definition: csr.h:521
rheolef::csr< T, distributed >::dis_nrow
size_type dis_nrow() const
Definition: csr.h:499
rheolef::csr< T, distributed >::ext_begin
const_iterator ext_begin() const
Definition: csr.h:531
rheolef::csr< T, distributed >::dump
void dump(const std::string &name) const
Definition: csr.h:570
rheolef::csr< T, sequential >
Definition: csr.h:323
rheolef::csr< T, sequential >::dis_nnz
size_type dis_nnz() const
Definition: csr.h:360
rheolef::csr< T, sequential >::const_data_iterator
rep::const_data_iterator const_data_iterator
Definition: csr.h:336
rheolef::csr< T, sequential >::element_type
rep::element_type element_type
Definition: csr.h:332
rheolef::csr< T, sequential >::jext2dis_j
size_type jext2dis_j(size_type jext) const
Definition: csr.h:394
rheolef::csr< T, sequential >::resize
void resize(const distributor &row_ownership, const distributor &col_ownership, size_type nnz1=0)
Definition: csr.h:345
rheolef::csr< T, sequential >::const_iterator
rep::const_iterator const_iterator
Definition: csr.h:334
rheolef::csr< T, sequential >::max_abs
T max_abs() const
Definition: csr.h:370
rheolef::csr< T, sequential >::resize
void resize(size_type loc_nrow1=0, size_type loc_ncol1=0, size_type loc_nnz1=0)
Definition: csr.h:343
rheolef::csr< T, sequential >::row_last_index
size_type row_last_index() const
Definition: csr.h:379
rheolef::csr< T, sequential >::begin
const_iterator begin() const
Definition: csr.h:383
rheolef::csr< T, sequential >::pattern_dimension
size_type pattern_dimension() const
Definition: csr.h:368
rheolef::csr< T, sequential >::is_definite_positive
bool is_definite_positive() const
Definition: csr.h:366
rheolef::csr< T, sequential >::col_last_index
size_type col_last_index() const
Definition: csr.h:381
rheolef::csr< T, sequential >::mult
void mult(const vec< element_type, sequential > &x, vec< element_type, sequential > &y) const
Definition: csr.h:401
rheolef::csr< T, sequential >::set_pattern_dimension
void set_pattern_dimension(size_type dim) const
Definition: csr.h:369
rheolef::csr< T, sequential >::ext_begin_nonconst
iterator ext_begin_nonconst()
Definition: csr.h:392
rheolef::csr< T, sequential >::col_ownership
const distributor & col_ownership() const
Definition: csr.h:357
rheolef::csr< T, sequential >::csr
csr(const std::initializer_list< details::csr_concat_line< T, sequential > > &init_list)
rheolef::csr< T, sequential >::ext_end_nonconst
iterator ext_end_nonconst()
Definition: csr.h:393
rheolef::csr< T, sequential >::ext_end
const_iterator ext_end() const
Definition: csr.h:391
rheolef::csr< T, sequential >::dis_ncol
size_type dis_ncol() const
Definition: csr.h:359
rheolef::csr< T, sequential >::set_symmetry
void set_symmetry(bool is_symm) const
Definition: csr.h:363
rheolef::csr< T, sequential >::set_symmetry_by_check
void set_symmetry_by_check(const T &tol=std::numeric_limits< T >::epsilon()) const
Definition: csr.h:364
rheolef::csr< T, sequential >::nrow
size_type nrow() const
Definition: csr.h:373
rheolef::csr< T, sequential >::csr
csr()
Definition: csr.h:340
rheolef::csr< T, sequential >::begin_nonconst
iterator begin_nonconst()
Definition: csr.h:385
rheolef::csr< T, sequential >::trans_mult
vec< element_type, sequential > trans_mult(const vec< element_type, sequential > &x) const
Definition: csr.h:412
rheolef::csr< T, sequential >::ext_nnz
size_type ext_nnz() const
Definition: csr.h:389
rheolef::csr< T, sequential >::csr
csr(const asr< T, sequential, A > &a)
Definition: csr.h:342
rheolef::csr< T, sequential >::iterator
rep::iterator iterator
Definition: csr.h:333
rheolef::csr< T, sequential >::ncol
size_type ncol() const
Definition: csr.h:374
rheolef::csr< T, sequential >::base
smart_pointer< rep > base
Definition: csr.h:329
rheolef::csr< T, sequential >::is_symmetric
bool is_symmetric() const
Definition: csr.h:362
rheolef::csr< T, sequential >::csr
csr(const std::initializer_list< details::csr_concat_value< T, sequential > > &init_list)
rheolef::csr< T, sequential >::row_first_index
size_type row_first_index() const
Definition: csr.h:378
rheolef::csr< T, sequential >::dis_ext_nnz
size_type dis_ext_nnz() const
Definition: csr.h:361
rheolef::csr< T, sequential >::row_ownership
const distributor & row_ownership() const
Definition: csr.h:356
rheolef::csr< T, sequential >::end_nonconst
iterator end_nonconst()
Definition: csr.h:386
rheolef::csr< T, sequential >::memory_type
rep::memory_type memory_type
Definition: csr.h:330
rheolef::csr< T, sequential >::set_definite_positive
void set_definite_positive(bool is_defpos) const
Definition: csr.h:367
rheolef::csr< T, sequential >::size_type
rep::size_type size_type
Definition: csr.h:331
rheolef::csr< T, sequential >::end
const_iterator end() const
Definition: csr.h:384
rheolef::csr< T, sequential >::trans_mult
void trans_mult(const vec< element_type, sequential > &x, vec< element_type, sequential > &y) const
Definition: csr.h:409
rheolef::csr< T, sequential >::constraint_process_rank
int constraint_process_rank() const
rheolef::csr< T, sequential >::nnz
size_type nnz() const
Definition: csr.h:375
rheolef::csr< T, sequential >::data_iterator
rep::data_iterator data_iterator
Definition: csr.h:335
rheolef::csr< T, sequential >::col_first_index
size_type col_first_index() const
Definition: csr.h:380
rheolef::csr< T, sequential >::dis_nrow
size_type dis_nrow() const
Definition: csr.h:358
rheolef::csr< T, sequential >::rep
csr_rep< T, sequential > rep
Definition: csr.h:328
rheolef::csr< T, sequential >::ext_begin
const_iterator ext_begin() const
Definition: csr.h:390
rheolef::csr< T, sequential >::dump
void dump(const std::string &name) const
Definition: csr.h:429
rheolef::csr_rep< T, distributed >
Definition: csr.h:187
rheolef::csr_rep< T, distributed >::dis_nnz
size_type dis_nnz() const
Definition: csr.h:222
rheolef::csr_rep< T, distributed >::data_iterator
base::data_iterator data_iterator
Definition: csr.h:195
rheolef::csr_rep< T, distributed >::_to
scatter_message< std::vector< T > > _to
Definition: csr.h:259
rheolef::csr_rep< T, distributed >::row_last_index
size_type row_last_index() const
Definition: csr.h:233
rheolef::csr_rep< T, distributed >::begin
const_iterator begin() const
Definition: csr.h:208
rheolef::csr_rep< T, distributed >::pattern_dimension
size_type pattern_dimension() const
Definition: csr.h:230
rheolef::csr_rep< T, distributed >::is_definite_positive
bool is_definite_positive() const
Definition: csr.h:228
rheolef::csr_rep< T, distributed >::col_last_index
size_type col_last_index() const
Definition: csr.h:235
rheolef::csr_rep< T, distributed >::set_pattern_dimension
void set_pattern_dimension(size_type dim) const
Definition: csr.h:231
rheolef::csr_rep< T, distributed >::_dis_ext_nnz
size_type _dis_ext_nnz
Definition: csr.h:254
rheolef::csr_rep< T, distributed >::col_ownership
const distributor & col_ownership() const
Definition: csr.h:206
rheolef::csr_rep< T, distributed >::iterator
base::iterator iterator
Definition: csr.h:193
rheolef::csr_rep< T, distributed >::base
csr_rep< T, sequential > base
Definition: csr.h:189
rheolef::csr_rep< T, distributed >::ext_end
const_iterator ext_end() const
Definition: csr.h:214
rheolef::csr_rep< T, distributed >::dis_ncol
size_type dis_ncol() const
Definition: csr.h:221
rheolef::csr_rep< T, distributed >::_scatter_init_guard
void _scatter_init_guard() const
Definition: csr.h:263
rheolef::csr_rep< T, distributed >::set_symmetry
void set_symmetry(bool is_symm) const
Definition: csr.h:226
rheolef::csr_rep< T, distributed >::_ext
csr_rep< T, sequential > _ext
Definition: csr.h:251
rheolef::csr_rep< T, distributed >::size_type
base::size_type size_type
Definition: csr.h:191
rheolef::csr_rep< T, distributed >::nrow
size_type nrow() const
Definition: csr.h:217
rheolef::csr_rep< T, distributed >::ext_nnz
size_type ext_nnz() const
Definition: csr.h:212
rheolef::csr_rep< T, distributed >::_from
scatter_message< std::vector< T > > _from
Definition: csr.h:258
rheolef::csr_rep< T, distributed >::ext_begin
iterator ext_begin()
Definition: csr.h:215
rheolef::csr_rep< T, distributed >::ncol
size_type ncol() const
Definition: csr.h:218
rheolef::csr_rep< T, distributed >::_scatter_initialized
bool _scatter_initialized
Definition: csr.h:257
rheolef::csr_rep< T, distributed >::is_symmetric
bool is_symmetric() const
Definition: csr.h:225
rheolef::csr_rep< T, distributed >::element_type
base::element_type element_type
Definition: csr.h:192
rheolef::csr_rep< T, distributed >::_buffer
std::vector< T > _buffer
Definition: csr.h:260
rheolef::csr_rep< T, distributed >::const_iterator
base::const_iterator const_iterator
Definition: csr.h:194
rheolef::csr_rep< T, distributed >::row_first_index
size_type row_first_index() const
Definition: csr.h:232
rheolef::csr_rep< T, distributed >::dis_ext_nnz
size_type dis_ext_nnz() const
Definition: csr.h:223
rheolef::csr_rep< T, distributed >::row_ownership
const distributor & row_ownership() const
Definition: csr.h:205
rheolef::csr_rep< T, distributed >::_dis_nnz
size_type _dis_nnz
Definition: csr.h:253
rheolef::csr_rep< T, distributed >::set_definite_positive
void set_definite_positive(bool is_defpos) const
Definition: csr.h:229
rheolef::csr_rep< T, distributed >::end
iterator end()
Definition: csr.h:211
rheolef::csr_rep< T, distributed >::end
const_iterator end() const
Definition: csr.h:209
rheolef::csr_rep< T, distributed >::ext_end
iterator ext_end()
Definition: csr.h:216
rheolef::csr_rep< T, distributed >::comm
const communicator & comm() const
Definition: csr.h:207
rheolef::csr_rep< T, distributed >::begin
iterator begin()
Definition: csr.h:210
rheolef::csr_rep< T, distributed >::nnz
size_type nnz() const
Definition: csr.h:219
rheolef::csr_rep< T, distributed >::_jext2dis_j
std::vector< size_type > _jext2dis_j
Definition: csr.h:252
rheolef::csr_rep< T, distributed >::col_first_index
size_type col_first_index() const
Definition: csr.h:234
rheolef::csr_rep< T, distributed >::memory_type
distributed memory_type
Definition: csr.h:190
rheolef::csr_rep< T, distributed >::dis_nrow
size_type dis_nrow() const
Definition: csr.h:220
rheolef::csr_rep< T, distributed >::const_data_iterator
base::const_data_iterator const_data_iterator
Definition: csr.h:196
rheolef::csr_rep< T, distributed >::ext_begin
const_iterator ext_begin() const
Definition: csr.h:213
rheolef::csr_rep< T, sequential >
Definition: csr.h:84
rheolef::csr_rep< T, sequential >::dis_nnz
size_type dis_nnz() const
Definition: csr.h:116
rheolef::csr_rep< T, sequential >::_pattern_dimension
size_type _pattern_dimension
Definition: csr.h:155
rheolef::csr_rep< T, sequential >::jext2dis_j
size_type jext2dis_j(size_type jext) const
Definition: csr.h:147
rheolef::csr_rep< T, sequential >::const_data_iterator
vector_of_iterator< pair_type >::const_value_type const_data_iterator
Definition: csr.h:94
rheolef::csr_rep< T, sequential >::row_last_index
size_type row_last_index() const
Definition: csr.h:126
rheolef::csr_rep< T, sequential >::begin
const_iterator begin() const
Definition: csr.h:107
rheolef::csr_rep< T, sequential >::pattern_dimension
size_type pattern_dimension() const
Definition: csr.h:123
rheolef::csr_rep< T, sequential >::is_definite_positive
bool is_definite_positive() const
Definition: csr.h:121
rheolef::csr_rep< T, sequential >::col_last_index
size_type col_last_index() const
Definition: csr.h:128
rheolef::csr_rep< T, sequential >::iterator
vector_of_iterator< pair_type >::iterator iterator
Definition: csr.h:90
rheolef::csr_rep< T, sequential >::set_pattern_dimension
void set_pattern_dimension(size_type dim) const
Definition: csr.h:124
rheolef::csr_rep< T, sequential >::memory_type
sequential memory_type
Definition: csr.h:88
rheolef::csr_rep< T, sequential >::_is_symmetric
bool _is_symmetric
Definition: csr.h:153
rheolef::csr_rep< T, sequential >::col_ownership
const distributor & col_ownership() const
Definition: csr.h:106
rheolef::csr_rep< T, sequential >::ext_end
const_iterator ext_end() const
Definition: csr.h:146
rheolef::csr_rep< T, sequential >::_data
std::vector< std::pair< typename std::vector< T >::size_type, T > > _data
Definition: csr.h:152
rheolef::csr_rep< T, sequential >::dis_ncol
size_type dis_ncol() const
Definition: csr.h:115
rheolef::csr_rep< T, sequential >::set_symmetry
void set_symmetry(bool is_symm) const
Definition: csr.h:119
rheolef::csr_rep< T, sequential >::_row_ownership
distributor _row_ownership
Definition: csr.h:150
rheolef::csr_rep< T, sequential >::nrow
size_type nrow() const
Definition: csr.h:111
rheolef::csr_rep< T, sequential >::pair_type
std::pair< size_type, T > pair_type
Definition: csr.h:89
rheolef::csr_rep< T, sequential >::ext_nnz
size_type ext_nnz() const
Definition: csr.h:143
rheolef::csr_rep< T, sequential >::ncol
size_type ncol() const
Definition: csr.h:112
rheolef::csr_rep< T, sequential >::is_symmetric
bool is_symmetric() const
Definition: csr.h:118
rheolef::csr_rep< T, sequential >::difference_type
vector_of_iterator< pair_type >::difference_type difference_type
Definition: csr.h:92
rheolef::csr_rep< T, sequential >::size_type
std::vector< T >::size_type size_type
Definition: csr.h:86
rheolef::csr_rep< T, sequential >::data_iterator
vector_of_iterator< pair_type >::value_type data_iterator
Definition: csr.h:93
rheolef::csr_rep< T, sequential >::row_first_index
size_type row_first_index() const
Definition: csr.h:125
rheolef::csr_rep< T, sequential >::dis_ext_nnz
size_type dis_ext_nnz() const
Definition: csr.h:144
rheolef::csr_rep< T, sequential >::row_ownership
const distributor & row_ownership() const
Definition: csr.h:105
rheolef::csr_rep< T, sequential >::_is_definite_positive
bool _is_definite_positive
Definition: csr.h:154
rheolef::csr_rep< T, sequential >::set_definite_positive
void set_definite_positive(bool is_defpos) const
Definition: csr.h:122
rheolef::csr_rep< T, sequential >::end
iterator end()
Definition: csr.h:110
rheolef::csr_rep< T, sequential >::end
const_iterator end() const
Definition: csr.h:108
rheolef::csr_rep< T, sequential >::begin
iterator begin()
Definition: csr.h:109
rheolef::csr_rep< T, sequential >::const_iterator
vector_of_iterator< pair_type >::const_iterator const_iterator
Definition: csr.h:91
rheolef::csr_rep< T, sequential >::nnz
size_type nnz() const
Definition: csr.h:113
rheolef::csr_rep< T, sequential >::element_type
T element_type
Definition: csr.h:87
rheolef::csr_rep< T, sequential >::_col_ownership
distributor _col_ownership
Definition: csr.h:151
rheolef::csr_rep< T, sequential >::col_first_index
size_type col_first_index() const
Definition: csr.h:127
rheolef::csr_rep< T, sequential >::dis_nrow
size_type dis_nrow() const
Definition: csr.h:114
rheolef::csr_rep< T, sequential >::ext_begin
const_iterator ext_begin() const
Definition: csr.h:145
rheolef::csr_rep
Definition: csr.h:81
rheolef::csr
see the csr page for the full documentation
Definition: csr.h:317
rheolef::csr::memory_type
M memory_type
Definition: csr.h:319
rheolef::details::csr_concat_line
Definition: csr_concat.h:93
rheolef::details::csr_concat_value
Definition: csr_concat.h:51
rheolef::disarray_rep< T, distributed, A >
Definition: disarray.h:289
rheolef::disarray_rep< T, sequential, A >
Definition: disarray.h:218
rheolef::distributor
see the distributor page for the full documentation
Definition: distributor.h:62
rheolef::odiststream
odiststream: see the diststream page for the full documentation
Definition: diststream.h:126
rheolef::scatter_message
Definition: scatter_message.h:33
rheolef::smart_pointer
see the smart_pointer page for the full documentation
Definition: smart_pointer.h:351
rheolef::vec
see the vec page for the full documentation
Definition: vec.h:79
rheolef::vector_of_iterator
Definition: vector_of_iterator.h:35
rheolef::vector_of_iterator::difference_type
V::difference_type difference_type
Definition: vector_of_iterator.h:50
rheolef::vector_of_iterator::iterator
value_type * iterator
Definition: vector_of_iterator.h:41
rheolef::vector_of_iterator::size
size_type size() const
Definition: vector_of_iterator.h:103
rheolef::vector_of_iterator::value_type
T * value_type
Definition: vector_of_iterator.h:39
rheolef::vector_of_iterator::const_iterator
const_value_type *const const_iterator
Definition: vector_of_iterator.h:42
rheolef::vector_of_iterator::const_value_type
const T * const_value_type
Definition: vector_of_iterator.h:40
rheolef::vector_of_iterator::end
const_iterator end() const
Definition: vector_of_iterator.h:131
rheolef::vector_of_iterator::begin
iterator begin()
Definition: vector_of_iterator.h:110
rheolef::element_type
geo_element_auto< heap_allocator< geo_element::size_type > > element_type
Definition: level_set.cc:346
rheolef::Function
rheolef::std Function
T
Expr1::float_type T
Definition: field_expr.h:261
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
operator*
return a operator*(eh)
dump
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format format format format format format format format format format format format format dump
Definition: iorheo-members.h:119
mkgeo_ball.b
int b
Definition: mkgeo_ball.sh:152
mkgeo_ball.c
int c
Definition: mkgeo_ball.sh:153
mkgeo_ball.d
int d
Definition: mkgeo_ball.sh:154
mkgeo_ball.n
int n
Definition: mkgeo_ball.sh:150
mkgeo_ball.a
int a
Definition: mkgeo_ball.sh:151
mkgeo_ball.dim
int dim
Definition: mkgeo_ball.sh:307
mkgeo_contraction.name
string name
Definition: mkgeo_contraction.sh:133
rheolef::details::max_abs
T max_abs(const T &x)
Definition: keller_details.h:47
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::operator*=
std::enable_if< details::is_rheolef_arithmetic< U >::value,ad3_basic< T > & >::type operator*=(ad3_basic< T > &a, const U &b)
Definition: ad3.h:367
rheolef::put
void put(std::ostream &out, std::string name, const tiny_matrix< T > &a)
Definition: tiny_lu.h:155
rheolef::operator>>
std::istream & operator>>(std::istream &is, const catchmark &m)
Definition: catchmark.h:88
rheolef::trans
csr< T, sequential > trans(const csr< T, sequential > &a)
trans(a): see the form page for the full documentation
Definition: csr.h:455
rheolef::operator+
std::enable_if< details::is_rheolef_arithmetic< U >::value,ad3_basic< T >>::type operator+(const U &a, const ad3_basic< T > &b)
Definition: ad3.h:222
rheolef::operator-
csr< T, sequential > operator-(const csr< T, sequential > &a)
Definition: csr.h:447
rheolef::diag
csr< T, M > diag(const vec< T, M > &d)
Definition: csr.cc:56
rheolef::operator*
csr< T, sequential > operator*(const T &lambda, const csr< T, sequential > &a)
Definition: csr.h:437
rheolef::put_matrix_market
void put_matrix_market(std::ostream &out, const Eigen::SparseMatrix< T, Eigen::RowMajor > &a)
Definition: eigen_util.h:79
rheolef::pair_transform_second
OutputPairIterator pair_transform_second(InputPairIterator first, InputPairIterator last, OutputPairIterator result, UnaryOperation unary_op)
Definition: pair_util.h:41
rheolef::operator<<
std::ostream & operator<<(std::ostream &os, const catchmark &m)
Definition: catchmark.h:99
rheolef::operator-
csr< T, distributed > operator-(const csr< T, distributed > &a)
Definition: csr.h:586
rheolef::csr_apply
csr< T, M > csr_apply(Function f, const csr< T, M > &a)
Definition: csr.h:605
a
Definition: diffusion_isotropic.h:25
f
Definition: cavity_dg.h:29
lambda
Definition: yield_slip_circle.h:34
rheolef::distributed
Definition: distributed.h:88
rheolef::sequential
Definition: distributed.h:28
epsilon
Float epsilon
Definition: transmission_error.cc:25
M
Expr1::memory_type M
Definition: vec_expr_v2.h:416