public interface AtomicMatrix extends Matrix
Matrix
which wants to support atomic behavior.
All implementations must be thread safe such that each operation is atomic.
It is acceptable for several operations to be many read, but anytime a
modification operation takes place, there must be only one thread performing
a modification and no other threads reading data.Matrix.Type
Modifier and Type | Method and Description |
---|---|
double |
addAndGet(int row,
int col,
double delta)
Return the value stored at (
row , col ) plus delta ,
and then increment the specified cell by delta . |
double |
getAndAdd(int row,
int col,
double delta)
Return the value stored at (
row , col ), and add delta to the same index. |
columns, get, getColumn, getColumnVector, getRow, getRowVector, rows, set, setColumn, setColumn, setRow, setRow, toDenseArray
double getAndAdd(int row, int col, double delta)
row
, col
), and add delta
to the same index.row
- The row of the cell to return and modify.col
- The column of the cell to return and modify.delta
- The amount to change the specified cell.row
, col
) prior to
adding delta
.double addAndGet(int row, int col, double delta)
row
, col
) plus delta
,
and then increment the specified cell by delta
.row
- The row of the cell to modify and return.col
- The column of the cell to modify and return.delta
- The amount to change the specified cell.row
, col
) after
adding delta
.Copyright © 2012. All Rights Reserved.