From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14880 invoked by alias); 5 Oct 2009 14:50:48 -0000 Received: (qmail 14870 invoked by uid 22791); 5 Oct 2009 14:50:47 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-yw0-f195.google.com (HELO mail-yw0-f195.google.com) (209.85.211.195) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Oct 2009 14:50:40 +0000 Received: by ywh33 with SMTP id 33so2487426ywh.25 for ; Mon, 05 Oct 2009 07:50:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.10.13 with SMTP id n13mr119910ani.88.1254754239230; Mon, 05 Oct 2009 07:50:39 -0700 (PDT) In-Reply-To: <1254708349.18519.4.camel@ForbiddenPlanet> References: <1254708349.18519.4.camel@ForbiddenPlanet> Date: Mon, 05 Oct 2009 14:50:00 -0000 Message-ID: <7f1eaee30910050750l738876b1p41e6bd8ae5aa6d16@mail.gmail.com> Subject: Re: containers tentative design summary From: James Bergstra To: Gerard Jungman Cc: gsl-discuss@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 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-q4/txt/msg00002.txt.bz2 Two comments: I'm a bit rusty with my C structs... but you would need two distinct static classes to have const and non-const data pointers for your view right? Also, it sounds like writing code that will work for a tensor of any rank (e.g. add two tensors together) might be either tedious or impossible. I recognize that part of the problem is the lack of templating and polymorphism, but it would at least be comforting to see just how bad the situation is via a use case or two in the design documentation. I (naively?) fear that to get good performance will require a whole library of functions for even the most basic of operations. gsl_marray_add_1_0( gsl_marray_1, double ); gsl_marray_add_1_1( gsl_marray_1, gsl_marray_1); gsl_marray_add_1_2( gsl_marray_1, gsl_marray_2); gsl_marray_add_2_2(... ) ... gsl_marray_sub_1_0( ... ) Maybe a system of macros could be designed to help here, but it sounds like it will never be as easy as writing a couple of for-loops. James On Sun, Oct 4, 2009 at 10:05 PM, Gerard Jungman wrote: > A summary of the tentative design for containers. Code will follow, > as soon as a few things are sorted out. (See previous post on > questions about block/vector/matrix). > > -- > G. Jungman > > -- http://www-etud.iro.umontreal.ca/~bergstrj