From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32645 invoked by alias); 28 Sep 2009 15:48:01 -0000 Received: (qmail 32618 invoked by uid 22791); 28 Sep 2009 15:48:00 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp6.welho.com (HELO smtp6.welho.com) (213.243.153.40) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Sep 2009 15:47:54 +0000 Received: from [10.0.0.133] (cs181229105.pp.htv.fi [82.181.229.105]) by smtp6.welho.com (Postfix) with ESMTP id 02EA45BC060; Mon, 28 Sep 2009 18:47:51 +0300 (EEST) Message-ID: <4AC0DAA6.5030102@iki.fi> Date: Mon, 28 Sep 2009 15:48:00 -0000 From: Tuomo Keskitalo User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: James Bergstra CC: Gerard Jungman , GSL Discuss Mailing List Subject: Re: new double precision data structure? References: <48E25CA9.6080306@iki.fi> <49FB01D1.30000@iki.fi> <4A7ADFDC.9080408@iki.fi> <1251414774.23092.80.camel@manticore.lanl.gov> <1251414939.23092.82.camel@manticore.lanl.gov> <1253062179.23092.971.camel@manticore.lanl.gov> <4ABF1C3C.6070801@iki.fi> <7f1eaee30909270934v7ae7f4a6u6cbf9d16b099978b@mail.gmail.com> In-Reply-To: <7f1eaee30909270934v7ae7f4a6u6cbf9d16b099978b@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00069.txt.bz2 Hello, thanks, good comments! On 09/27/2009 07:34 PM, James Bergstra wrote: > Firstly, the ndarray untyped. The data is in a void * pointer or a > char * pointer or something, and there is an extra enum-valued field > that indicates what sort of elements make up the data. For example, 0 > might mean int8, 1 might mean uint8, 2 might mean int32, 10 might mean > float32, 11 float64, 12 complex64, and so on. There is support for This implies that GSL should support other elementary types than double. What do people think about this? I rather like the notion. Maybe we can't provide all GSL functionality to all those data types, but it would certainly be nice to have this option on the background, even if double precision would be the only one fully supported. > Secondly, there is no notion of a 'layout' in the ndarray, so I wonder > if it is necessary here? When you explicitly store the strides for > traversing the tensor in each dimension... what is left for the > 'layout' to specify? The fact whether e.g. matrix data is stored in row or column major format. For example, if m is 2*2 matrix stored in d, and if d[0] is the (1,1) cell in matrix, then d[1] might be (2,1) (=column rajor storage, I think) or (1,2) (=row major storage), depending on your programming language/library. > Thirdly, the dimensions are logical things, not physical ones. So > perhaps they belong in the view rather than the base block? I think > the simple { size_t n_allocated; char * buf } structure is sufficient > for the base block. I was thinking that the actual dimensions would be stored in the block, and the view would define an allowed subspace. For example, a view for a matrix could be a matrix or a vector. So, the geometry of block level would be frozen, and the views would provide alternative ways to access the data in it in different geometries. Is this too restrictive? > The biggest advantage of moving the dimensions from the base_block to > the view that it allows in-place reshaping and transposing of views, > which would be awkward otherwise. I did not get this, could you please give an example? If there is a problem, then dimensions can go to the view as you suggest. -- Tuomo.Keskitalo@iki.fi http://iki.fi/tuomo.keskitalo