Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
e143dd35
Commit
e143dd35
authored
9 months ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Update doc for doubleDot functions
parent
68a8f1d8
No related branches found
No related tags found
1 merge request
!198
Add TinyMatrix's double-dot product
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/userdoc.org
+49
-1
49 additions, 1 deletion
doc/userdoc.org
with
49 additions
and
1 deletion
doc/userdoc.org
+
49
−
1
View file @
e143dd35
...
@@ -2781,6 +2781,20 @@ $\mathbb{R}^{1\times1}$, $\mathbb{R}^{2\times2}$ and $\mathbb{R}^{3\times3}$.
...
@@ -2781,6 +2781,20 @@ $\mathbb{R}^{1\times1}$, $\mathbb{R}^{2\times2}$ and $\mathbb{R}^{3\times3}$.
The output is
The output is
#+RESULTS: trace-examples
#+RESULTS: trace-examples
The ~doubleDot~ functions compute the double-dot ($A:B = \mathrm{tr}(A^T
B)$) of two matrices of $\mathbb{R}^{1\times1}$, $\mathbb{R}^{2\times2}$ and
$\mathbb{R}^{3\times3}$.
#+NAME: double-dot-examples
#+BEGIN_SRC pugs :exports both :results output
import math;
cout << "doubleDot([[1.2]],[[2.3]]) = " << doubleDot([[1.2]],[[2.3]]) << "\n";
cout << "doubleDot([[1,2],[3,4]],[[3,6],[2,5]]) = " << doubleDot([[1,2],[3,4]],[[3,6],[2,5]]) << "\n";
cout << "doubleDot([[1,2,3],[4,5,6],[7,8,9]], [[5,2,1],[4,2,8],[2,6,2]]) = "
<< doubleDot([[1,2,3],[4,5,6],[7,8,9]], [[5,2,1],[4,2,8],[2,6,2]]) << "\n";
#+END_SRC
The output is
#+RESULTS: double-dot-examples
Also, one can compute inverses of $\mathbb{R}^{1\times1}$,
Also, one can compute inverses of $\mathbb{R}^{1\times1}$,
$\mathbb{R}^{2\times2}$ and $\mathbb{R}^{3\times3}$ matrices using the
$\mathbb{R}^{2\times2}$ and $\mathbb{R}^{3\times3}$ matrices using the
~inverse~ function set.
~inverse~ function set.
...
@@ -2789,7 +2803,7 @@ $\mathbb{R}^{2\times2}$ and $\mathbb{R}^{3\times3}$ matrices using the
...
@@ -2789,7 +2803,7 @@ $\mathbb{R}^{2\times2}$ and $\mathbb{R}^{3\times3}$ matrices using the
import math;
import math;
cout << "inverse([[1.2]]) = " << inverse([[1.2]]) << "\n";
cout << "inverse([[1.2]]) = " << inverse([[1.2]]) << "\n";
cout << "inverse([[1,2],[3,4]]) = " << inverse([[1,2],[3,4]]) << "\n";
cout << "inverse([[1,2],[3,4]]) = " << inverse([[1,2],[3,4]]) << "\n";
cout << "inverse([[3,2,1],[5,6,4],[7,8,9]]) = "
cout << "inverse([[3,2,1],[5,6,4],[7,8,9]])
\n
= "
<< inverse([[3,2,1],[5,6,4],[7,8,9]]) << "\n";
<< inverse([[3,2,1],[5,6,4],[7,8,9]]) << "\n";
#+END_SRC
#+END_SRC
The output is
The output is
...
@@ -3479,6 +3493,13 @@ This function requires that both arguments are defined on the same
...
@@ -3479,6 +3493,13 @@ This function requires that both arguments are defined on the same
mesh and have the same data type. The result is a
mesh and have the same data type. The result is a
$\mathbb{P}_0(\mathbb{R})$ function.
$\mathbb{P}_0(\mathbb{R})$ function.
Finally the equivalent exists for discrete functions of matrices and
applies to $\mathbb{P}_0(\mathbb{R}^1x1)$, $\mathbb{P}_0(\mathbb{R}^2x2)$,
$\mathbb{P}_0(\mathbb{R}^3x3)$
- ~doubleDot: Vh*Vh -> Vh~
Both arguments must be defined on the same mesh and have the same data
type. The result is a $\mathbb{P}_0(\mathbb{R})$ function.
****** ~R*Vh -> Vh~ and ~Vh*R -> Vh~
****** ~R*Vh -> Vh~ and ~Vh*R -> Vh~
These functions are defined for $\mathbb{P}_0(\mathbb{R})$ data and the
These functions are defined for $\mathbb{P}_0(\mathbb{R})$ data and the
...
@@ -3522,6 +3543,33 @@ The following functions
...
@@ -3522,6 +3543,33 @@ The following functions
- ~dot: Rˆ3*Vh -> Vh~
- ~dot: Rˆ3*Vh -> Vh~
- ~dot: Vh*Rˆ3 -> Vh~
- ~dot: Vh*Rˆ3 -> Vh~
****** ~R^1x1*Vh -> Vh~ and ~Vh*R^1x1 -> Vh~
These functions are defined for $\mathbb{P}_0(\mathbb{R}^1x1)$ data and the
return value is a $\mathbb{P}_0(\mathbb{R})$ function.
The following functions
- ~doubleDot: Rˆ1x1*Vh -> Vh~
- ~doubleDot: Vh*Rˆ1x1 -> Vh~
****** ~R^2x2*Vh -> Vh~ and ~Vh*R^2x2 -> Vh~
These functions are defined for $\mathbb{P}_0(\mathbb{R}^2x2)$ data and the
return value is a $\mathbb{P}_0(\mathbb{R})$ function.
The following functions
- ~doubleDot: Rˆ2x2*Vh -> Vh~
- ~doubleDot: Vh*Rˆ2x2 -> Vh~
****** ~R^3x3*Vh -> Vh~ and ~Vh*R^3x3 -> Vh~
These functions are defined for $\mathbb{P}_0(\mathbb{R}^3x3)$ data and the
return value is a $\mathbb{P}_0(\mathbb{R})$ function.
The following functions
- ~doubleDot: Rˆ3x3*Vh -> Vh~
- ~doubleDot: Vh*Rˆ3x3 -> Vh~
****** ~Vh -> R~
****** ~Vh -> R~
These functions are defined for $\mathbb{P}_0(\mathbb{R})$ data and the
These functions are defined for $\mathbb{P}_0(\mathbb{R})$ data and the
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment