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 doubleget(int i)Retrieves the value of a given row.static Columnrandom(int r)New random column.static Columnrandom(int r, boolean signed)New random column.static Columnrandom(int r, boolean signed, java.util.Random rand)New random column.voidset(int i, double val)Sets the value for a given row.Rowtranspose()Return the transpose of this matrix.voidtranspose(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-falseif all the numbers should be positive,falseotherwise- 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-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 Row transpose()
Description copied from class:MatrixReturn the transpose of this matrix.
-
transpose
public void transpose(Row result)
-
-