class ML: Constructors
// Construct h-by-w uninitialized matrix.
private ML(int h, int w)
{
this.h = h;
this.w = w;
values = new ml [h][w];
}
// Construct h-by-w matrix initialized with v.
public ML(int h, int w, ml v)
{
this(h,w);
for (int r=0; r<h; r++)
for (int c = 0; c < w; c++)
values[r][c] = v;
}
// Construct scalar matrix v.
public ML(ml v)
{
this(1,1);
values[0][0] = v;
}
Previous slide
Next slide
Back to first slide
View graphic version