|
Ublas : |
Subject: Re: [ublas] norm_2_squared in a fast way
From: Michael Norel (minorlogic_at_[hidden])
Date: 2009-09-06 10:50:19
Thanks for replay.
So you suggest that "inner_prod" implementation is designaed in optimal way to calculate inner_prod of the same vector?
So norm_2(vec) is comparable to "sqrt(inner_prod(vec, vec)) "?
Thanks, ill try it in benchmarks.
--- On Sun, 9/6/09, Manoj Rajagopalan <rmanoj_at_[hidden]> wrote:
> From: Manoj Rajagopalan <rmanoj_at_[hidden]>
> Subject: Re: [ublas] norm_2_squared in a fast way
> To: "ublas mailing list" <ublas_at_[hidden]>
> Date: Sunday, September 6, 2009, 3:47 PM
>
> This is an O(1) operation and in a single processor this is
> the optimal way to
> calculate the result. You could try a custom implementation
> (with openMP
> directives or pthreads) to take advantage of multicores but
> your procedure
> would have to be invasive - you might have to rewrite (part
> of) the
> vector_inner_prod functor in functional.hpp
>
> -- Manoj
>
>
> On Sunday 06 September 2009 09:08:00 am Michael Norel
> wrote:
> > Hi All!
> >
> > Is there a way to calculate squared norm_2 faster than
> inner_prod(vec,
> > vec)? Or this is the optimal way?
> >
> > Thanks!
> >
> >
> >
> > _______________________________________________
> > ublas mailing list
> > ublas_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/ublas
> > Sent to: rmanoj_at_[hidden]
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: minorlogic_at_[hidden]
>