Packages

class HMatrix2[T] extends Error

The HMatrix2 class is a simple implementation of a 2-dimensional hypermatrix. The first dimension must be fixed and known, while the second dimension may be dynamically allocated by the user. The second dimension may vary with the first dimension. Caveat: currently this is a very limited implementation of hypermatrices. -----------------------------------------------------------------------------

Linear Supertypes
Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HMatrix2
  2. Error
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HMatrix2(dim1: Int, dims2: Array[Int])(implicit arg0: ClassTag[T], arg1: Numeric[T])

    Construct a 2-dimensional hypermatrix, where the 2nd dimension varies only with the 1st dimension.

    Construct a 2-dimensional hypermatrix, where the 2nd dimension varies only with the 1st dimension.

    dim1

    size of the 1st dimension of the hypermatrix

    dims2

    array of sizes of the 2nd dimension of the hypermatrix

  2. new HMatrix2(dim1: Int, dim2: Int)(implicit arg0: ClassTag[T], arg1: Numeric[T])

    Construct a rectangular 2-dimensional hypermatrix, where the 2nd dimension is fixed as well.

    Construct a rectangular 2-dimensional hypermatrix, where the 2nd dimension is fixed as well.

    dim1

    size of the 1st dimension of the hypermatrix

    dim2

    size of the 2nd dimension of the hypermatrix

  3. new HMatrix2(dim1: Int)(implicit arg0: ClassTag[T], arg1: Numeric[T])

    dim1

    size of the 1st dimension of the hypermatrix

Value Members

  1. def +(b: HMatrix2[T]): HMatrix2[T]

    Add 'this' hypermatrix and hypermatrix 'b'.

    Add 'this' hypermatrix and hypermatrix 'b'.

    b

    the hypermatrix to add (requires 'leDimensions')

  2. def -(b: HMatrix2[T]): HMatrix2[T]

    From 'this' hypermatrix subtract hypermatrix 'b'.

    From 'this' hypermatrix subtract hypermatrix 'b'.

    b

    the hypermatrix to add (requires 'leDimensions')

  3. def alloc(dims2: Array[Int]): Unit

    Allocate all elements of the 2nd dimension of the hypermatrix, where the last dimension only with the first dimension.

    Allocate all elements of the 2nd dimension of the hypermatrix, where the last dimension only with the first dimension.

    dims2

    array of sizes of the 2nd dimension of the hypermatrix

  4. def alloc(i: Int, dim2: Int): Unit

    Allocate one element of the 2nd dimension of the hypermatrix for the specified 'i' index.

    Allocate one element of the 2nd dimension of the hypermatrix for the specified 'i' index.

    i

    1st dimension index of the hypermatrix

    dim2

    size of the array to be allocated in row i

  5. def apply(i: Int, j: Int): T

    Retrieve a single element of the hypermatrix.

    Retrieve a single element of the hypermatrix.

    i

    1st dimension index of the hypermatrix

    j

    2nd dimension index of the hypermatrix

  6. def clear(): Unit

    Clear (make null) all contents in the 2nd dimension of the hypermatrix.

  7. val dim1: Int
  8. def dim_2(i: Int): Int

    Return the size of the 2nd dimension for the given 'i'.

    Return the size of the 2nd dimension for the given 'i'.

    i

    1st dimension index of the hypermatrix

  9. final def flaw(method: String, message: String): Unit

    Show the flaw by printing the error message.

    Show the flaw by printing the error message.

    method

    the method where the error occurred

    message

    the error message

    Definition Classes
    Error
  10. def leDimensions(b: HMatrix2[T]): Boolean

    Check whether the dimensions of 'this' hypermatrix are less than or equal to 'le' those of the other hypermatrix 'b'.

    Check whether the dimensions of 'this' hypermatrix are less than or equal to 'le' those of the other hypermatrix 'b'.

    b

    the other matrix

  11. val nu: Numeric[T]

    Import Numeric evidence (gets nu val from superclass)

  12. def set(x: T): Unit

    Set all the hypermatrix element values to 'x'.

    Set all the hypermatrix element values to 'x'.

    x

    the value to set all elements to

  13. def setFormat(newFormat: String): Unit

    Set the format to the 'newFormat'.

    Set the format to the 'newFormat'.

    newFormat

    the new format string

  14. def toString(): String

    Convert 'this' hypermatrix to a string.

    Convert 'this' hypermatrix to a string.

    Definition Classes
    HMatrix2 → AnyRef → Any
  15. def update(i: Int, j: Int, v: T): Unit

    Update a single element of the hypermatrix to the given value.

    Update a single element of the hypermatrix to the given value.

    i

    1st dimension index of the hypermatrix

    j

    2nd dimension index of the hypermatrix

    v

    the value to be updated at the above position in the hypermatrix