1# ifndef _RHEO_TINY_MATVEC_H
2# define _RHEO_TINY_MATVEC_H
30#include "rheolef/compiler.h"
41 typedef typename std::vector<int>::size_type
size_type;
76 void fill(
const T& val);
79 T t_ [tiny_size_max][tiny_size_max];
96 std::fill (
t_,
t_+tiny_size_max, std::numeric_limits<T>::max());
114#ifdef _RHEOLEF_PARANO
115 std::fill (t_, t_+tiny_size_max, std::numeric_limits<T>::max());
121 : nrow_(nr), ncol_(nc), i0_(0), j0_(0)
123 check_macro (nr <= tiny_size_max && nc <= tiny_size_max,
"invalid sizes");
124#ifdef _RHEOLEF_PARANO
125 for (
size_type i = 0; i < tiny_size_max; i++)
126 for (
size_type j = 0; j < tiny_size_max; j++)
127 t_[i][j] = std::numeric_limits<T>::max();
138 check_macro (nr <= tiny_size_max && nc <= tiny_size_max,
"invalid sizes");
139#ifdef _RHEOLEF_PARANO
140 for (
size_type i = 0; i < tiny_size_max; i++)
141 for (
size_type j = 0; j < tiny_size_max; j++)
142 t_[i][j] = std::numeric_limits<T>::max();
150 for (
size_type i = i0_; i < i0_ + nrow_; i++)
151 for (
size_type j = j0_; j < j0_ + ncol_; j++)
159 b.resize (a.ncol(), a.nrow());
168 check_macro(a.ncol()==b.nrow(),
"Error in matrices sizes for multiplication, "
169 << a.nrow()<<
"x"<<a.ncol() <<
" and "<< b.nrow()<<
"x"<<b.ncol());
176 c(i,j)+=a(i,k)*b(k,j);
183 check_macro(a.ncol()==
u.size(),
"Error in matrice-vector sizes for multiplication, "
184 << a.nrow()<<
"x"<<a.ncol() <<
" and "<<
u.size());
field::size_type size_type
size_type get_col_origin() const
tiny_matrix(size_type nr=0, size_type nc=0)
T & operator()(size_type i, size_type j)
void resize(size_type nr, size_type nc)
void set_origin(size_type i, size_type j)
size_type get_row_origin() const
tiny_vector< T >::size_type size_type
tiny_vector(size_type n=0)
const T & operator()(size_type i) const
void set_origin(size_type i)
size_type get_origin() const
const T & operator[](size_type i) const
std::vector< int >::size_type size_type
const unsigned int tiny_size_max
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
csr< T, sequential > trans(const csr< T, sequential > &a)
trans(a): see the form page for the full documentation
csr< T, sequential > operator*(const T &lambda, const csr< T, sequential > &a)