Robot Core Documentation
Loading...
Searching...
No Matches
edu.wpi.first.math.Vector< R extends Num > Class Template Reference
Inheritance diagram for edu.wpi.first.math.Vector< R extends Num >:
edu.wpi.first.math.Matrix< R, N1 >

Public Member Functions

 Vector (Nat< R > rows)
 
 Vector (SimpleMatrix storage)
 
 Vector (Matrix< R, N1 > other)
 
double get (int row)
 
final Vector< R > plus (Vector< R > value)
 
final Vector< R > minus (Vector< R > value)
 
double dot (Vector< R > other)
 
double norm ()
 
Vector< R > unit ()
 
Vector< R > projection (Vector< R > other)
 
- Public Member Functions inherited from edu.wpi.first.math.Matrix< R, N1 >
 Matrix (Nat< R > rows, Nat< C > columns)
 
 Matrix (Nat< R > rows, Nat< C > columns, double[] storage)
 
 Matrix (SimpleMatrix storage)
 
 Matrix (Matrix< R, C > other)
 
SimpleMatrix getStorage ()
 
final int getNumCols ()
 
final int getNumRows ()
 
final double get (int row, int col)
 
final void set (int row, int col, double value)
 
final void setRow (int row, Matrix< N1, C > val)
 
final void setColumn (int column, Matrix< R, N1 > val)
 
void fill (double value)
 
final Matrix< R, C > diag ()
 
final double max ()
 
final double maxAbs ()
 
final double minInternal ()
 
final double mean ()
 
final< C2 extends Num > Matrix< R, C2 > times (Matrix< C, C2 > other)
 
Matrix< R, C > times (double value)
 
final Matrix< R, C > elementTimes (Matrix< R, C > other)
 
final Matrix< R, C > minus (double value)
 
final Matrix< R, C > minus (Matrix< R, C > value)
 
final Matrix< R, C > plus (double value)
 
final Matrix< R, C > plus (Matrix< R, C > value)
 
Matrix< R, C > div (int value)
 
Matrix< R, C > div (double value)
 
final Matrix< C, R > transpose ()
 
final Matrix< R, C > copy ()
 
final Matrix< R, C > inv ()
 
final< C2 extends Num > Matrix< C, C2 > solve (Matrix< R, C2 > b)
 
final< R2 extends Num, C2 extends Num > Matrix< C, C2 > solveFullPivHouseholderQr (Matrix< R2, C2 > other)
 
final Matrix< R, C > exp ()
 
final Matrix< R, C > pow (double exponent)
 
final double det ()
 
final double normF ()
 
final double normIndP1 ()
 
final double elementSum ()
 
final double trace ()
 
final Matrix< R, C > elementPower (double b)
 
final Matrix< R, C > elementPower (int b)
 
final Matrix< N1, C > extractRowVector (int row)
 
final Matrix< R, N1extractColumnVector (int column)
 
final< R2 extends Num, C2 extends Num > Matrix< R2, C2 > block (Nat< R2 > height, Nat< C2 > width, int startingRow, int startingCol)
 
final< R2 extends Num, C2 extends Num > Matrix< R2, C2 > block (int height, int width, int startingRow, int startingCol)
 
Matrix< R, C > lltDecompose (boolean lowerTriangular)
 
double[] getData ()
 
boolean isIdentical (Matrix<?, ?> other, double tolerance)
 
boolean isEqual (Matrix<?, ?> other, double tolerance)
 
void rankUpdate (Matrix< R, N1 > v, double sigma, boolean lowerTriangular)
 
boolean equals (Object other)
 

Static Public Member Functions

static Vector< N3cross (Vector< N3 > a, Vector< N3 > b)
 
- Static Public Member Functions inherited from edu.wpi.first.math.Matrix< R, N1 >
static< D extends Num > Matrix< D, D > eye (Nat< D > dim)
 
static< D extends Num > Matrix< D, D > eye (D dim)
 
static< R extends Num, C extends Num > MatBuilder< R, C > mat (Nat< R > rows, Nat< C > cols)
 
static< R1 extends Num, C1 extends Num > Matrix< R1, C1 > changeBoundsUnchecked (Matrix<?, ?> mat)
 

Additional Inherited Members

- Protected Attributes inherited from edu.wpi.first.math.Matrix< R, N1 >
final SimpleMatrix m_storage
 
- Package Functions inherited from edu.wpi.first.math.Matrix< R, N1 >

Detailed Description

A shape-safe wrapper over Efficient Java Matrix Library (EJML) matrices.

This class is intended to be used alongside the state space library.

Parameters
<R>The number of rows in this matrix.

Constructor & Destructor Documentation

◆ Vector() [1/3]

edu.wpi.first.math.Vector< R extends Num >.Vector ( Nat< R > rows)

Constructs an empty zero vector of the given dimensions.

Parameters
rowsThe number of rows of the vector.

◆ Vector() [2/3]

edu.wpi.first.math.Vector< R extends Num >.Vector ( SimpleMatrix storage)

Constructs a new Vector with the given storage. Caller should make sure that the provided generic bounds match the shape of the provided Vector.

NOTE:It is not recommended to use this constructor unless the SimpleMatrix API is absolutely necessary due to the desired function not being accessible through the Vector wrapper.

Parameters
storageThe SimpleMatrix to back this vector.

◆ Vector() [3/3]

edu.wpi.first.math.Vector< R extends Num >.Vector ( Matrix< R, N1 > other)

Constructs a new vector with the storage of the supplied matrix.

Parameters
otherThe Vector to copy the storage of.

Member Function Documentation

◆ cross()

static Vector< N3 > edu.wpi.first.math.Vector< R extends Num >.cross ( Vector< N3 > a,
Vector< N3 > b )
static

Returns the cross product of 3 dimensional vectors a and b.

Parameters
aThe vector to cross with b.
bThe vector to cross with a.
Returns
The cross product of a and b.

◆ dot()

double edu.wpi.first.math.Vector< R extends Num >.dot ( Vector< R > other)

Returns the dot product of this vector with another.

Parameters
otherThe other vector.
Returns
The dot product.

◆ get()

double edu.wpi.first.math.Vector< R extends Num >.get ( int row)

Returns an element of the vector at a specified row.

Parameters
rowThe row that the element is located at.
Returns
An element of the vector.

◆ minus()

final Vector< R > edu.wpi.first.math.Vector< R extends Num >.minus ( Vector< R > value)

Subtracts the given vector to this vector.

Parameters
valueThe vector to add.
Returns
The resultant vector.

◆ norm()

double edu.wpi.first.math.Vector< R extends Num >.norm ( )

Returns the norm of this vector.

Returns
The norm.

◆ plus()

final Vector< R > edu.wpi.first.math.Vector< R extends Num >.plus ( Vector< R > value)

Adds the given vector to this vector.

Parameters
valueThe vector to add.
Returns
The resultant vector.

◆ projection()

Vector< R > edu.wpi.first.math.Vector< R extends Num >.projection ( Vector< R > other)

Returns the projection of this vector along another.

Parameters
otherThe vector to project along.
Returns
The projection.

◆ unit()

Vector< R > edu.wpi.first.math.Vector< R extends Num >.unit ( )

Returns the unit vector parallel with this vector.

Returns
The unit vector.

The documentation for this class was generated from the following file: