Re: [eigen] matrix::linspace |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] matrix::linspace*From*: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>*Date*: Mon, 25 Jan 2010 18:31:53 +0100*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=SozBXeZA2MfQ6iaqMiOOMaQQidd3axYQ/Mk4ymUjaA0=; b=TWBCKOkBSKBflwnl56Ol2fBa+wS+3jKERq0zMHA4toxjGq+rP+PLohrwm2DvJTTWSi XlrpT3z3D4wmjkPM1XyeNy8xl3YrW1qCzV5HC6PAWg/tIjZLxPXrs49HS+I47vxcIftQ +WWVv1M6I7vHjzV7665DqwYsAldeP5OeFGpQs=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=JIHjoNkZk60dbYgOjcpXSnzpm3LEP/GunOlEDWQVARIQ/1vGRecg5BUnSS7YnNGSHx +bwYyvQE9KKLVxNWIYink4ha+LSA0oqA/KJSSUx0n04zhN/ix08VEtywNZ9YSwDhWnsI 6AEX6vZctfCKJuJoLIf3l5OuBx5KS/SBPRsHU=

Ok, I am done. I have the whole patch ready for review. Since I have no idea what else to do for reviewing larger commits, I am posting here. The main new functionality offered is DenseBase::setLinSpace(Scalar l,Scalar h,int s) which computes for each vector index a(i) = l + i*(h-l)/(s-1) Now to the changes this involves. a) I added a new packet op ei_plset(Scalar a). It creates packages [a, a+1, ..., a+packet_size]. The nice part as opposed to ei_pset(...) is that for all types (float, double, int) there is only a single argument and not a varying number of arguments. This also allows to offer a GenericPacketMath implementation where this operator acts as identity. b) I added new constraints for functors that are meant to be used with CwiseNullaryOp. They are now required to offer a vector indexing operator()(int). For minimal invasive modifications, I simply changed existing ones by defining operator()(int,int) as operator()(int,int = 0) - where it was appropriate. That was already partially done. c) As discussed, ei_linspace_op_impl has two specializations one for random access and one for sequential or linear access. The vectorized sequential versions are much faster than non-vectorized ones and the random access versions seem to perform equally fast and faster (at least not worse). d) I introduced a new proxy ojbect ei_unaligned_assign_impl. It performs a simple loop assignment when required and it does not inline. Preventing the inlining was crucial in order to allow MSVC to perform proper optimization of packet ops. Maybe this should be guarded by a pre-processor define and activated only for MSVC. If I am not wrong, this is all. Any comments, or am I good to synch? - Hauke

**Attachment:
linspace.patch**

**Follow-Ups**:**Re: [eigen] matrix::linspace***From:*Ricard Marxer Piñón

**Re: [eigen] matrix::linspace***From:*Benoit Jacob

**References**:**[eigen] matrix::linspace***From:*Hauke Heibel

**Re: [eigen] matrix::linspace***From:*Hauke Heibel

**Re: [eigen] matrix::linspace***From:*Benoit Jacob

**Re: [eigen] matrix::linspace***From:*Hauke Heibel

**Re: [eigen] matrix::linspace***From:*Benoit Jacob

**Re: [eigen] matrix::linspace***From:*Hauke Heibel

**Re: [eigen] matrix::linspace***From:*Benoit Jacob

**Re: [eigen] matrix::linspace***From:*Hauke Heibel

**Re: [eigen] matrix::linspace***From:*Hauke Heibel

**Re: [eigen] matrix::linspace***From:*Benoit Jacob

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] LeastSquares, Pseudo Inverse & Geometry** - Next by Date:
**[eigen] glibc's malloc (x86-64) 16 byte aligned?** - Previous by thread:
**Re: [eigen] matrix::linspace** - Next by thread:
**Re: [eigen] matrix::linspace**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |