[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Design of N-D arrays
From: |
Petter Risholm |
Subject: |
Design of N-D arrays |
Date: |
Wed, 6 Aug 2003 16:31:29 +0200 (MEST) |
Hi,
Files in ./src/OPERATORS/op-* define different assign conversions. For
instance in op-s-s.cc where an assignment with a scalar on both the left
hand side and right hand side is defined to result in a matrix. The
resulting matrix is mutated back to a scalar if it is a 1x1 matrix.
By using and expanding this design to work for N-D arrays, we will need to
make all assignments result in a N-D array and then mutate it back to a
scalar or matrix if the result should turn out to be of 1 or 2 dimensions.
A drawback with this design is the overhead created by all the
conversions, and the fact that N-D arrays need to implement code to do
assignments for both scalars and matrices in addition to higher
dimensions.
It might be possible to change some of the macros to see how many
indices/dimensions lhs and rhs have and thereby possibly avoid the
conversions.
Comments are appreciated!
regards
Petter Risholm
- Design of N-D arrays,
Petter Risholm <=