maspack.matrix
Class Matrix3x6

java.lang.Object
  extended by maspack.matrix.MatrixBase
      extended by maspack.matrix.DenseMatrixBase
          extended by maspack.matrix.Matrix3x6
All Implemented Interfaces:
DenseMatrix, LinearTransformNd, Matrix
Direct Known Subclasses:
Matrix3x6Block

public class Matrix3x6
extends DenseMatrixBase

Implements a 3 x 6 matrix


Nested Class Summary
 
Nested classes/interfaces inherited from interface maspack.matrix.Matrix
Matrix.Partition, Matrix.WriteFormat
 
Field Summary
 double m00
           
 double m01
           
 double m02
           
 double m03
           
 double m04
           
 double m05
           
 double m10
           
 double m11
           
 double m12
           
 double m13
           
 double m14
           
 double m15
           
 double m20
           
 double m21
           
 double m22
           
 double m23
           
 double m24
           
 double m25
           
static Matrix3x6 ZERO
          Global zero matrix.
 
Fields inherited from interface maspack.matrix.Matrix
INDEFINITE, POSITIVE_DEFINITE, SPD, SYMMETRIC
 
Constructor Summary
Matrix3x6()
          Creates a new Matrix3x6.
 
Method Summary
 void add(Matrix M)
          Adds this matrix to M and places the result in this matrix.
 void add(Matrix3x6 M)
          Adds the contents of a Matrix3x6 to this matrix block.
 void add(Matrix3x6 M1, Matrix3x6 M2)
          Computes M1 + M2 and places the result in this matrix.
 void addSubMatrix00(Matrix3dBase M)
          Adds to 3x3 sub-matrix of this matrix starting at (0, 0).
 void addSubMatrix03(Matrix3dBase M)
          Adds to the 3x3 sub-matrix of this matrix starting at (0, 3).
 Matrix3x6 clone()
          Creates a clone of this matrix.
 int colSize()
          Number of columns in the matrix associated with this transformation.
 double get(int i, int j)
          Gets a single element of this matrix.
 void getColumn(int j, double[] values)
          Copies a column of this matrix into an array of doubles.
 void getColumn(int j, double[] values, int off)
          Copies a column of this matrix into an array of doubles, starting at a specified offset.
 void getColumn(int j, Vector3d col)
          Copies a column of this matrix into a 3-vector.
 void getRow(int i, double[] values)
          Copies a row of this matrix into an array of doubles.
 void getRow(int i, double[] values, int off)
          Copies a row of this matrix into an array of doubles, starting at a specified offset.
 void getSubMatrix00(Matrix3dBase M)
          Gets the 3x3 sub-matrix of this matrix starting at (0, 0).
 void getSubMatrix03(Matrix3dBase M)
          Gets the 3x3 sub-matrix of this matrix starting at (0, 3).
 int rowSize()
          Number of rows in the matrix associated with this transformation.
 void scale(double s)
          Scales the elements of this matrix by s.
 void scale(double s, Matrix3x6 M)
          Computes s M and places the result in this matrix.
 void scaledAdd(double s, Matrix M)
          Scales the matrix M and add the result to this matrix.
 void scaledAdd(double s, Matrix3x6 M)
          Computes s M and adds the result to this matrix.
 void scaledAdd(double s, Matrix3x6 M1, Matrix3x6 M2)
          Computes s M1 + M2 and places the result in this matrix.
 void set(int i, int j, double value)
          Sets a single element of this matrix.
 void set(Matrix M)
          Sets the size and values of this matrix to those of another matrix.
 void set(Matrix3x6 M)
          Sets the contents of this Matrix3x6 to those of a specified block.
 void setColumn(int j, double[] values)
          Sets a column of this matrix from an array of doubles.
 void setColumn(int j, Vector3d col)
          Sets a column of this matrix to the specified 3-vector.
 void setRow(int i, double[] values)
          Set a row of this matrix from an array of doubles.
 void setSubMatrix00(Matrix3dBase M)
          Sets the 3x3 sub-matrix of this matrix starting at (0, 0).
 void setSubMatrix03(Matrix3dBase M)
          Sets the 3x3 sub-matrix of this matrix starting at (0, 3).
 void setZero()
          Sets the elements of this matrix to zero.
 void sub(Matrix M)
          Subtracts this matrix from M and places the result in this matrix.
 void sub(Matrix3x6 M)
          Subtracts the contents of a Matrix3x6 from this matrix block.
 void sub(Matrix3x6 M1, Matrix3x6 M2)
          Computes M1 - M2 places the result in this matrix.
 
Methods inherited from class maspack.matrix.DenseMatrixBase
add, checkConsistency, set, set, set, set, setCCSValues, setColumn, setCRSValues, setRow, setSubMatrix
 
Methods inherited from class maspack.matrix.MatrixBase
containsNaN, determinant, epsilonEquals, equals, frobeniusNorm, get, get, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getDefaultFormat, getRow, getSize, getSubMatrix, hasNaN, idString, infinityNorm, isFixedSize, isSymmetric, mul, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, oneNorm, scan, setCRSValues, setDefaultFormat, setSize, toString, toString, toString, trace, write, write, write, write, write, writeToFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface maspack.matrix.Matrix
determinant, epsilonEquals, equals, frobeniusNorm, get, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getRow, getSize, getSubMatrix, infinityNorm, isFixedSize, isSymmetric, mul, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, oneNorm, scan, setSize, toString, trace, write, write, write
 

Field Detail

m00

public double m00

m01

public double m01

m02

public double m02

m03

public double m03

m04

public double m04

m05

public double m05

m10

public double m10

m11

public double m11

m12

public double m12

m13

public double m13

m14

public double m14

m15

public double m15

m20

public double m20

m21

public double m21

m22

public double m22

m23

public double m23

m24

public double m24

m25

public double m25

ZERO

public static final Matrix3x6 ZERO
Global zero matrix. Should not be modified.

Constructor Detail

Matrix3x6

public Matrix3x6()
Creates a new Matrix3x6.

Method Detail

rowSize

public int rowSize()
Number of rows in the matrix associated with this transformation. This will equal the size of the output vector in mul.

Specified by:
rowSize in interface LinearTransformNd
Specified by:
rowSize in interface Matrix
Specified by:
rowSize in class MatrixBase
Returns:
number of rows

colSize

public int colSize()
Number of columns in the matrix associated with this transformation. This will equal the size of the input vector in mul.

Specified by:
colSize in interface LinearTransformNd
Specified by:
colSize in interface Matrix
Specified by:
colSize in class MatrixBase
Returns:
number of columns

get

public double get(int i,
                  int j)
Gets a single element of this matrix.

Specified by:
get in interface Matrix
Specified by:
get in class MatrixBase
Parameters:
i - element row index
j - element column index
Returns:
element value

getColumn

public void getColumn(int j,
                      double[] values)
Copies a column of this matrix into an array of doubles.

Specified by:
getColumn in interface Matrix
Overrides:
getColumn in class MatrixBase
Parameters:
j - column index
values - array into which the column is copied

getColumn

public void getColumn(int j,
                      double[] values,
                      int off)
Copies a column of this matrix into an array of doubles, starting at a specified offset.

Specified by:
getColumn in interface Matrix
Overrides:
getColumn in class MatrixBase
Parameters:
j - column index
values - array into which the column is copied
off - offset in values where copying should begin

getColumn

public void getColumn(int j,
                      Vector3d col)
Copies a column of this matrix into a 3-vector.

Parameters:
j - column index
col - 3-vector into which the column is copied

getRow

public void getRow(int i,
                   double[] values)
Copies a row of this matrix into an array of doubles.

Specified by:
getRow in interface Matrix
Overrides:
getRow in class MatrixBase
Parameters:
i - row index
values - array into which the row is copied

getRow

public void getRow(int i,
                   double[] values,
                   int off)
Copies a row of this matrix into an array of doubles, starting at a specified offset.

Specified by:
getRow in interface Matrix
Overrides:
getRow in class MatrixBase
Parameters:
i - row index
values - array into which the row is copied
off - offset in values where copying should begin

set

public void set(int i,
                int j,
                double value)
Sets a single element of this matrix.

Specified by:
set in interface DenseMatrix
Specified by:
set in class DenseMatrixBase
Parameters:
i - element row index
j - element column index
value - element value

setRow

public void setRow(int i,
                   double[] values)
Set a row of this matrix from an array of doubles.

Specified by:
setRow in interface DenseMatrix
Overrides:
setRow in class DenseMatrixBase
Parameters:
i - row index
values - array from which the row is copied

setColumn

public void setColumn(int j,
                      double[] values)
Sets a column of this matrix from an array of doubles.

Specified by:
setColumn in interface DenseMatrix
Overrides:
setColumn in class DenseMatrixBase
Parameters:
j - column index
values - array from which column values are copied

setColumn

public void setColumn(int j,
                      Vector3d col)
Sets a column of this matrix to the specified 3-vector.

Parameters:
j - column index
col - 3-vector from which the column is copied

setZero

public void setZero()
Sets the elements of this matrix to zero.


set

public void set(Matrix M)
Description copied from class: DenseMatrixBase
Sets the size and values of this matrix to those of another matrix.

Specified by:
set in interface Matrix
Overrides:
set in class DenseMatrixBase
Parameters:
M - matrix whose size and values are copied

set

public void set(Matrix3x6 M)
Sets the contents of this Matrix3x6 to those of a specified block.

Parameters:
M - matrix block providing new values

scale

public void scale(double s)
Scales the elements of this matrix by s.

Parameters:
s - scaling factor

scale

public void scale(double s,
                  Matrix3x6 M)
Computes s M and places the result in this matrix.

Parameters:
s - scaling factor
M - matrix to scale

add

public void add(Matrix M)
Adds this matrix to M and places the result in this matrix.

Parameters:
M - right-hand matrix
Throws:
ImproperSizeException - if this matrix and M have different sizes

scaledAdd

public void scaledAdd(double s,
                      Matrix M)
Scales the matrix M and add the result to this matrix.

Parameters:
s - scaling factor
M - matrix to be scaled and added
Throws:
ImproperSizeException - if this matrix and M have different sizes

add

public void add(Matrix3x6 M)
Adds the contents of a Matrix3x6 to this matrix block.

Parameters:
M - matrix block to add

add

public void add(Matrix3x6 M1,
                Matrix3x6 M2)
Computes M1 + M2 and places the result in this matrix.

Parameters:
M1 - first matrix to add
M2 - second matrix to add

scaledAdd

public void scaledAdd(double s,
                      Matrix3x6 M)
Computes s M and adds the result to this matrix.

Parameters:
s - scaling factor
M - matrix to be scaled and added

scaledAdd

public void scaledAdd(double s,
                      Matrix3x6 M1,
                      Matrix3x6 M2)
Computes s M1 + M2 and places the result in this matrix.

Parameters:
s - scaling factor
M1 - matrix to be scaled
M2 - matrix to be added

sub

public void sub(Matrix M)
Subtracts this matrix from M and places the result in this matrix.

Parameters:
M - right-hand matrix
Throws:
ImproperSizeException - if this matrix and M have different sizes

sub

public void sub(Matrix3x6 M)
Subtracts the contents of a Matrix3x6 from this matrix block.

Parameters:
M - matrix block to subtract

sub

public void sub(Matrix3x6 M1,
                Matrix3x6 M2)
Computes M1 - M2 places the result in this matrix.

Parameters:
M1 - first matrix
M2 - matrix to subtract

getSubMatrix00

public void getSubMatrix00(Matrix3dBase M)
Gets the 3x3 sub-matrix of this matrix starting at (0, 0).

Parameters:
M - returns the sub matrix

getSubMatrix03

public void getSubMatrix03(Matrix3dBase M)
Gets the 3x3 sub-matrix of this matrix starting at (0, 3).

Parameters:
M - returns the sub matrix

setSubMatrix00

public void setSubMatrix00(Matrix3dBase M)
Sets the 3x3 sub-matrix of this matrix starting at (0, 0).

Parameters:
M - new sub matrix value

setSubMatrix03

public void setSubMatrix03(Matrix3dBase M)
Sets the 3x3 sub-matrix of this matrix starting at (0, 3).

Parameters:
M - new sub matrix value

addSubMatrix00

public void addSubMatrix00(Matrix3dBase M)
Adds to 3x3 sub-matrix of this matrix starting at (0, 0).

Parameters:
M - sub matrix to add

addSubMatrix03

public void addSubMatrix03(Matrix3dBase M)
Adds to the 3x3 sub-matrix of this matrix starting at (0, 3).

Parameters:
M - sub matrix to add

clone

public Matrix3x6 clone()
Creates a clone of this matrix.

Overrides:
clone in class java.lang.Object