75 #ifndef SLIP_MATRIX_HPP
76 #define SLIP_MATRIX_HPP
102 #include <boost/serialization/access.hpp>
103 #include <boost/serialization/split_member.hpp>
104 #include <boost/serialization/string.hpp>
105 #include <boost/serialization/complex.hpp>
106 #include <boost/serialization/version.hpp>
112 class stride_iterator;
115 class iterator2d_box;
118 class iterator2d_range;
121 class const_iterator2d_box;
124 class const_iterator2d_range;
135 template <
typename T>
138 template <
typename T>
141 template <
typename T>
142 std::ostream& operator<<(std::ostream & out, const slip::Matrix<T>& a);
153 bool operator<(const slip::Matrix<T>& x,
161 bool operator<=(const slip::Matrix<T>& x,
189 template <
typename T>
248 static const std::size_t
DIM = 2;
298 template<
typename InputIterator>
1882 friend std::ostream& operator<< <>(std::ostream & out,
1917 std::fill_n(this->
begin(),this->
size(),value);
1939 template<
typename InputIterator>
1959 friend bool operator== <>(
const Matrix<T>& x,
1968 friend bool operator!= <>(
const Matrix<T>& x,
1977 friend bool operator< <>(
const Matrix<T>& x,
1986 friend bool operator> <>(
const Matrix<T>& x,
1995 friend bool operator<= <>(
const Matrix<T>& x,
2004 friend bool operator>= <>(
const Matrix<T>& x,
2118 std::string
name()
const;
2276 assert(this->
size() != 0);
2286 assert(this->
size() != 0);
2362 friend class boost::serialization::access;
2363 template<
class Archive>
2364 void save(Archive & ar,
const unsigned int version)
const
2368 template<
class Archive>
2369 void load(Archive & ar,
const unsigned int version)
2373 BOOST_SERIALIZATION_SPLIT_MEMBER();
2411 template<
typename T>
2412 Matrix<T>
operator+(
const Matrix<T>& M1,
2413 const Matrix<T>& M2);
2421 template<
typename T>
2422 Matrix<T>
operator+(
const Matrix<T>& M1,
2431 template<
typename T>
2433 const Matrix<T>& M1);
2443 template<
typename T>
2444 Matrix<T>
operator-(
const Matrix<T>& M1,
2445 const Matrix<T>& M2);
2453 template<
typename T>
2454 Matrix<T>
operator-(
const Matrix<T>& M1,
2463 template<
typename T>
2465 const Matrix<T>& M1);
2475 template<
typename T>
2476 Matrix<T>
operator*(
const Matrix<T>& M1,
2477 const Matrix<T>& M2);
2485 template<
typename T>
2486 Matrix<T>
operator*(
const Matrix<T>& M1,
2495 template<
typename T>
2497 const Matrix<T>& M1);
2507 template<
typename T>
2508 Matrix<T>
operator/(
const Matrix<T>& M1,
2509 const Matrix<T>& M2);
2517 template<
typename T>
2518 Matrix<T>
operator/(
const Matrix<T>& M1,
2528 template<
typename T>
2529 T&
min(
const Matrix<T>& M1);
2538 template<
typename T>
2539 T&
max(
const Matrix<T>& M1);
2547 template<
typename T>
2548 Matrix<typename slip::lin_alg_traits<T>::value_type>
abs(
const Matrix<T>& V);
2556 template<
typename T>
2557 Matrix<T>
sqrt(
const Matrix<T>& V);
2565 template<
typename T>
2566 Matrix<T>
cos(
const Matrix<T>& V);
2574 Matrix<float>
acos(
const Matrix<float>& V);
2581 Matrix<double>
acos(
const Matrix<double>& V);
2588 Matrix<long double>
acos(
const Matrix<long double>& V);
2597 template<
typename T>
2598 Matrix<T>
sin(
const Matrix<T>& V);
2607 Matrix<float>
asin(
const Matrix<float>& V);
2614 Matrix<double>
asin(
const Matrix<double>& V);
2621 Matrix<long double>
asin(
const Matrix<long double>& V);
2630 template<
typename T>
2631 Matrix<T>
tan(
const Matrix<T>& V);
2640 Matrix<float>
atan(
const Matrix<float>& V);
2647 Matrix<double>
atan(
const Matrix<double>& V);
2654 Matrix<long double>
atan(
const Matrix<long double>& V);
2663 template<
typename T>
2664 Matrix<T>
exp(
const Matrix<T>& V);
2672 template<
typename T>
2673 Matrix<T>
log(
const Matrix<T>& V);
2681 template<
typename T>
2682 Matrix<T>
cosh(
const Matrix<T>& V);
2690 template<
typename T>
2691 Matrix<T>
sinh(
const Matrix<T>& V);
2699 template<
typename T>
2700 Matrix<T>
tanh(
const Matrix<T>& V);
2708 template<
typename T>
2709 Matrix<T>
log10(
const Matrix<T>& V);
2716 template<
typename T>
2719 array_(new slip::
Array2d<T>())
2722 template<
typename T>
2726 array_(new slip::
Array2d<T>(d1,d2))
2729 template<
typename T>
2734 array_(new slip::
Array2d<T>(d1,d2,val))
2737 template<
typename T>
2742 array_(new slip::
Array2d<T>(d1,d2,val))
2745 template<
typename T>
2748 array_(new slip::
Array2d<T>((*rhs.array_)))
2751 template<
typename T>
2758 template<
typename T>
2764 *array_ = *(rhs.array_);
2769 template<
typename T>
2773 std::fill_n((*array_)[0],array_->size(),val);
2777 template<
typename T>
2783 array_->
resize(d1,d2,val);
2787 template<
typename T>
2791 return array_->
begin();
2794 template<
typename T>
2798 return array_->
end();
2801 template<
typename T>
2809 template<
typename T>
2818 template<
typename T>
2825 template<
typename T>
2832 template<
typename T>
2839 template<
typename T>
2846 template<
typename T>
2854 template<
typename T>
2859 return array_->row_end(row);
2862 template<
typename T>
2867 return array_->col_begin(col);
2871 template<
typename T>
2876 return array_->col_end(col);
2880 template<
typename T>
2885 Array2d<T>
const * tp(array_);
2886 return tp->row_begin(row);
2889 template<
typename T>
2894 Array2d<T>
const * tp(array_);
2895 return tp->row_end(row);
2898 template<
typename T>
2902 Array2d<T>
const * tp(array_);
2903 return tp->col_begin(col);
2906 template<
typename T>
2910 Array2d<T>
const * tp(array_);
2911 return tp->col_end(col);
2915 template<
typename T>
2920 return array_->row_rbegin(row);
2923 template<
typename T>
2928 Array2d<T>
const * tp(array_);
2929 return tp->row_rbegin(row);
2932 template<
typename T>
2936 return array_->row_rend(row);
2939 template<
typename T>
2944 Array2d<T>
const * tp(array_);
2945 return tp->row_rend(row);
2949 template<
typename T>
2953 return array_->col_rbegin(col);
2956 template<
typename T>
2961 Array2d<T>
const * tp(array_);
2962 return tp->col_rbegin(col);
2965 template<
typename T>
2970 return array_->col_rend(col);
2973 template<
typename T>
2978 Array2d<T>
const * tp(array_);
2979 return tp->col_rend(col);
2982 template<
typename T>
2988 return array_->row_begin(row,range);
2991 template<
typename T>
2997 Array2d<T>
const * tp(array_);
2998 return tp->row_begin(row,range);
3001 template<
typename T>
3007 return array_->col_begin(col,range);
3010 template<
typename T>
3016 Array2d<T>
const * tp(array_);
3017 return tp->col_begin(col,range);
3021 template<
typename T>
3027 return array_->row_end(row,range);
3030 template<
typename T>
3036 Array2d<T>
const * tp(array_);
3037 return tp->row_end(row,range);
3040 template<
typename T>
3046 return array_->col_end(col,range);
3049 template<
typename T>
3055 Array2d<T>
const * tp(array_);
3056 return tp->col_end(col,range);
3059 template<
typename T>
3068 template<
typename T>
3078 template<
typename T>
3087 template<
typename T>
3096 template<
typename T>
3105 template<
typename T>
3115 template<
typename T>
3124 template<
typename T>
3133 template<
typename T>
3140 template<
typename T>
3149 template<
typename T>
3156 template<
typename T>
3164 template<
typename T>
3172 template<
typename T>
3180 template<
typename T>
3187 template<
typename T>
3196 template<
typename T>
3202 return array_->
upper_left(row_range,col_range);
3205 template<
typename T>
3215 template<
typename T>
3224 template<
typename T>
3234 template<
typename T>
3242 template<
typename T>
3251 template<
typename T>
3259 template<
typename T>
3269 template<
typename T>
3277 template<
typename T>
3286 template<
typename T>
3294 template<
typename T>
3303 template<
typename T>
3311 template<
typename T>
3320 template<
typename T>
3328 template<
typename T>
3337 template<
typename T>
3346 template<
typename T>
3356 template<
typename T>
3365 template<
typename T>
3375 template<
typename T>
3380 return this->rupper_left(range,range);
3383 template<
typename T>
3388 return this->rupper_left(range,range);
3391 template<
typename T>
3396 return this->rbottom_right(range,range);
3399 template<
typename T>
3404 return this->rbottom_right(range,range);
3407 template <
typename T>
3409 std::ostream& operator<<(std::ostream & out, const Matrix<T>& a)
3417 template<
typename T>
3422 return (*array_)[i];
3425 template<
typename T>
3430 return (*array_)[i];
3433 template<
typename T>
3439 return (*array_)[i][j];
3442 template<
typename T>
3448 return (*array_)[i][j];
3451 template<
typename T>
3456 return (*array_)(point2d);
3459 template<
typename T>
3464 return (*array_)(point2d);
3468 template<
typename T>
3474 assert((*
this)[0] != 0);
3476 assert(row_range.
start() < int(this->dim2()));
3477 assert(row_range.
stop() < int(this->dim2()));
3479 assert(col_range.
start() < int(this->dim1()));
3480 assert(col_range.
stop() < int(this->dim1()));
3483 return Matrix<T>(rows+1,cols+1,array_->upper_left(row_range,col_range),
3484 array_->bottom_right(row_range,col_range));
3487 template<
typename T>
3493 template<
typename T>
3497 template<
typename T>
3502 template<
typename T>
3506 template<
typename T>
3510 template<
typename T>
3514 template<
typename T>
3518 template<
typename T>
3523 template<
typename T>
3527 template<
typename T>
3531 array_->
swap(*(M.array_));
3535 template<
typename T>
3539 std::transform(array_->begin(),array_->end(),array_->begin(),std::bind2nd(std::plus<T>(),val));
3543 template<
typename T>
3547 std::transform(array_->begin(),array_->end(),array_->begin(),std::bind2nd(std::minus<T>(),val));
3551 template<
typename T>
3555 std::transform(array_->begin(),array_->end(),array_->begin(),std::bind2nd(std::multiplies<T>(),val));
3559 template<
typename T>
3563 std::transform(array_->begin(),array_->end(),array_->begin(),std::bind2nd(std::divides<T>(),val));
3567 template<
typename T>
3572 std::transform(array_->begin(),array_->end(),tmp.
begin(),std::negate<T>());
3576 template<
typename T>
3580 assert(this->dim1() == rhs.
dim1());
3581 assert(this->dim2() == rhs.
dim2());
3582 std::transform(array_->begin(),array_->end(),(*(rhs.array_)).begin(),array_->begin(),std::plus<T>());
3586 template<
typename T>
3590 assert(this->dim1() == rhs.
dim1());
3591 assert(this->dim2() == rhs.
dim2());
3592 std::transform(array_->begin(),array_->end(),(*(rhs.array_)).begin(),array_->begin(),std::minus<T>());
3596 template<
typename T>
3600 assert(this->dim1() == rhs.
dim1());
3601 assert(this->dim2() == rhs.
dim2());
3602 std::transform(array_->begin(),array_->end(),(*(rhs.array_)).begin(),array_->begin(),std::multiplies<T>());
3606 template<
typename T>
3610 assert(this->size() == rhs.
size());
3611 std::transform(array_->begin(),array_->end(),(*(rhs.array_)).begin(),array_->begin(),std::divides<T>());
3617 template<
typename T>
3621 assert(array_->size() != 0);
3622 return *std::min_element(array_->begin(),array_->end(),std::less<T>());
3625 template<
typename T>
3629 assert(array_->size() != 0);
3630 return *std::max_element(array_->begin(),array_->end(),std::less<T>());
3633 template<
typename T>
3637 assert(array_->size() != 0);
3638 return std::accumulate(array_->begin(),array_->end(),T());
3641 template<
typename T>
3645 assert(array_->size() != 0);
3646 assert(this->rows() == this->cols());
3647 T sum = (*this)[0][0];
3648 for(std::size_t i = 1; i < this->rows(); ++i)
3650 sum += (*this)[i][i];
3655 template<
typename T>
3659 assert(array_->size() != 0);
3660 assert(this->rows() == this->cols());
3664 template<
typename T>
3676 for(std::size_t i = 0; i < W.
size(); ++i)
3691 template<
typename T>
3695 assert(array_->size() != 0);
3696 assert(this->rows() == this->cols());
3706 for(std::size_t i = 1; i < W.
size(); ++i)
3723 template<
typename T>
3727 assert(array_->size() != 0);
3728 assert(this->rows() == this->cols());
3734 template<
typename T>
3738 slip::apply(this->begin(),this->end(),this->begin(),fun);
3742 template<
typename T>
3746 slip::apply(this->begin(),this->end(),this->begin(),fun);
3752 template<
typename T>
3760 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.begin(),std::plus<T>());
3764 template<
typename T>
3774 template<
typename T>
3783 template<
typename T>
3791 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.begin(),std::minus<T>());
3795 template<
typename T>
3805 template<
typename T>
3813 template<
typename T>
3821 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.begin(),std::multiplies<T>());
3825 template<
typename T>
3836 template<
typename T>
3844 template<
typename T>
3852 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.begin(),std::divides<T>());
3856 template<
typename T>
3876 template<
typename T>
3883 template<
typename T>
3890 template<
typename T>
3900 template<
typename T>
3909 template<
typename T>
3943 template<
typename T>
3977 template<
typename T>
4011 template<
typename T>
4020 template<
typename T>
4029 template<
typename T>
4038 template<
typename T>
4047 template<
typename T>
4056 template<
typename T>
4066 template<
typename T>
4075 template<
typename T>
4087 template<
typename T>
4089 bool operator<(const Matrix<T>& x,
4092 return std::lexicographical_compare(x.begin(), x.end(),
4093 y.begin(), y.end());
4096 template<
typename T>
4104 template<
typename T>
4106 bool operator<=(const Matrix<T>& x,
4112 template<
typename T>
4122 #endif //SLIP_MATRIX_HPP
Provides a class to manipulate 2d dynamic and generic arrays.
HyperVolume< T > tanh(const HyperVolume< T > &M)
bool operator!=(const Array< T > &x, const Array< T > &y)
Matrix()
Constructs a Matrix.
std::size_t iterations() const
Rerturns the number of iterations of the range.
slip::Matrix< int > Matrix_i
int alias
T & max(const GrayscaleImage< T > &M1)
Returns the max element of a GrayscaleImage.
self & operator/=(const T &val)
iterator2d upper_left()
Returns a read/write iterator2d that points to the first element of the Array2d. It points to the upp...
bool operator==(const slip::Matrix< T > &x, const slip::Matrix< T > &y)
Matrix(const size_type d1, const size_type d2, InputIterator first, InputIterator last)
Contructs a Matrix from a range.
Matrix< T > sinh(const Matrix< T > &M)
Provides a class to modelize the difference of slip::Point2d.
Matrix< T > sqrt(const Matrix< T > &M)
slip::stride_iterator< const_col_iterator > const_col_range_iterator
slip::Array2d< T >::const_iterator2d_range const_iterator2d_range
iterator2d upper_left()
Returns a read/write iterator2d that points to the first element of the Matrix. It points to the uppe...
void fill(const T *value)
Fills the container range [begin(),begin()+size()) with a copy of the value array.
std::reverse_iterator< iterator2d > reverse_iterator2d
~Matrix()
Destructor of the Matrix.
Matrix< T > tan(const Matrix< T > &M)
std::reverse_iterator< const_iterator > const_reverse_row_iterator
reverse_row_iterator row_rbegin(const size_type row)
Returns a read/write reverse iterator that points to the last element of the row row in the Matrix...
reference operator()(const size_type i, const size_type j)
Subscript access to the data contained in the Matrix.
HyperVolume< T > abs(const HyperVolume< T > &V)
Returns the abs value of each element of the HyperVolume.
slip::Matrix< float > Matrix_f
float alias
size_type max_size() const
Returns the maximal size (number of elements) in the Matrix.
size_type dim1() const
Returns the number of rows (first dimension size) in the Matrix.
void lu_inv(const Matrix1 &M, Matrix2 &IM)
Computes the inverse of a matrix using LU decomposition.
reverse_iterator rbegin()
Returns a read/write reverse iterator that points to the last element in the Matrix. Iteration is done in reverse element order.
slip::Matrix< double > Matrix_d
double alias
Matrix< long double > atan(const Matrix< long double > &M)
void fill(InputIterator first, InputIterator last)
Fills the container range [begin(),begin()+size()) with a copy of the range [first,last)
This is some iterator to iterate a 2d container into two Range defined by the indices and strides of ...
T & max(const Matrix< T > &M1)
HyperVolume< T > cosh(const HyperVolume< T > &M)
iterator2d bottom_right()
Returns a read/write iterator2d that points to the past the end element of the Matrix. It points to past the end element of the bottom right element of the Matrix.
slip::stride_iterator< pointer > col_iterator
value_type const & const_reference
slip::lin_alg_traits< typename Matrix1::value_type >::value_type spectral_radius(const Matrix1 &A)
Spectral radius of a matrix .
slip::stride_iterator< const_pointer > const_row_range_iterator
std::reverse_iterator< const_row_range_iterator > const_reverse_row_range_iterator
T & min(const GrayscaleImage< T > &M1)
Returns the min element of a GrayscaleImage.
pointer operator[](const size_type i)
Subscript access to the row datas contained in the Matrix.
Color< T > operator+(const Color< T > &V1, const Color< T > &V2)
norm_type frobenius_norm() const
Returns the Frobenius norm of the Matrix .
size_type rank() const
Returns the rank of the Matrix.
iterator begin()
Returns a read/write iterator that points to the first element in the Matrix. Iteration is done in or...
Provides a class to manipulate iterator2d within a slip::Box2d. It is used to iterate throw 2d contai...
iterator begin()
Returns a read/write iterator that points to the first element in the Array. Iteration is done in ord...
reverse_iterator2d rupper_left()
Returns a read/write reverse iterator2d. It points to the bottom right element of the Array2d...
iterator2d bottom_right()
Returns a read/write iterator2d that points to the past the end element of the Array2d. It points to past the end element of the bottom right element of the Array2d.
std::reverse_iterator< iterator > reverse_iterator
size_type cols() const
Returns the number of columns (second dimension size) in the Matrix.
slip::Matrix< long > Matrix_l
long alias
HyperVolume< T > atan(const HyperVolume< T > &M)
HyperVolume< T > sin(const HyperVolume< T > &V)
Returns the sin value of each element of the HyperVolume.
size_type size() const
Returns the number of elements in the Matrix.
self inv() const
Returns the inverse of the Matrix.
size_type columns() const
Returns the number of columns (second dimension size) in the Matrix.
HyperVolume< T > exp(const HyperVolume< T > &M)
HyperVolume< T > sinh(const HyperVolume< T > &V)
Returns the sinh value of each element of the HyperVolume.
reverse_iterator2d rbottom_right()
Returns a read/write reverse iterator2d. It points to past the upper left element of the Array2d...
self & operator-=(const T &val)
Provides common linear algebra algorithms.
slip::Matrix< unsigned long > Matrix_ul
unsigned long alias
slip::stride_iterator< const_pointer > const_col_iterator
col_iterator col_end(const size_type col)
Returns a read/write iterator that points one past the end element of the column column in the Matrix...
reverse_col_iterator col_rbegin(const size_type col)
Returns a read/write reverse iterator that points to the last element of the column column in the Mat...
HyperVolume< T > abs(const HyperVolume< T > &M)
bool operator>(const Array< T > &x, const Array< T > &y)
T trace() const
Returns the trace of the elements of the Matrix.
self & operator*=(const T &val)
T det() const
Returns the determinant of the Matrix.
HyperVolume< T > sin(const HyperVolume< T > &M)
std::reverse_iterator< col_range_iterator > reverse_col_range_iterator
std::reverse_iterator< const_col_iterator > const_reverse_col_iterator
void swap(self &M)
Swaps data with another Matrix.
HyperVolume< T > tan(const HyperVolume< T > &V)
Returns the tan value of each element of the HyperVolume.
std::reverse_iterator< row_range_iterator > reverse_row_range_iterator
slip::stride_iterator< col_iterator > col_range_iterator
HyperVolume< T > cos(const HyperVolume< T > &M)
slip::Matrix< short > Matrix_s
short alias
This is a point2d class, a specialized version of Point<CoordType,DIM> with DIM = 2...
value_type const * const_pointer
slip::Matrix< unsigned int > Matrix_ui
unsigned int alias
iterator2d default_iterator
bool empty() const
Returns true if the Matrix is empty. (Thus size() == 0)
Matrix & operator=(const self &rhs)
Assign a Matrix.
bool operator>=(const slip::Matrix< T > &x, const slip::Matrix< T > &y)
HyperVolume< T > log10(const HyperVolume< T > &V)
Returns the log10 value of each element of the HyperVolume.
bool operator!=(const slip::Matrix< T > &x, const slip::Matrix< T > &y)
self & operator+=(const T &val)
Add val to each element of the Matrix.
std::reverse_iterator< iterator2d_range > reverse_iterator2d_range
slip::lin_alg_traits< value_type >::value_type norm_type
reverse_row_iterator row_rend(const size_type row)
Returns a read/write reverse iterator that points one past the first element of the row row in the Ma...
This is some iterator to iterate a 2d container into a Box area defined by the indices of the 2d cont...
slip::stride_iterator< pointer > row_range_iterator
MultivariatePolynomial< T, DIM > operator*(const MultivariatePolynomial< T, DIM > &P1, const MultivariatePolynomial< T, DIM > &P2)
pointwise multiplication of two MultivariatePolynomial
std::reverse_iterator< iterator > reverse_row_iterator
norm_type L1_norm() const
Returns the L1 norm ( ) of the elements of the Matrix.
HyperVolume< T > asin(const HyperVolume< T > &V)
Returns the sin value of each element of the HyperVolume.
Matrix< T > cos(const Matrix< T > &M)
iterator end()
Returns a read/write iterator that points one past the last element in the Array. Iteration is done i...
slip::lin_alg_traits< typename std::iterator_traits< RandomAccessIterator2d >::value_type >::value_type row_norm(RandomAccessIterator2d upper_left, RandomAccessIterator2d bottom_right)
Computes the row norm ( ) of a 2d range.
const_pointer const_iterator
Matrix< T > operator-(const T &val, const Matrix< T > &M1)
substraction of a scalar to each element of a Matrix
reverse_iterator rend()
Returns a read/write reverse iterator that points to one before the first element in the Matrix...
const Matrix< T > const_self
slip::Array2d< T >::iterator2d_range iterator2d_range
Provides some algorithms to computes eigenvalues and eigenvectors.
ptrdiff_t difference_type
void copy(_II first, _II last, _OI output_first)
Copy algorithm optimized for slip iterators.
Provides some macros which are used for using complex as real.
norm_type cond() const
Returns the condition number of the Matrix where k is the rank of the matrix.
bool is_valid() const
Returns true if the range is valid :
slip::Matrix< unsigned char > Matrix_uc
unsigned char alias
SubType start() const
Accessor of the start subscript of the Range.
MultivariatePolynomial< T, DIM > operator-(const MultivariatePolynomial< T, DIM > &P1, const MultivariatePolynomial< T, DIM > &P2)
pointwise substraction of two MultivariatePolynomial
slip::lin_alg_traits< typename std::iterator_traits< RandomAccessIterator2d >::value_type >::value_type frobenius_norm(RandomAccessIterator2d upper_left, RandomAccessIterator2d bottom_right)
Computes the Frobenius norm ( ) of a 2d range.
T & min(const Matrix< T > &M1)
T & min(const GrayscaleImage< T > &M1)
Returns the min element of a GrayscaleImage.
iterator end()
Returns a read/write iterator that points one past the last element in the Array2d. Iteration is done in ordinary element order.
HyperVolume< T > sqrt(const HyperVolume< T > &M)
std::reverse_iterator< col_iterator > reverse_col_iterator
HyperVolume< T > cos(const HyperVolume< T > &V)
Returns the cos value of each element of the HyperVolume.
HyperVolume< T > sinh(const HyperVolume< T > &M)
static const std::size_t DIM
T sum() const
Returns the sum of the elements of the Matrix.
slip::Array2d< T >::const_iterator2d const_iterator2d
MultivariatePolynomial< T, DIM > operator/(const MultivariatePolynomial< T, DIM > &P, const T &val)
division of a scalar to each element of a MultivariatePolynomial
This is some iterator to iterate a 2d container into a slip::Box2d area defined by the indices of the...
row_iterator row_end(const size_type row)
Returns a read/write iterator that points one past the end element of the row row in the Matrix...
std::reverse_iterator< const_col_range_iterator > const_reverse_col_range_iterator
Matrix< T > sin(const Matrix< T > &M)
reverse_iterator2d rupper_left()
Returns a read/write reverse iterator2d. It points to the bottom right element of the Matrix...
std::string name() const
Returns the name of the class.
T & min() const
Returns the min element of the Matrix according to the operator <, if the T is complex, it returns the element with the minimal magnitude.
std::reverse_iterator< const_iterator > const_reverse_iterator
HyperVolume< T > tanh(const HyperVolume< T > &V)
Returns the tanh value of each element of the HyperVolume.
HyperVolume< T > atan(const HyperVolume< T > &V)
Returns the atan value of each element of the HyperVolume.
Matrix1::value_type lu_det(const Matrix1 &M)
Computes the determinant of a matrix using LU decomposition.
slip::Matrix< char > Matrix_c
char alias
size_type rows() const
Returns the number of rows (first dimension size) in the Matrix.
col_iterator col_begin(const size_type col)
Returns a read/write iterator that points to the first element of the column column in the Matrix...
HyperVolume< T > log(const HyperVolume< T > &M)
HyperVolume< T > acos(const HyperVolume< T > &V)
Returns the acos value of each element of the HyperVolume.
Matrix< T > & apply(T(*fun)(T))
Applys the one-parameter C-function fun to each element of the Matrix.
void svd(const Matrix1 &M, Matrix2 &U, RandomAccessIterator S_first, RandomAccessIterator S_last, Matrix3 &V, const int max_it=75)
(thin) Singular Value Decomposition Given a matrix M, this function computes its singular value decom...
norm_type infinite_norm() const
Returns the infinite norm ( ) of the elements of the Matrix.
HyperVolume< T > cosh(const HyperVolume< T > &V)
Returns the cosh value of each element of the HyperVolume.
slip::Array2d< T >::iterator2d iterator2d
void fill(const T &value)
Fills the container range [begin(),begin()+size()) with copies of value.
Matrix< T > log(const Matrix< T > &M)
This is some iterator to iterate a 2d container into two Range defined by the indices and strides of ...
void resize(const size_type d1, const size_type d2, const T &val=T())
Resizes a Matrix.
HyperVolume< T > acos(const HyperVolume< T > &M)
norm_type spectral_radius() const
Returns the spectral radius of the Matrix ( )
Matrix< long double > asin(const Matrix< long double > &M)
std::reverse_iterator< const_iterator2d > const_reverse_iterator2d
Matrix< T > cosh(const Matrix< T > &M)
HyperVolume< T > log10(const HyperVolume< T > &M)
iterator end()
Returns a read/write iterator that points one past the last element in the Matrix. Iteration is done in ordinary element order.
HyperVolume< T > sqrt(const HyperVolume< T > &V)
Returns the sqrt value of each element of the HyperVolume.
size_type size() const
Returns the number of elements in the Array.
Provides some algorithms to apply C like functions to ranges.
Provides a class to modelize 2d points.
reverse_col_iterator col_rend(const size_type col)
Returns a read/write reverse iterator that points one past the first element of the column column in ...
Matrix< T > tanh(const Matrix< T > &M)
Provides a class to iterate a 1d range according to a step.
slip::lin_alg_traits< typename std::iterator_traits< RandomAccessIterator2d >::value_type >::value_type col_norm(RandomAccessIterator2d upper_left, RandomAccessIterator2d bottom_right)
Computes the column norm ( ) of a 2d range.
iterator begin()
Returns a read/write iterator that points to the first element in the Array2d. Iteration is done in o...
size_type dim2() const
Returns the number of columns (second dimension size) in the Matrix.
HyperVolume< T > tan(const HyperVolume< T > &M)
bool operator>(const slip::Matrix< T > &x, const slip::Matrix< T > &y)
bool operator==(const Array< T > &x, const Array< T > &y)
HyperVolume< T > asin(const HyperVolume< T > &M)
This is a linear (one-dimensional) dynamic template container. This container statisfies the RandomAc...
Matrix< long double > acos(const Matrix< long double > &M)
Matrix< T > log10(const Matrix< T > &M)
HyperVolume< T > log(const HyperVolume< T > &V)
Returns the log value of each element of the HyperVolume.
reverse_iterator2d rbottom_right()
Returns a read/write reverse iterator2d. It points to past the upper left element of the Matrix...
Matrix< T > exp(const Matrix< T > &M)
const_pointer const_row_iterator
row_iterator row_begin(const size_type row)
Returns a read/write iterator that points to the first element of the row row in the Matrix...
MultivariatePolynomial< T, DIM > operator+(const MultivariatePolynomial< T, DIM > &P1, const MultivariatePolynomial< T, DIM > &P2)
pointwise addition of two MultivariatePolynomial
Color< T > operator*(const Color< T > &V1, const Color< T > &V2)
Provides some Singular Value Decomposition (SVD) algorithms.
std::reverse_iterator< const_iterator2d_range > const_reverse_iterator2d_range
Provides a class to manipulate Ranges.
Provides a class to manipulate iterator2d within a slip::Range. It is used to iterate throw 2d contai...
Matrix< typename slip::lin_alg_traits< T >::value_type > abs(const Matrix< T > &M)
void apply(InputIterator first, InputIterator last, OutputIterator result, typename std::iterator_traits< OutputIterator >::value_type(*function)(typename std::iterator_traits< InputIterator >::value_type))
Applies a C-function to each element of a range.
This is a two-dimensional dynamic and generic container. This container statisfies the Bidirectionnal...
T & max(const GrayscaleImage< T > &M1)
Returns the max element of a GrayscaleImage.
SubType stop() const
Accessor of the stop subscript of the Range.
Color< T > operator/(const Color< T > &V1, const Color< T > &V2)
bool operator>=(const Array< T > &x, const Array< T > &y)
const_iterator2d const_default_iterator
norm_type L2_norm() const
Returns the L2 norm ( ) of the elements of the Matrix.
Color< T > operator-(const Color< T > &V1, const Color< T > &V2)
slip::Matrix< unsigned short > Matrix_us
unsigned long alias
HyperVolume< T > exp(const HyperVolume< T > &V)
Returns the exp value of each element of the HyperVolume.
T & max() const
Returns the max element of the Matrix according to the operator >, , if the T is complex, it returns the element with the maximal magnitude.
Provides some algorithms to compute norms.