Package libai.common.matrix
Class Column
- java.lang.Object
-
- libai.common.matrix.Matrix
-
- libai.common.matrix.Column
-
- All Implemented Interfaces:
java.io.Serializable
public class Column extends Matrix
Column class- See Also:
Row
,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 row.static Column
random(int r)
New random column.static Column
random(int r, boolean signed)
New random column.static Column
random(int r, boolean signed, java.util.Random rand)
New random column.void
set(int i, double val)
Sets the value for a given row.Row
transpose()
Return the transpose of this matrix.void
transpose(Row 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
-
Column
public Column(int r)
Creates a new column- Parameters:
r
- number of rows
-
Column
public Column(double[] data)
Creates a new column- Parameters:
data
- column array
-
Column
public Column(Column copy)
Copy constructor.- Parameters:
copy
- Column to copy
-
-
Method Detail
-
get
public double get(int i)
Retrieves the value of a given row.- Parameters:
i
- row number- Returns:
- value
- Since:
- 1.2.0-RIDDLER
-
set
public void set(int i, double val)
Sets the value for a given row.- Parameters:
i
- row numberval
- value- Since:
- 1.2.0-RIDDLER
-
random
public static Column random(int r)
New random column.- Parameters:
r
- number of rows- Returns:
- new Random
Column
-
random
public static Column random(int r, boolean signed)
New random column.- Parameters:
r
- number of rowssigned
-false
if all the numbers should be positive,false
otherwise- Returns:
- new Random
Column
-
random
public static Column random(int r, boolean signed, java.util.Random rand)
New random column.- Parameters:
r
- number of rowssigned
-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 Row transpose()
Description copied from class:Matrix
Return the transpose of this matrix.
-
transpose
public void transpose(Row result)
-
-