From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11910 invoked by alias); 16 Sep 2009 00:46:41 -0000 Received: (qmail 11901 invoked by uid 22791); 16 Sep 2009 00:46:41 -0000 X-SWARE-Spam-Status: No, hits=-10.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: sourceware.org Received: from proofpoint1.lanl.gov (HELO proofpoint1.lanl.gov) (204.121.3.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Sep 2009 00:46:37 +0000 Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by proofpoint1.lanl.gov (8.14.3/8.14.3) with ESMTP id n8G0kaPA001465 for ; Tue, 15 Sep 2009 18:46:36 -0600 Received: from alvie-mail.lanl.gov (alvie-mail.lanl.gov [128.165.4.110]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 04595165126 for ; Tue, 15 Sep 2009 18:46:36 -0600 (MDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by alvie-mail.lanl.gov (Postfix) with ESMTP id 02E717D009D for ; Tue, 15 Sep 2009 18:46:36 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at alvie-mail.lanl.gov Received: from [130.55.124.157] (manticore.lanl.gov [130.55.124.157]) by alvie-mail.lanl.gov (Postfix) with ESMTP id E85F77D009C for ; Tue, 15 Sep 2009 18:46:35 -0600 (MDT) Subject: Re: GSL 2.0 roadmap (one man's view) From: Gerard Jungman To: GSL Discuss Mailing List In-Reply-To: References: <48E25CA9.6080306@iki.fi> <490DE4BD.7070907@iki.fi> <497B00F6.2080400@iki.fi> <498727E5.6080407@iki.fi> <49AA9DB5.6030908@iki.fi> <49FB01D1.30000@iki.fi> <4A7ADFDC.9080408@iki.fi> <1251414774.23092.80.camel@manticore.lanl.gov> <1251414939.23092.82.camel@manticore.lanl.gov> Content-Type: text/plain Date: Wed, 16 Sep 2009 00:46:00 -0000 Message-Id: <1253062147.23092.970.camel@manticore.lanl.gov> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2009-09-15_11:2009-09-01,2009-09-15,2009-09-15 signatures=0 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/msg00047.txt.bz2 On Mon, 2009-09-07 at 16:06 +0100, Brian Gough wrote: > At Thu, 27 Aug 2009 17:15:39 -0600, > Gerard Jungman wrote: > > The important notion of slicing is (partially) implemented in GSL > > in terms of the "view" concept. One can construct submatrices as > > views of given matrices, change the stride of vector data by > > creating vector views, etc. But there are clear flaws in the > > design. The design does not express the obvious idea that > > a "view" is itself a "thing", simply because the view classes > > do not have an inheritance relationship to the main classes. > > I agree that the scheme is not as elegant as it could be in other > languages. The view types are forced by the nature of const in C -- > it's not possible to place the views and vectors/matrices on an equal > footing and preserve constness, unfortunately. If there is a way > round that, I'm not aware of it. > Originally a view was essentially a vector with another name, but > there was no barrier to writing expressions which discarded constness > without any complaint from the compiler. To prevent that in C, the > type had to be "wrapped" in a struct which is why one has to write > &view.vector or &view.matrix to access it. I really don't understand this. In my head, I can see a solution which has nothing to do with const-ness issues. I think it would just work. I could type it in and we could look at it. It definitely involves changing the way vector and matrix are done, but I don't think it would be a big hairy deal. On Mon, 2009-09-07 at 14:21 -0400, Robert G. Brown wrote: > > The biggest issue would/will probably be rationalizing the views of > vector and matrix so they are sufficiently portable and easy to e.g. > pass in and out of ODE solvers and everything else consistently. This is right to the point. It's exactly what I'm getting at. There is just something brain-damaged about the way it is done now. -- G. Jungman