N-dimensional sparse arrays
- Downloads:
- Views:
- Rating:

The class ndSparse defined in this submission will give a lot of the functionality of N-dimensional sparse arrays for N possibly greater than 2. However, it should really be thought of as a way of starting with an ordinary MATLAB sparse matrix and reshaping it to have N dimensions. In other words, the sparse data must first be able to exist as an ordinary 2D MATLAB sparse matrix before being made N-dimensional. In fact, if the intended array has dimensions MxNxP...YxZ, then the class will store it internally as an ordinary 2D sparse array of dimensions (M*N*P*...*Y)xZ. This leads to certain performance limitations, but I still find that it has a reasonable range of use.
USAGE:
S=ndSparse(X) where X is an ordinary MATLAB sparse matrix converts X into an ndSparse object. S can be reshaped into an N-dimensional sparse array using its RESHAPE method, for arbitrary N.
S=ndSparse(X,[M,N,P,...]) is equivalent to reshape(ndSparse(X),[M,N,P,...]).
The class also has a variety of static methods that can be used to construct instances of the class. For example,
S=ndSparse.build(Coordinates,Values,[m,n,p,...],nzmax)
lets you generate an N-dimensional sparse array from a table of explicit entries. This is a generalization to N dimensions of S=sparse(i,j,s,m,n,nzmax).
Other such methods include:
ndSparse.accumarray
ndSparse.sprand
ndSparse.sprandn
ndSparse.spalloc
EXAMPLES:
>> A=ndSparse.build( [1 1 1; 2 1 1;2 2 2] , [50,60 70]) %Builds a 2x2x2 sparse array from table
A(:,:,1) =
(1,1) 50
(2,1) 60
A(:,:,2) =
(2,2) 70
Many of the same manipulations common to ordinary multidimensional MATLAB full arrays can be performed on the sparse 3D array A generated above. It can be permuted, summed, concatentated, and so forth e.g.,
>> B=sum( permute([A,A+10], [3,2,1]) ,2)
B(:,:,1) =
(1,1) 120
(2,1) 20
B(:,:,2) =
(1,1) 140
(2,1) 160
Other overloaded methods include BSXFUN, REPMAT, CIRCSHIFT, CONVN, FLIPDIMS, SQUEEZE, SHIFTDIM and many more. Type "methods ndSparse" for a full list and use "help ndSparse.methodname" to get details of usage.
When browsing the list of methods, note that certain common operations have different implementations, optimized for different situations. Specifically, SUM, ANY,ALL, MIN, MAX... have alternative implementations SUMML, ANYML, ALLML, MINML, MAXML which are optimized for "low-dimensional" ndSparse objects OBJ. Here, low-dimensional means that a normal N-column MATLAB sparse matrix won't consume too much memory on your platform for N=MAX(NUMEL(OBJ)./SIZE(OBJ)).
Another feature of the class is that bi-operand operations are allowed between ndSparse objects and MATLAB objects of any numeric type (single, uint16, etc...). This is not true of ordinary MATLAB sparse matrices, as of R2010b.
>> C=eye(2,'single')*B(:,:,2)
C =
(1,1) 140
(2,1) 160
>> whos A B C
Name Size Bytes Class Attributes
A 2x2x2 136 ndSparse
B 2x1x2 140 ndSparse
C 2x1 104 ndSparse
To convert back to an ordinary n-D full array, use the class' overloaded FULL method. To convert to a normal 2D sparse matrix, use the methods SPARSE or SPARSE2D. For example, SPARSE2D will convert an MxNxPx...xQ ndSparse array to the two dimensional (M*N*P*...)xQ sparse matrix in native MATLAB form.
Free download from Shareware Connection - The class ndSparse defined in this submission will give a lot of the functionality of N-dimensional sparse arrays for N possibly greater than 2
Version: 1.0 | Size: 20 KB | Platform: Matlab, Scripts
Released Date: 20-01-2013 | Rating: 0 | Title: N-dimensional sparse arrays
Author Url: http://www.mathworks.com
Program Info Url: http://www.mathworks.com
Download Url: http://www.mathworks.com/matlabcentral/fx_files/29832/13/ndSparse_G3_2011_11_18.zip
Split nD-array into equal sized cells - MAT2TILES is basically a wrapper for mat2cell but with a more convenient interface when you are simply trying to decompose an N-dimensional array into equal-sized chunks.
Absolute Orientation - Horn's method - ABSOR - a tool for solving the absolute orientation problem using Horn's
Regular Control Point Interpolation Matrix with Boundary Conditions - The main file interpMatrix.m in this package creates a sparse Toeplitz-like matrix representing a regularly-spaced interpolation operation between a set of control points
3D Rotation about Shifted Axis - Generates the roto-translation matrix for the rotation around an arbitrary line in 3D.
Zero-Based Indexable Arrays (OOP Exercise) - I created this class of zero-indexable arrays purely as a fun OOP exercise, in reaction to various Newsgroup threads inquiring about zero-indexable matrix types for MATLAB
MATLAB Support Package for Arduino (aka ArduinoIO Package)
SimpleTest
WordPress Auto Poster Plugin
Professional Simulink Audio Equalizer
PHP Print / Echo
Ends Smart Form
Output buffering, and how it can change your life
ScriptCase - PHP Code Generator
Advanced Istaller for Java
Wind Turbine Model
C to C++ Converter
C++ Compiler
Cumulative Mann-Kendall trend test
FORMfields - The PHP Framework
Affiliate Programs
Animation
Auctions
Audio Systems
Banner Rotation
Blog
Bulletin Boards & Forums
Business & Enterprise
Buttons
Calendars & Events
Charts & Graphs
Chat
Classified Ad Managers
Communication
Lotus N Convert
Names N Convert
Avi N Converter
Font Msn N Cool
Msn Chat N Cool
N-dimensional Hypercubes - N-dimensional Hypercubes was developed as a small and simple tool that will help users learn more about will n-dimensional hypercube graphs.
Separable N-Dimensional Convolution - This function is an implementation of N-dimensional convolution for the special case when the convolution kernel is separable.
Snifflib - Snifflib is a Java based numerical library designed to provide honest-to-goodness N-dimensional array construction and manipulation along with standard linear algebra functionality as well as statistics and computational routines in the Java language
Easy memory-mapped arrays for large datasets - Code to generate n-dimensional memory-mapped arrays for efficiently accessing large array datasets
FFT2 optimization - Many image processing applications require an extensive usage of FFT2 routine (or, in the most general case, a N-dimensional FFT) of matrices having the same dimensions
Shareware Connection periodically updates pricing and software information of 'N-dimensional sparse arrays' from company source 'Matt J' , so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using 'N-dimensional sparse arrays' crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of N-dimensional sparse arrays.
TuckAway Intelligent Email Organizer Pro - Using an email software allow you to do a number of things including managing your address lists, emails and even ending memos, documents and even virtual letters. You can also use it to manage your tasks easily. The email software comes in ...
DataLocker SkyCrypt - Storing data in external hard drive is what any PC user can resort to but Cloud storage is gaining popularity with time. It gives you more flexibility and you can avail free and cheaply priced data storage in cloud as well. The only aspect that ...
LogmeOnce Password Manager Ultimate - Irrespective of your computer and web usage needs it is quite imperative that you will deal with passwords, in fact plenty of them. Both home and corporate network users need to log in to several web services and sites and for each of them, user ...
Auslogics BitReplica - With storage capacity and options going up with time, PC users have got numerous options to back up their important data, whether you need to store your music, movie collection or other types of data safely, using the PC’s HDD may not be ...
Magic Uneraser - Data loss can occur owing to a number of reasons, both within and beyond your control. Whether you have lost data owing to careless of another user or a hard drive failure has occurred, it is important to retrieve the data at any cost. There are ...
Protector Plus 2014 (32-bit) - Without using suitable security software in PC, you cannot have peace of mind nowadays. Increasing instances of malware attacks and attacking exploits have prompted average PC users to resort to using antivirus and security suites for both home ...
SyncMate - Just like windows users, Macintosh users also need to sync their data with myriads of other devices and other Macs. It is possible to use Apple’s much touted iCloud to sync a Mac with other iOS based devices but that may not fit ...
Perfect Photo Suite Premium Edition - For comprehensive image editing and web designing, millions of professionals use Adobe’s powerhouse and industry leading app, namely Photoshop. While Photoshop continues to be the darling of millions for advanced image retouching and ...
Cubase Artist - Professional audio editors and artists dealing in MIDI composition have a soft corner for Steinberg Cubase Artist. Its origin can be traced back to Atari ST and in later years, the app made way into PCs and Macs. The latest version is a flexible ...
Norton Zone - With a lot of your data being stored in some cloud service or other, it becomes necessary after a point to zero in on any one service rather than using many at the same time. As it is, major software companies are resorting to cloud based service ...