smile.cas

package smile.cas

Computer algebra system. A computer algebra system (CAS) has the ability to manipulate mathematical expressions in a way similar to the traditional manual computations of mathematicians and scientists.

The symbolic manipulations supported include:

  • simplification to a smaller expression or some standard form, including automatic simplification with assumptions and simplification with constraints

  • substitution of symbols or numeric values for certain expressions

  • change of form of expressions: expanding products and powers, partial and full factorization, rewriting as partial fractions, constraint satisfaction, rewriting trigonometric functions as exponentials, transforming logic expressions, etc.

  • partial and total differentiation

  • matrix operations including products, inverses, etc.

Attributes

Members list

Type members

Classlikes

case class Abs(x: Scalar) extends Scalar

abs(x)

abs(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Add(x: Scalar, y: Scalar) extends Scalar

x + y

x + y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class AddMatrix(A: Matrix, B: Matrix) extends Matrix

A + B

A + B

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class AddVector(x: Vector, y: Vector) extends Vector

x + y

x + y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
case class ArcCos(x: Scalar) extends Scalar

acos(x)

acos(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class ArcCot(x: Scalar) extends Scalar

acot(x)

acot(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class ArcSin(x: Scalar) extends Scalar

asin(x)

asin(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class ArcTan(x: Scalar) extends Scalar

atan(x)

atan(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Ceil(x: Scalar) extends IntScalar

ceil(x)

ceil(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Const(symbol: String) extends Scalar

Constant value.

Constant value.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class ConstMatrix(symbol: String, size: (IntScalar, IntScalar)) extends Matrix

Constant matrix.

Constant matrix.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class ConstVector(symbol: String, size: IntScalar) extends Vector

Constant vector. Different from VectorVal that has concrete values, this is of constant yet abstract value.

Constant vector. Different from VectorVal that has concrete values, this is of constant yet abstract value.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Cos(x: Scalar) extends Scalar

cos(x)

cos(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Cot(x: Scalar) extends Scalar

cot(x)

cot(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class DiagonalMatrix(x: Scalar*) extends Matrix

Diagonal matrix

Diagonal matrix

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Div(x: Scalar, y: Scalar) extends Scalar

x / y

x / y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Exp(x: Scalar) extends Scalar

exp(x)

exp(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Floor(x: Scalar) extends IntScalar

floor(x)

floor(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class GradientVector(y: Var, x: VectorVar) extends Vector

The derivative of a scalar y with respect to a vector x.

The derivative of a scalar y with respect to a vector x.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
case class IdentityMatrix(size: (IntScalar, IntScalar)) extends Matrix

Identity matrix

Identity matrix

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class InnerProduct(x: Vector, y: Vector) extends Scalar

Inner product (x * y)

Inner product (x * y)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Int2Scalar(x: IntScalar) extends Scalar

Explicit conversion of int to float.

Explicit conversion of int to float.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class IntAdd(x: IntScalar, y: IntScalar) extends IntScalar

x + y

x + y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class IntConst(symbol: String) extends IntScalar

Integer constant value.

Integer constant value.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class IntDiv(x: IntScalar, y: IntScalar) extends IntScalar

x / y

x / y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class IntMul(x: IntScalar, y: IntScalar) extends IntScalar

x * y

x * y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class IntNeg(x: IntScalar) extends IntScalar

-x

-x

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class IntPower(x: IntScalar, y: IntScalar) extends IntScalar

x ** y

x ** y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
trait IntScalar extends Tensor

Scalar: rank-0 tensor.

Scalar: rank-0 tensor.

Attributes

Supertypes
trait Tensor
class Object
trait Matchable
class Any
Known subtypes
class Ceil
class Floor
class IntAdd
class IntConst
class IntDiv
class IntMul
class IntNeg
class IntPower
class IntSub
class IntVal
class IntVar
class Mod
class Round
Show all
case class IntSub(x: IntScalar, y: IntScalar) extends IntScalar

x - y

x - y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class IntVal(x: Int) extends IntScalar

Integer scalar value.

Integer scalar value.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class IntVar(symbol: String) extends IntScalar

Integer scalar variable

Integer scalar variable

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Log(x: Scalar) extends Scalar

log(x)

log(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
trait Matrix extends Tensor

Matrix: rank-2 tensor.

Matrix: rank-2 tensor.

Attributes

Supertypes
trait Tensor
class Object
trait Matchable
class Any
Known subtypes
case class MatrixInverse(A: Matrix) extends Matrix

inv(A)

inv(A)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class MatrixProduct(A: Matrix, B: Matrix) extends Matrix

Matrix multiplication (A * B)

Matrix multiplication (A * B)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class MatrixTranspose(A: Matrix) extends Matrix

A'

A'

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class MatrixVar(symbol: String, size: (IntScalar, IntScalar)) extends Matrix

Abstract matrix variable

Abstract matrix variable

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class MatrixVectorProduct(A: Matrix, x: Vector) extends Vector

Matrix vector multiplication (A * x)

Matrix vector multiplication (A * x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Mod(x: IntScalar, y: IntScalar) extends IntScalar

x % y

x % y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Mul(x: Scalar, y: Scalar) extends Scalar

x * y

x * y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Neg(x: Scalar) extends Scalar

-x

-x

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class NegMatrix(A: Matrix) extends Matrix

-A

-A

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class NegVector(x: Vector) extends Vector

-x

-x

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
case class OneMatrix(size: (IntScalar, IntScalar)) extends Matrix

Matrix of all 1's

Matrix of all 1's

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class OneVector(size: IntScalar) extends Vector

Vector of all 1's

Vector of all 1's

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
case class OuterProduct(x: Vector, y: Vector) extends Matrix

Outer product (x ** y)

Outer product (x ** y)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Power(x: Scalar, y: Scalar) extends Scalar

x ** y

x ** y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Round(x: Scalar) extends IntScalar

round(x)

round(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IntScalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class RowMatrix(x: Vector*) extends Matrix

Row-wise matrix

Row-wise matrix

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
trait Scalar extends Tensor

Scalar: rank-0 tensor.

Scalar: rank-0 tensor.

Attributes

Supertypes
trait Tensor
class Object
trait Matchable
class Any
Known subtypes
class Abs
class Add
class ArcCos
class ArcCot
class ArcSin
class ArcTan
class Const
class Cos
class Cot
class Div
class Exp
class InnerProduct
class Int2Scalar
class Log
class Mul
class Neg
class Power
class Sin
class Sub
class Tan
class Val
class Var
Show all
case class ScalarMatrixProduct(a: Scalar, A: Matrix) extends Matrix

a * A

a * A

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class ScalarVectorProduct(a: Scalar, x: Vector) extends Vector

a * x

a * x

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Sin(x: Scalar) extends Scalar

sin(x)

sin(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Sub(x: Scalar, y: Scalar) extends Scalar

x - y

x - y

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Tan(x: Scalar) extends Scalar

tan(x)

tan(x)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class TangentMatrix(y: MatrixVar, x: Var) extends Matrix

The derivative of a matrix y with respect to a scalar x.

The derivative of a matrix y with respect to a scalar x.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class TangentVector(y: VectorVar, x: Var) extends Vector

The derivative of a vector y with respect to a scalar x.

The derivative of a vector y with respect to a scalar x.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
trait Tensor

A tensor is an algebraic object that describes a (multilinear) relationship between sets of algebraic objects related to a vector space. Objects that tensors may map between include vectors (which are often, but not always, understood as arrows with length that point in a direction) and scalars (which are often familiar numbers such as the real numbers), and, recursively, even other tensors. Tensors are defined independent of any basis, although they are often referred to by their components in a basis related to a particular coordinate system.

A tensor is an algebraic object that describes a (multilinear) relationship between sets of algebraic objects related to a vector space. Objects that tensors may map between include vectors (which are often, but not always, understood as arrows with length that point in a direction) and scalars (which are often familiar numbers such as the real numbers), and, recursively, even other tensors. Tensors are defined independent of any basis, although they are often referred to by their components in a basis related to a particular coordinate system.

The shape of tensor (the number of dimensions and the size of each dimension) might be only partially known.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait IntScalar
class Ceil
class Floor
class IntAdd
class IntConst
class IntDiv
class IntMul
class IntNeg
class IntPower
class IntSub
class IntVal
class IntVar
class Mod
class Round
trait Matrix
class AddMatrix
class ConstMatrix
class MatrixVar
class NegMatrix
class OneMatrix
class OuterProduct
class RowMatrix
class ZeroMatrix
trait Scalar
class Abs
class Add
class ArcCos
class ArcCot
class ArcSin
class ArcTan
class Const
class Cos
class Cot
class Div
class Exp
class InnerProduct
class Int2Scalar
class Log
class Mul
class Neg
class Power
class Sin
class Sub
class Tan
class Val
class Var
trait Vector
class AddVector
class ConstVector
class NegVector
class OneVector
class Vars
class VectorVal
class VectorVar
class ZeroVector
Show all
case class Val(x: Double) extends Scalar

Scalar value.

Scalar value.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Var(symbol: String) extends Scalar

Scalar variable

Scalar variable

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Scalar
trait Tensor
class Object
trait Matchable
class Any
Show all
case class Vars(x: Scalar*) extends Vector

Vector variable

Vector variable

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
trait Vector extends Tensor

Vector: rank-1 tensor.

Vector: rank-1 tensor.

Attributes

Supertypes
trait Tensor
class Object
trait Matchable
class Any
Known subtypes
class AddVector
class ConstVector
class NegVector
class OneVector
class Vars
class VectorVal
class VectorVar
class ZeroVector
Show all
case class VectorVal(x: Array[Double]) extends Vector

Vector value.

Vector value.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
case class VectorVar(symbol: String, size: IntScalar) extends Vector

Abstract vector variable

Abstract vector variable

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all
case class ZeroMatrix(size: (IntScalar, IntScalar)) extends Matrix

Matrix of all 0's

Matrix of all 0's

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Matrix
trait Tensor
class Object
trait Matchable
class Any
Show all
case class ZeroVector(size: IntScalar) extends Vector

Vector of all 0's

Vector of all 0's

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Vector
trait Tensor
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def abs(x: Scalar): Scalar
def acos(x: Scalar): Scalar
def acot(x: Scalar): Scalar
def asin(x: Scalar): Scalar
def atan(x: Scalar): Scalar
def ceil(x: Scalar): IntScalar
def cos(x: Scalar): Scalar
def cosh(x: Scalar): Scalar
def cot(x: Scalar): Scalar
def exp(x: Scalar): Scalar
def log(x: Scalar): Scalar
def sin(x: Scalar): Scalar
def sinh(x: Scalar): Scalar
def sqrt(x: Scalar): Scalar
def tan(x: Scalar): Scalar
def tanh(x: Scalar): Scalar

Implicits

Implicits

implicit def pimpDouble(x: Double): Val
implicit def pimpInt(x: Int): IntVal
implicit def pimpString(x: String): Var