Some symbolic math functions for lazy boys and girls


[Up] [Top]

Documentation for package ‘lazy.symbolic’ version 1.0.0.20250731

Help Pages

A B C D E F G I J K L M N P Q R S T U V W misc

-- A --

a2l Convert array to list
a2m Convert array to supermatrix
AnalyzeExpr Decompose an Expression into Additive Terms and Multiplicative Factors
analyze_3d_val analyze three dots and values argument
analyze_expr Decompose an Expression into Additive Terms and Multiplicative Factors
analyze_three_dots Analyze Three Dots and Return the Names and the Values
assign_at_expr assign new expr at path

-- B --

basis Standard Basis Vector
b_diag Makes a Block Diagonal Matrix from the Arguments

-- C --

cancel_double_expr Remove multiple consecutive t's or inv's from an expression
ceiling_n Return the Ceiling and Power of the Input using Radix (Base) of n
chkginv Check if the the second matrix is a generalized inverse of the first one, or vice versa.
compose_MatProd compose MatProd
cprod Cartesian product of many vectors and matrices

-- D --

decompose_additive Decompose an expresion into additive terms
decompose_MatProd Decompose Matrix Product
demomat Set up a matrix whose elements consist of row and col numbers.
Det Determinant of a Symbolic Matrix by Sweeping
DetL Determinant of a Symbolic Matrix by Laplace Expansion
Diag Diag(x) creats a diagonam matrix from its argument vector or matrix
diag_to_hp Convert diag(X) to I*X, the Hadamar product
distribute_t Ditstribute Transposition over Additive Terms
distribute_tr Distribute functions to each of the additive terms
dist_t Ditstribute Transposition over Multiplicative Factors
dist_t1 Ditstribute Transposition over Multiplicative Factors
drop_parens drop parens

-- E --

easy_parse Parsing text w/o writing text= and trailing [[1]]
Eval Evaluate Symbolic Matrix after Replacement
Expand Expand Expressions by Distributing a Multiplicative Factor
expand_expr expand for expr
expr2list Display the structure of input expression as recursive list

-- F --

FindFactors Find multiplicative factors in a term
FindFuncs Find Function Calls in an Expression
FindTerms Find additive terms in an expression
find_a_term Find a term separated by a multiplicative operator
find_factors Decompose a Term into Multiplicative Factors separated by ' *, /, %*%, %\@%'.
find_terms Decompose an Expression into Additive Terms separated by '+' or '-'
find_varfunc Find Variables and Functions in an Expression
FreeQ Returns TRUE if expression is free of varname
funcinfo Returns the body of a function

-- G --

gen_random_expr Generate Random Expression
getSM Extract a submatrix from a supermatrix
Ginv Generalized Inverse
gradma numeric value of the analytic first derivative of a function
gradmn numerical first derivative of a function
greeknum convert subscripted Greek characters
grep_expr grep for expr
groupmatch Return the captured value for each group
gsub_expr gsub for an expression

-- I --

insert_str Insert string between substr(expr,1,from-1) and substr(expr,to+1)
interleave Interleave the columns of Two Matrices
Inv Matrix Inversion
invGE Matrix Inversion by Gaussian Elimination
is.number Check if a string vector contains numbers only.
is.varname Check if the argument is a valid variable name
is_solo Check if the input is a single object
is_valid Check If the Input Expression is Valid

-- J --

JacobianMat Calculation of Jacobian Matrix

-- K --

Kmat Commutation Matrix
KP Symbolic Expression of the i-j element of the Kronecker Product

-- L --

l2a Convert list to array
lazy.symbolic lazy.symbolic: Collection of some useful symbolic tools for lazy boys and girls
lazy.symbolic_JPH lazy.symbolic: Collection of some useful symbolic tools for lazy boys and girls 記号演算のための関数群
linear_expand Distribute functions to each of the additive terms
linear_expand_expr Lienarly Distribute Functions
locbalpar Return the locations of the matching parentheses in a string.
lv Retruns the Last Value

-- M --

m2a Convert supermatrix to array
make_minus_sign Add + sign before unary - sign
map Map function to each element of exp
mark_soper Mark Special Operator by Single Alpha
mat2sum Express the i-j element of an Matrix Expression using Summation Operators
matindex Returns the Index to Convert vec(mat) to vec(t(mat)), etc.
matKTimes Symbolic Kronecker Product
matReplace Replace the Elements of a Symbolic Matrix
matSweep Symbolic Matrix Sweep Operator
matSwp Matrix Sweep Operator
matTimes Symbolic Multiplication of Two or More Matrices
mD Derivative of a Scalar Function with respect to a Matrix
mD0 Core function for differentiation
Mh2Mv Convert a horizontally stacked supermatrix to a vertially stacked one.
Minus Difference of Two or More Symbolic Expressions
modify_call Wrap or Repalce a Call in an Expression
modify_math_operators Modify Mathematical Operators for Symbolic Math
modify_math_operators_JPH 数値演算子の拡張
modSM<- Assign values to the submatrix of a supermatrix
move_det_out Move a multiplicative determinant factor to the left most position
Mv2Mh Convert a vertically stacked supermatrix to a horizontally stacked one.

-- N --

nFactors Calculate the Number of Factors in a Term
nterms Count the Number of Terms in an Expression
nterms2 Calculate the Number of Terms in an Expression

-- P --

P Orthogonal Projection Operators to the Column Space of the Input
Plus Sum of Two or More Symbolic Expression
pmat Generate a permutation matrix to switch row or column.
Print Print multiple objects together with their names (Compact and better version of Print)
Printb Print Super Matrix ( Partitioned Matrix, Block Matrix ) with Separators.
printb Print Super Matrix ( Partitioned Matrix, Block Matrix ) with Separators.
Printm Print multiple objects together with their names (Compact and better version of Print)
printm Print multiple objects together with their names (Compact and better version of Print)
print_tex_as_html Print the LaTex as html in RStudio Viewer pane or a RMarkdown (Quarto) document
Prod Symbolic Product of All the Elements

-- Q --

Q Projection Operators to the Orthogonal Complement of the Column Space of the Input
QRGS QR decomposition of X matrix by the Gram Schmidt orthogonalization or Finding non redundant columns of X

-- R --

recompose_MatProd Recompose MatProd
reduce_expr_I Remove multiplicative identity matrix I
reduce_expr_sign Remove multiple consecutive signs from an expression
reduce_sign_expr Simplify/Modify the Signs of an Expression
remove_paren Remove redundant parentheses from an expression
repmat Stack a matrix n times either horizontally or vertically.

-- S --

safe_deparse Deparse an expression with maximum width.cutoff
Seq Smart Sequence Generation
show_ast Display the structure of input expression
Simplify Simplify Symbolic Expressions (very primitive version)
simplify_power Simplify Power
ssq Returns the (doubly weighted) sum of squares of all the elements of A
str_replace_all Simulate str_replace_all of tidyverse.
Sum Symbolic Sum of All the Elements
sum2mat Express Summation Expressions in Matrix Form
sum2mat0 Express Summation Expressions in Matrix Form (Regexpr version)
sumDisplay Display the Structure of Summations
sumEval Evaluate Summation:
sumExpand Expand (Distribute) summaiton
suminfo Information of Nested Summations
sumMoveIn Move summation to the right
sumSimplify Simplify an expression containing summation
supermat Declare a supermatrix with SMdim attribute
SymbolicOps Examples of Symbolic Operations
SymbolicOps_JPH 拡張された数値演算子の例

-- T --

Times Elementwise Multiplication of Two or More Symbolic Vectors/Matrices
to_latex Convert the input string to LaTex and display it on the RStudio viewer
to_latex_core The core part of to_latex functions by Dr. Fukushima
tp Transposition of a Fully Symbolic Partitioned Matrix
tr trace of the input matrix
tr2vecK Conversion of the Trace of the Product of Several Matrices using vec operator and Kronecker Product #'
trace_reorder Reorder the arguments of the tr and * functions
transp Transpose each matrix contained in a list/array/supermatrix..
transpose_expr Smart Transposition

-- U --

unary_reorder_expr Reorder unary oparators
unmark_soper Recover the Marked Special Operators

-- V --

varlist Interprete sas-like abbreviated variable list
vec Vectorization of a matrix
vec2vecK Conversion of the vec of Matrix Product using vec operator and Kronecker Product
vecdiag Returns diagonal elements of A as a vector
vech Vectorization of the lower-half or upper-half of a square matrix
vechindex Returns the index to convert vech(Mat) to Mat and vice versa.
vechinv Recover the Symmetric Matrix from its lower or upper half elements stored in a vector created by vech function.
vecvecindex Returns the index to convert vec(Mat) to vec(t(Mat)) and vice versa.

-- W --

wrap_hp wrap Hadamar product with parens for apparance

-- misc --

%/.% Mathematica like postfix replacement
%m% Minus operator for Elementwise Difference
%p% Plus operator for Elementwise Sum
%T% matTimes operator for Matrix Product