In[]:=
deploy
Tue 7 Mar 2023 10:27:48

Utilities for Newton/whitening project

Util

Remap keys

https : // mathematica.stackexchange.com/questions/141921/changing - cmd1 - cmd2 - shortcuts - to - alt1 - alt2
In[]:=
(*Clearshortcuts*)​​SetOptions[EvaluationNotebook[],StyleDefinitionsNotebook[{Cell[StyleData[StyleDefinitions"Default.nb"]],Cell[StyleData["Title"],MenuCommandKeyNone],Cell[StyleData["Chapter"],MenuCommandKeyNone]},WindowSize{808,689},WindowMargins{{38,Automatic},{-80,Automatic}},VisibleFalse,FrontEndVersion"11.1 for Mac OS X x86 (32-bit, 64-bit Kernel) (January 4, 2017)",StyleDefinitions"PrivateStylesheetFormatting.nb"]]
In[]:=
FileNameJoin[{$InstallationDirectory,"SystemFiles","FrontEnd","TextResources","Macintosh","KeyEventTranslations.tr"}]
Out[]=
/Applications/Mathematica.app/Contents/SystemFiles/FrontEnd/TextResources/Macintosh/KeyEventTranslations.tr

Debugger

SetOptions[$FrontEndSession,"DebuggerSettings"{"DebuggerEnabled"True}];
SetOptions[$FrontEndSession,"DebuggerSettings"{"DebuggerEnabled"False}];

Rotation control

Plot3D[1,{x,y}∈Annulus[],Method->{"RotationControl"->"ArcBall"}]

Tests

On[Assert];​​Xtemp=Array[x,{4,3}];​​Assert[Kmat[4,3].vec[Xtemp]==vec[Xtemp]];​​Xtemp=Array[x,{11,6}];​​Assert[Kmat[11,6].vec[Xtemp]==vec[Xtemp]];​​​​(*blockDiagonalInverse*)​​myblocks={{2IdentityMatrix[3],Array[3&,{3,1}]},{Array[3&,{1,3}],2IdentityMatrix[1]}};​​Assert[ArrayFlatten[blockDiagonalInverse[myblocks]]1/2IdentityMatrix[4]];

Matrix power notation

In[]:=
Needs["Notation`"];​​distinguishMatrixPowerAndPower[A_,d_]:=If[SquareMatrixQ[A],MatrixPower[A,d],Power[A,d]];​​Notation
d_
A_
⟺
distinguishMatrixPowerAndPower[A_,d_]
;​​