Matrix<T> class Null safety

A matrix.

Implementations

Example

import 'package:calc/calc.dart';

void main() {
  final matrix = Float32Matrix.fromRows([
    [1.0, 2.0],
    [3.0, 4.0],
  ]);
}
Inheritance
Implementers

Constructors

Matrix(TensorShape tensorShape, List<T> _data)

Properties

elements List<T>
Returns elements as a list.
read-only, override
hashCode int
The hash code for this object. [...]
read-only, inherited
height int
read-only
isScalar bool
Tells whether the tensor is a scalar.
read-only, inherited
isSquare bool
read-only
isZero bool
Tells whether all elements are zero.
read-only, inherited
length int
Returns number of elements in the tensor.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
tensorShape TensorShape
Returns shape of the tensor.
final
width int
read-only

Methods

ceil() Tensor<T>
Calculates x.ceil() for each element.
inherited
clamp(T lowerLimit, T upperLimit) Tensor<T>
Calculates x.clamp(lowerLimit, upperLimit) for each element.
inherited
cos() Tensor<T>
Calculates cos(x) for each element.
inherited
diagonalVector() Float32Vector
Gets diagonal vector.
div(Tensor<T> right, {bool noNan = false}) Tensor<T>
Calculates element-wise fraction. [...]
inherited
divScalar(num right, {bool noNan = false, bool swapArguments = false}) Tensor<T>
Calculates element-wise fraction. [...]
inherited
exp() Tensor<T>
Calculates exp(x) for each element. [...]
inherited
floor() Tensor<T>
Calculates x.floor() for each element.
inherited
getFlat(int index) → T
@Deprecated('Use `elements`'), inherited
getXY(int x, int y) → T
Gets matrix element.
log() Tensor<T>
Calculates log(x) for each element. [...]
inherited
matrixMul(Matrix<T> right) Matrix<T>
Computes matrix product.
max(Tensor<T> right) Tensor<T>
Calculates element-wise maximum. [...]
inherited
min(Tensor<T> right) Tensor<T>
Calculates element-wise minimum. [...]
inherited
mulScalar(num s) Tensor
Multiplies tensor elements with a scalar. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
pow(Tensor<T> right) Tensor<T>
Calculates element-wise power. [...]
inherited
scale(num s) Tensor
@Deprecated('Use `mulScalar`'), inherited
scaleInverse(num s) Tensor
@Deprecated('Use `divScalar`'), inherited
sin() Tensor<T>
Calculates sin(x) for each element.
inherited
sq() Tensor<T>
Calculates x * x (square) for each element. [...]
inherited
sqrt() Tensor<T>
Calculates sqrt(x) (square root) for each element. [...]
inherited
tan() Tensor<T>
Calculates tan(x) for each element.
inherited
toBuilder({bool copy = true}) TensorBuilder<T>
Constructs a TensorBuilder that has this tensor. [...]
inherited
toScalar() → T
Returns a scalar when the tensor has only a single element; [...]
inherited
toString() String
A string representation of this object. [...]
inherited
transpose() Matrix<T>
Computes transpose.

Operators

operator *(Tensor<T> right) Matrix<T>
Calculates element-wise product. [...]
override
operator +(Tensor<T> right) Matrix<T>
Calculates element-wise sum. [...]
override
operator -(Tensor<T> right) Matrix<T>
Calculates element-wise difference. [...]
override
operator /(Tensor<T> right) Matrix<T>
A shorthand for div.
override
operator ==(Object other) bool
The equality operator. [...]
inherited
operator unary-() Tensor<T>
Calculates scale(-1.0). [...]
inherited