Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000261OCamlOCaml generalpublic2001-01-16 17:002001-01-23 10:50
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000261: Feature wish for bigarrays
DescriptionHello,

since I am currently interfacing LAPACK with bigarrays, I ran into a
problem that could be easily fixed by adding a new function to "Array2":

Linear least-squares problems (or equations) usually look like this:

  A * x = b

where A is a matrix and x and b are vectors. LAPACK, however, generalizes
this to:

  A * X = B

where all variables stand for matrices. This allows one to handle several
right hand side vectors (b) and solution vectors (x) in one call.

This is a bit annoying when somebody really wants to use one vector
(Array1.t) only: he'd have to copy it into a matrix (Array2.t) for this,
which may require a significant amount of time.

It would be great if there were some kind of inverse function for
"slice_right", which makes an Array2.t out of an Array1.t without copying.
(For completeness, you might want to add a similar inverse function for
"slice_left" for C-layout, which operates on rows instead of columns,
of course).

Best regards,
Markus Mottl

--
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl [^]

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000485)
administrator (administrator)
2001-01-23 09:52

> It would be great if there were some kind of inverse function for
> "slice_right", which makes an Array2.t out of an Array1.t without copying.
> (For completeness, you might want to add a similar inverse function for
> "slice_left" for C-layout, which operates on rows instead of columns,
> of course).

Other users have expressed similar needs (e.g. "flattening" an Array2
into an Array1), so I've added a general "reshape" feature to the
Bigarray module. Basically, it lets you view a big array with a new
number of dimensions and new dimensions, the only constraint being
that the new view has the same number of elements as the original
array. So, in your example, you could "reshape" an 1d array of
dimension N into a 2d array of dimensions (N, 1) or (1, N), depending
on the desired layout.

Best regards,

- Xavier Leroy

(0000486)
administrator (administrator)
2001-01-23 10:50

The new Bigarray.reshape function answers this need. XL, 2001-01-23

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker