Subject: Re: [ublas] whole ublas matrix as vector
From: Michael Norel (minorlogic_at_[hidden])
Date: 2009-09-07 09:35:20
i tried to use "norm_inf" for matrices but i get unexpected result
Matrix m(2, 3);
for (SizeType i = 0; i < m.size1 (); ++ i)
for (SizeType j = 0; j < m.size2 (); ++ j)
v (i * m.size2() + j) = m (i, j) = -(Real)(3 * i + j);
std::cout << m << std::endl;
std::cout << v << std::endl;
std::cout << norm_inf(m) << std::endl;
std::cout << norm_inf(v) << std::endl;
Is it expected result? what is math meaning of norm_inf(m) ?
--- On Sun, 9/6/09, Gunter Winkler <guwi17_at_[hidden]> wrote:
> From: Gunter Winkler <guwi17_at_[hidden]>
> Subject: Re: [ublas] whole ublas matrix as vector
> To: "ublas mailing list" <ublas_at_[hidden]>
> Date: Sunday, September 6, 2009, 9:11 PM
> Michael Norel schrieb:
> > Hi all!
> > I still need this functionality (matrix expression as
> vector expression)for intensive use of ublas.
> Please check out the latest development version from SVN:
> and have a look at
> experimental/sparse_view.hpp, class c_array_view. This
> class should
> fulfill the immutable part of storage array concept. Now
> only a class
> fulfilling the immutable part of the vector concept must be
> which can be used to present any storage array as a read
> only vector.
> > I need to
> > 1. compare 2 matrixes with some eplison threshold like
> "norm_2(m1-m2) < eps"
> Why not using norm_inf or norm_1 for matrices?
> > 2. check if the submatrix of matrix is zero like
> "norm_2(m1) > 0"
> I'd also suggest to use norm_inf or even better a customer
> function that
> aborts the check at the first non-zero element.
> > 3. find the absolute maximum element of matrix like
> > and many others, where m1 and m2 is matrix
> Could you prepare a list of the most used matrix functions?
> Maybe there
> are others interested. Then we could easily add a
> matrix-tools header
> which contains such methods.
> There is a trac for boost: https://svn.boost.org/trac/boost/
> Here you can view, comment and create new tickets. Feel
> free to create a
> feature request for uBLAS. Try to add an example or
> pseudo-code to
> express the expected usage.
> > Where can a i post the functionality request for such
> adaptor? Or it is realy the right way to implement it
> The quickest way is always do it on yourself and to post
> the patch, an
> example and a unittest here. Then I can review the code and
> commit it to
> the repository.
> ublas mailing list
> Sent to: minorlogic_at_[hidden]