com.kuka.math.geometry
Class MatrixBuilder

java.lang.Object
  extended by com.kuka.math.geometry.MatrixBuilder

public class MatrixBuilder
extends Object

A mutable builder class for matrices. To construct a matrix call the toMatrix() method.


Constructor Summary
MatrixBuilder()
          Creates a new instance of a MatrixBuilder, with all elements initialized to zero.
MatrixBuilder(Matrix initial)
          Creates a new instance of a MatrixBuilder, with the elements initialized to the elements of the given matrix.
 
Method Summary
 void set(int row, int col, double value)
          Sets the matrix element at the specified position to the given value.
 void setColumn(int colIndex, Vector3D colValues)
          Sets the matrix elements in the column of the given index to the values in the given vector.
 void setElement00(double value)
          Sets a specific matrix element to the given value.
 void setElement01(double value)
          Sets a specific matrix element to the given value.
 void setElement02(double value)
          Sets a specific matrix element to the given value.
 void setElement10(double value)
          Sets a specific matrix element to the given value.
 void setElement11(double value)
          Sets a specific matrix element to the given value.
 void setElement12(double value)
          Sets a specific matrix element to the given value.
 void setElement20(double value)
          Sets a specific matrix element to the given value.
 void setElement21(double value)
          Sets a specific matrix element to the given value.
 void setElement22(double value)
          Sets a specific matrix element to the given value.
 Matrix toMatrix()
          Returns a new Matrix instance from the values of this MatrixBuilder.
 String toString()
          Returns the textual representation of current value of the MatrixBuilder in the same way as Matrix.toString().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MatrixBuilder

public MatrixBuilder()
Creates a new instance of a MatrixBuilder, with all elements initialized to zero.


MatrixBuilder

public MatrixBuilder(Matrix initial)
Creates a new instance of a MatrixBuilder, with the elements initialized to the elements of the given matrix.

Parameters:
initial - initial value for the MatrixBuilder
Method Detail

setElement00

public void setElement00(double value)
Sets a specific matrix element to the given value.

Parameters:
value - the new value for the element

setElement10

public void setElement10(double value)
Sets a specific matrix element to the given value.

Parameters:
value - the new value for the element

setElement20

public void setElement20(double value)
Sets a specific matrix element to the given value.

Parameters:
value - the new value for the element

setElement01

public void setElement01(double value)
Sets a specific matrix element to the given value.

Parameters:
value - the new value for the element

setElement11

public void setElement11(double value)
Sets a specific matrix element to the given value.

Parameters:
value - the new value for the element

setElement21

public void setElement21(double value)
Sets a specific matrix element to the given value.

Parameters:
value - the new value for the element

setElement02

public void setElement02(double value)
Sets a specific matrix element to the given value.

Parameters:
value - the new value for the element

setElement12

public void setElement12(double value)
Sets a specific matrix element to the given value.

Parameters:
value - the new value for the element

setElement22

public void setElement22(double value)
Sets a specific matrix element to the given value.

Parameters:
value - the new value for the element

set

public void set(int row,
                int col,
                double value)
Sets the matrix element at the specified position to the given value.

Parameters:
row - The row of the position. Must be between 0 and 2.
col - The column of the position. Must be between 0 and 2.
value - the value to be set for the position
Throws:
IndexOutOfBoundsException - illegal index

setColumn

public void setColumn(int colIndex,
                      Vector3D colValues)
Sets the matrix elements in the column of the given index to the values in the given vector.

Parameters:
colIndex - The index of the column. Must be between 0 and 2.
colValues - The values to be set in the column.
Throws:
IndexOutOfBoundsException - illegal index

toMatrix

public Matrix toMatrix()
Returns a new Matrix instance from the values of this MatrixBuilder.

Returns:
the new Matrix

toString

public String toString()
Returns the textual representation of current value of the MatrixBuilder in the same way as Matrix.toString().

Overrides:
toString in class Object
Returns:
a textual representation of the current value as a 3x3 matrix


Copyright © 2019. All rights reserved.