_MatrixShaped

it.grypho.scala.leonardo.core._MatrixShaped
trait _MatrixShaped extends _Expression

Marker trait for a symbolic matrix node whose children are its cells in row-major order and whose rebuild preserves the rows × cols shape.

Lets core and scalar algorithms distribute a scalar function element-wise over a symbolic matrix argument (exp(A), sin(A), … over a matrix with free-variable cells) without importing the matrix package — they see only this marker and the generic children / rebuild. Narrower than _ElementWise on purpose: only the matrix literal opts in. The dense counterpart (_MatrixValue) is handled numerically and is not marked.

Attributes

Graph
Supertypes
trait _Expression
class Object
trait Matchable
class Any
Known subtypes
class _Matrix

Members list

Value members

Abstract methods

def cols: Int

Number of columns in the symbolic matrix.

Number of columns in the symbolic matrix.

Attributes

def rows: Int

Number of rows in the symbolic matrix.

Number of rows in the symbolic matrix.

Attributes

Inherited and Abstract methods

def children: List[_Expression]

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Attributes

Inherited from:
_Expression
def eval(env: Environment): Either[_Expression, _Value]

Reduces this expression in the given environment.

Reduces this expression in the given environment.

Value parameters

env

variable bindings and display precision

Attributes

Returns

Right(v) when all free variables resolved to concrete values; Left(e) when reduction is partial or impossible

Inherited from:
_Expression
def rebuild(newChildren: List[_Expression]): _Expression

Reconstructs the same node shape with replacement sub-expressions.

Reconstructs the same node shape with replacement sub-expressions.

Value parameters

newChildren

replacements in the same order and count as children

Attributes

Inherited from:
_Expression

Inherited fields

lazy val freeVars: Set[String]

Cached set of free variable names; O(1) after the first access.

Cached set of free variable names; O(1) after the first access.

Attributes

Inherited from:
_Expression