org.ejml.data
Class D1Matrix64F

java.lang.Object
  extended by org.ejml.data.Matrix64F
      extended by org.ejml.data.D1Matrix64F
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BlockMatrix64F, RowD1Matrix64F

public abstract class D1Matrix64F
extends Matrix64F

A generic abstract class for matrices whose data is stored in a single 1D array of doubles. The format of the elements in this array is not specified. For example row major, column major, and block row major are all common formats.

Author:
Peter Abeles
See Also:
Serialized Form

Field Summary
 double[] data
          Where the raw data for the matrix is stored.
 
Fields inherited from class org.ejml.data.Matrix64F
numCols, numRows
 
Constructor Summary
D1Matrix64F()
           
 
Method Summary
 double div(int index, double val)
           Divides the specified value to the internal data array at the specified index.

Equivalent to: this.data[index] /= val;
 double get(int index)
          Returns the value of the matrix at the specified internal array index.
 double[] getData()
          Used to get a reference to the internal data.
abstract  int getIndex(int row, int col)
          Returns the internal array index for the specified row and column.
 double minus(int index, double val)
           Subtracts the specified value to the internal data array at the specified index.

Equivalent to: this.data[index] -= val;
 double plus(int index, double val)
           Adds the specified value to the internal data array at the specified index.

Equivalent to: this.data[index] += val;
 void set(D1Matrix64F b)
          Sets the value of this matrix to be the same as the value of the provided matrix.
 double set(int index, double val)
          Sets the element's value at the specified index.
 void setData(double[] data)
          Changes the internal array reference.
 double times(int index, double val)
           Multiplies the specified value to the internal data array at the specified index.

Equivalent to: this.data[index] *= val;
 
Methods inherited from class org.ejml.data.Matrix64F
copy, get, getNumCols, getNumElements, getNumRows, iterator, print, reshape, reshape, set, set, unsafe_get, unsafe_set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

public double[] data
Where the raw data for the matrix is stored. The format is type dependent.

Constructor Detail

D1Matrix64F

public D1Matrix64F()
Method Detail

getData

public double[] getData()
Used to get a reference to the internal data.

Returns:
Reference to the matrix's data.

setData

public void setData(double[] data)
Changes the internal array reference.


getIndex

public abstract int getIndex(int row,
                             int col)
Returns the internal array index for the specified row and column.

Parameters:
row - Row index.
col - Column index.
Returns:
Internal array index.

set

public void set(D1Matrix64F b)
Sets the value of this matrix to be the same as the value of the provided matrix. Both matrices must have the same shape:

aij = bij

Parameters:
b - The matrix that this matrix is to be set equal to.

get

public double get(int index)
Returns the value of the matrix at the specified internal array index. The element at which row and column returned by this function depends upon the matrix's internal structure, e.g. row-major, column-major, or block.

Parameters:
index - Internal array index.
Returns:
Value at the specified index.

set

public double set(int index,
                  double val)
Sets the element's value at the specified index. The element at which row and column modified by this function depends upon the matrix's internal structure, e.g. row-major, column-major, or block.

Parameters:
index - Index of element that is to be set.
val - The new value of the index.

plus

public double plus(int index,
                   double val)

Adds the specified value to the internal data array at the specified index.

Equivalent to: this.data[index] += val;

Intended for use in highly optimized code. The row/column coordinate of the modified element is dependent upon the matrix's internal structure.

Parameters:
index - The index which is being modified.
val - The value that is being added.

minus

public double minus(int index,
                    double val)

Subtracts the specified value to the internal data array at the specified index.

Equivalent to: this.data[index] -= val;

Intended for use in highly optimized code. The row/column coordinate of the modified element is dependent upon the matrix's internal structure.

Parameters:
index - The index which is being modified.
val - The value that is being subtracted.

times

public double times(int index,
                    double val)

Multiplies the specified value to the internal data array at the specified index.

Equivalent to: this.data[index] *= val;

Intended for use in highly optimized code. The row/column coordinate of the modified element is dependent upon the matrix's internal structure.

Parameters:
index - The index which is being modified.
val - The value that is being multiplied.

div

public double div(int index,
                  double val)

Divides the specified value to the internal data array at the specified index.

Equivalent to: this.data[index] /= val;

Intended for use in highly optimized code. The row/column coordinate of the modified element is dependent upon the matrix's internal structure.

Parameters:
index - The index which is being modified.
val - The value that is being divided.


Copyright © 2012. All Rights Reserved.