NumOperators extension

on

Methods

abs() List<num>
Returns a new list consisting of the absolute value of the elements of this.
exp([num scalar = 1.0]) List<double>
Returns a new list with elements multiplied by scalar and exponentiated.
innerProd(List<num> other) num
Returns the scalar product of this and other.
match(List<num> other, {double precision = 1e-12}) bool
Returns true if the inequality (this(i) - other(i)).abs() <= precision holds for each index i.
plus(List<num> other) List<num>
Returns a new list consisting of the elements of this added to the elements of other.
pow(num scalar) List<num>
Returns a new list with elements raised to the power of scalar.
toListOfDouble() List<double>
Returns a new list containing the elements of this rounded to double.
toListOfInt() List<int>
Returns a new list containing the elements of this rounded to int.

Operators

operator *(num scalar) List<num>
Returns a new list containing the elements of this multiplied with scalar.
operator -(List<num> other) List<num>
Returns a new list consisting of the difference of the elements of this and other.
operator /(num scalar) List<double>
Returns a new list containing the elements of this divided by scalar.
operator <(List<num> other) bool
Returns true if the inequality < holds for each component.
operator <=(List<num> other) bool
Returns true if the inequality <= holds for each component.
operator >(List<num> other) bool
Returns true if the inequality > holds for each component.
operator >=(List<num> other) bool
Returns true if the inequality >= holds for each component.
operator unary-() List<num>
Unary operator: Returns a new list containing the elements of this multiplied by -1.
operator ~/(num scalar) List<int>
Returns a new list consisting of the elements of of this divided by scalar and truncated to obtain an integer.