Float32Matrix class Null safety

Floating-point matrix that stores elements in Float32List.

Example

import 'package:calc/calc.dart';

void main() {
  final matrix = Matrixf.fromRows([
    [1.0, 2.0],
    [3.0, 4.0],
  ]);
}
Inheritance
Mixed in types

Constructors

Float32Matrix.filled(int width, int height, [double value = 0.0])
Constructs matrix with the given width and height.
factory
Float32Matrix.fromColumns(Iterable<List<double>> columns)
Constructs a matrix from columns. [...]
factory
Float32Matrix.fromColumnVector(Iterable<double> elements)
Constructs a matrix from a column vector.
factory
Float32Matrix.fromDiagonal(Iterable<double> diagonal)
Constructs a matrix from the diagonal value.
factory
Float32Matrix.fromRows(Iterable<List<double>> rows)
Constructs a matrix from rows. [...]
factory
Float32Matrix.fromRowVector(Iterable<double> elements)
Constructs a matrix from a row vector.
factory
Float32Matrix.withFloat32List(Float32List rows, {required int width})
Constructs a matrix that uses the given Float32List for storing rows.
factory

Properties

elements List<double>
Returns elements as a list.
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
height int
read-only, inherited
isScalar bool
Tells whether the tensor is a scalar.
read-only, inherited
isSquare bool
read-only, inherited
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, inherited
width int
read-only, inherited

Methods

ceil() Tensor<double>
Calculates x.ceil() for each element.
inherited
clamp(double lowerLimit, double upperLimit) Tensor<double>
Calculates x.clamp(lowerLimit, upperLimit) for each element.
inherited
cos() Tensor<double>
Calculates cos(x) for each element.
inherited
diagonalVector() Float32Vector
Gets diagonal vector.
inherited
div(Tensor<double> right, {bool noNan = false}) Tensor<double>
Calculates element-wise fraction. [...]
inherited
divScalar(num right, {bool noNan = false, bool swapArguments = false}) Tensor<double>
Calculates element-wise fraction. [...]
inherited
exp() Tensor<double>
Calculates exp(x) for each element. [...]
inherited
floor() Tensor<double>
Calculates x.floor() for each element.
inherited
getFlat(int index) double
@Deprecated('Use `elements`'), inherited
getXY(int x, int y) double
Gets matrix element.
inherited
log() Tensor<double>
Calculates log(x) for each element. [...]
inherited
matrixMul(Matrix<double> right) Float32Matrix
Computes matrix product.
override
max(Tensor<double> right) Tensor<double>
Calculates element-wise maximum. [...]
inherited
min(Tensor<double> right) Tensor<double>
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<double> right) Tensor<double>
Calculates element-wise power. [...]
inherited
scale(num s) Tensor
@Deprecated('Use `mulScalar`'), inherited
scaleInverse(num s) Tensor
@Deprecated('Use `divScalar`'), inherited
sin() Tensor<double>
Calculates sin(x) for each element.
inherited
sq() Tensor<double>
Calculates x * x (square) for each element. [...]
inherited
sqrt() Tensor<double>
Calculates sqrt(x) (square root) for each element. [...]
inherited
tan() Tensor<double>
Calculates tan(x) for each element.
inherited
toBuilder({bool copy = true}) Float32TensorBuilder
Constructs a TensorBuilder that has this tensor. [...]
override
toScalar() double
Returns a scalar when the tensor has only a single element; [...]
inherited
toString() String
A string representation of this object. [...]
override
transpose() Matrix<double>
Computes transpose.
inherited

Operators

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