Package libai.common.matrix
Class Row
- java.lang.Object
-
- libai.common.matrix.Matrix
-
- libai.common.matrix.Row
-
- All Implemented Interfaces:
java.io.Serializable
public class Row extends Matrix
Row class- See Also:
Column,Matrix, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleget(int i)Retrieves the value of a given column.static Rowrandom(int c)New random row.static Rowrandom(int c, boolean signed)New random row.static Rowrandom(int c, boolean signed, java.util.Random rand)New random row.voidset(int i, double val)Sets the value for a given column.Columntranspose()Return the transpose of this matrix.voidtranspose(Column result)-
Methods inherited from class libai.common.matrix.Matrix
add, apply, applyInIdentity, copy, dotProduct, equals, fill, fill, fill, getCol, getColumns, getDefaultRandom, getRow, getRows, hashCode, increment, multiply, multiply, multiplyAndAdd, position, position, random, random, random, scale, setRow, setValue, solve, subtract, subtractAndCopy, swap, toString, toString, transpose
-
-
-
-
Constructor Detail
-
Row
public Row(int c)
Creates a new row- Parameters:
c- number of columns
-
Row
public Row(double[] data)
Creates a new row- Parameters:
data- row array
-
Row
public Row(Row copy)
Copy constructor.- Parameters:
copy- Row to copy
-
-
Method Detail
-
get
public double get(int i)
Retrieves the value of a given column.- Parameters:
i- column number- Returns:
- value
- Since:
- 1.2.0-RIDDLER
-
set
public void set(int i, double val)Sets the value for a given column.- Parameters:
i- column numberval- value- Since:
- 1.2.0-RIDDLER
-
random
public static Row random(int c)
New random row.- Parameters:
c- number of columns- Returns:
- new Random
Column
-
random
public static Row random(int c, boolean signed)
New random row.- Parameters:
c- number of columnssigned-falseif all the numbers should be positive,falseotherwise- Returns:
- new Random
Column
-
random
public static Row random(int c, boolean signed, java.util.Random rand)
New random row.- Parameters:
c- number of columnssigned-falseif all the numbers should be positive,falseotherwiserand- TheRandomobject used to fill the matrix, ifnullit will fallback toThreadLocalRandom#current()- Returns:
- new Random
Column
-
transpose
public Column transpose()
Description copied from class:MatrixReturn the transpose of this matrix.
-
transpose
public void transpose(Column result)
-
-