From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16777 invoked by alias); 6 Jan 2010 11:45:07 -0000 Received: (qmail 16767 invoked by uid 22791); 6 Jan 2010 11:45:06 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_50 X-Spam-Check-By: sourceware.org Received: from filtteri5.pp.htv.fi (HELO filtteri5.pp.htv.fi) (213.243.153.188) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jan 2010 11:45:00 +0000 Received: from localhost (localhost [127.0.0.1]) by filtteri5.pp.htv.fi (Postfix) with ESMTP id 98D325A60D8; Wed, 6 Jan 2010 13:44:57 +0200 (EET) Received: from smtp5.welho.com ([213.243.153.39]) by localhost (filtteri5.pp.htv.fi [213.243.153.188]) (amavisd-new, port 10024) with ESMTP id 7l63VM3XbGt8; Wed, 6 Jan 2010 13:44:57 +0200 (EET) Received: from [10.0.0.133] (cs27089207.pp.htv.fi [89.27.89.207]) by smtp5.welho.com (Postfix) with ESMTP id 3912B5BC002; Wed, 6 Jan 2010 13:44:57 +0200 (EET) Message-ID: <4B4477B8.50305@iki.fi> Date: Wed, 06 Jan 2010 11:45:00 -0000 From: Tuomo Keskitalo User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Brian Gough CC: Gerard Jungman , GSL Discuss Mailing List Subject: Re: gsl container designs References: <1259110486.3028.69.camel@manticore.lanl.gov> In-Reply-To: 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: 2010-q1/txt/msg00001.txt.bz2 Hi, On 12/04/2009 08:36 PM, Brian Gough wrote: > At Tue, 24 Nov 2009 17:54:46 -0700, > Gerard Jungman wrote: >> Here are header files for a couple different approaches to containers. >> I didn't bother with any implementations; it seems obvious how to >> implement most of these functions. >> >> The designs are not complete, but they express most of >> the important stuff. > > Thanks for the document, I have studied the designs this week. It > seems that changing to design 1 / 1u / 2 would be trading one set of > problems for another. Looking at each case, the change doesn't seem > sufficient to justify the compatibility cost. Do you mean the compatibility to GSL 1 types by the compatibility cost? When talking about GSL 2 I don't think we should give too much value to maintaining backwards compatibility. GSL 1 is not going to cease to exist, and people who have tied themselves deeply to GSL 1 data structures can continue to use it. > 3) Non-levelised types. These seem to be the price for type safety. > In terms of the look/feel, expressions like &row.vector and > &column.vector don't seem too unnatural to me. Here is a crazy idea: If we take Gerards design 1, would it be too absurd to use a horrible big wrapper struct like typedef struct { gsl_marray *m; gsl_const_marray *cm; gsl_marray_1 *m1; gsl_const_marray_1 *cm1; gsl_marray_2 *m2; gsl_const_marray_2 *cm2; gsl_marray_3 *m3; gsl_const_marray_3 *cm3; gsl_vector *vec; gsl_const_vector *cvec; gsl_matrix *mat; gsl_const_matrix *cmat; ... } gsl_container; and make everything a gsl_container, and then always use them like &a.mat or &b.vec? Maybe the const types could be in another gsl_const_container struct.. One downside is that this would effectively mask the type of a or b in program code (gsl_container a; // is it a vector, matrix, or marray?), which might make reading code a pain.. -- Tuomo.Keskitalo@iki.fi http://iki.fi/tuomo.keskitalo