Re: [Cbor] typed arrays for complex numbers

Carsten Bormann <cabo@tzi.org> Fri, 12 July 2019 00:23 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E2888120086 for <cbor@ietfa.amsl.com>; Thu, 11 Jul 2019 17:23:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.197
X-Spam-Level:
X-Spam-Status: No, score=-4.197 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hk45wa9cgUhd for <cbor@ietfa.amsl.com>; Thu, 11 Jul 2019 17:23:26 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 152FF12007A for <cbor@ietf.org>; Thu, 11 Jul 2019 17:23:26 -0700 (PDT)
Received: from [192.168.217.110] (p548DCE40.dip0.t-ipconnect.de [84.141.206.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 45lDDC6Drlzyh5; Fri, 12 Jul 2019 02:23:23 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <15400EA6-DA5F-499E-B9A5-B98E0A6887CB@arlut.utexas.edu>
Date: Fri, 12 Jul 2019 02:23:23 +0200
Cc: cbor@ietf.org
X-Mao-Original-Outgoing-Id: 584583801.480399-2297a0d453ac56443ddfadc7f4402199
Content-Transfer-Encoding: quoted-printable
Message-Id: <49F73FF9-1952-421E-9C0D-A9B2821FCEC7@tzi.org>
References: <15400EA6-DA5F-499E-B9A5-B98E0A6887CB@arlut.utexas.edu>
To: Gregory Allen <gallen@arlut.utexas.edu>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/Yol40sm2uGWRX4y3mhRWvOqx4S8>
Subject: Re: [Cbor] typed arrays for complex numbers
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 12 Jul 2019 00:23:28 -0000

On Jul 12, 2019, at 01:24, Gregory Allen <gallen@arlut.utexas.edu> wrote:
> 
> I could imaging a “complex” tag, that’s a modifier for a dataType, so that one could do:
> 
>    multi-dim([dim, complex(ta-float32le(bstr)) ])
> 
> However, that doesn’t scale well to having several different compound types such as those mentioned above.

Well, it requires a new tag for each of these compound types, but if these are indeed different types, then tags are cheap (as long as they don’t have to come out of the 1+1 space :-).

So if this helps, we could indeed define tags (for complex, quaternion, octonions, sedenions, RGB, RGBA) that extract groups of 2, 4, 8, 16, 3, 4 elements out of an array (tagged or classical CBOR).
(Well, RGB is a bit weird, because there are so many color spaces.  Maybe just have tags for three- and four-dimensional color spaces.)
Alternatively, supplying the group size separately maybe can do all of these at omce, but then cannot distinguish quaternions from RGBA or CMYK.

Grüße, Carsten