toggle menu
Cuttlefish Documentation
Cuttlefish
switch theme
search in API
Cuttlefish
/
com.roboctopi.cuttlefish.utils
/
Matrix
Matrix
open
class
Matrix
(
var
width
:
Int
,
var
height
:
Int
,
init
:
(
Int
)
->
Double
=
{ i -> 0.0}
)
Inheritors
SquareMatrix
Vector
Members
Constructors
Matrix
Link copied to clipboard
constructor
(
width
:
Int
,
height
:
Int
,
init
:
(
Int
)
->
Double
=
{ i -> 0.0}
)
Properties
height
Link copied to clipboard
var
height
:
Int
mat
Link copied to clipboard
var
mat
:
DoubleArray
width
Link copied to clipboard
var
width
:
Int
Functions
add
Link copied to clipboard
fun
add
(
input
:
Matrix
)
add
Scale
Row
Link copied to clipboard
fun
addScaleRow
(
src
:
Int
,
dst
:
Int
,
scale
:
Double
)
add
To
Item
Link copied to clipboard
fun
addToItem
(
x
:
Int
,
y
:
Int
,
value
:
Double
)
clone
Link copied to clipboard
fun
clone
(
)
:
Matrix
copy
Link copied to clipboard
fun
copy
(
out
:
Matrix
)
get
Item
Link copied to clipboard
fun
getItem
(
x
:
Int
,
y
:
Int
)
:
Double
mul
Link copied to clipboard
fun
mul
(
input
:
Matrix
,
out
:
Matrix
)
println
Link copied to clipboard
fun
println
(
)
run
For
Each
Link copied to clipboard
fun
runForEach
(
f
:
(
Int
,
Int
,
Double
)
->
Double
)
scale
Link copied to clipboard
fun
scale
(
scalar
:
Double
)
scale
Row
Link copied to clipboard
fun
scaleRow
(
row
:
Int
,
scale
:
Double
)
set
Link copied to clipboard
fun
set
(
value
:
DoubleArray
)
set
Item
Link copied to clipboard
fun
setItem
(
x
:
Int
,
y
:
Int
,
value
:
Double
)
subtract
Link copied to clipboard
fun
subtract
(
input
:
Matrix
)
swap
Rows
Link copied to clipboard
fun
swapRows
(
row1
:
Int
,
row2
:
Int
)