User`s guide
4 Using MWArra y Classes
Factory Method Usage
newSparse(int[], int[],
Object, Object, MWClassID)
Complex sparse num eric ma trix of
specified typ e. Values are initialized
with supplied row, column, and data
arrays. Maximum nonzeros and
dimensions are computed from input
data.
newSparse(int, int, int,
MWClassID, MWComplexity)
Sparse numeri c matrix with specified
type, complexity, dimensions, and
maximum nonzeros. Values are
initialized to 0.
newSparse(Object, MWClassID)
Real sparse numeric matrix of
specified typ e. Values are initialized
from the supplied full matrix.
newSparse(Object, Object,
MWClassID)
Complex sparse num eric ma trix of
specified typ e. Values are initialized
from the supplied full matrix.
Data Arrangement in the Array. Each of th e static factory method s for
MWNumericArray returns a new MWNumericArray instance constructed from
theinputinformation. Themethodscanbeusedtoconstructandinitialize
an array with supplied data, or to construct an a rray of a specified size and
initialize all values to zero. The main d ifference is that (with exception of
the last two
newSparse methods) data is supplied to the factory methods in
one-dimensional a rrays with the data arranged in column-wise order.
The following e xample rewrites the previous one-dimensional array
constructor example:
double[] x1 = {1.0, 2.0, 3.0};
int[] x2 = {1, 2, 3};
Double[] x3 = {new Double(1.0),
new Double(2.0),
new Double(3.0)};
String[] x4 = {"1.0", "2.0", "3.0"};
int[] dims = {1, 3};
MWNumericArray a1 =
4-14