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 double
get(int i)
Retrieves the value of a given column.static Row
random(int c)
New random row.static Row
random(int c, boolean signed)
New random row.static Row
random(int c, boolean signed, java.util.Random rand)
New random row.void
set(int i, double val)
Sets the value for a given column.Column
transpose()
Return the transpose of this matrix.void
transpose(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
-false
if all the numbers should be positive,false
otherwise- 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
-false
if all the numbers should be positive,false
otherwiserand
- TheRandom
object used to fill the matrix, ifnull
it will fallback toThreadLocalRandom#current()
- Returns:
- new Random
Column
-
transpose
public Column transpose()
Description copied from class:Matrix
Return the transpose of this matrix.
-
transpose
public void transpose(Column result)
-
-