Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miscmaths
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
Container Registry
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
miscmaths
Commits
2a3e8d60
Commit
2a3e8d60
authored
16 years ago
by
Christian Beckmann
Browse files
Options
Downloads
Patches
Plain Diff
added sqrtm
parent
72f5364e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
miscmaths.cc
+10
-0
10 additions, 0 deletions
miscmaths.cc
miscmaths.h
+1
-0
1 addition, 0 deletions
miscmaths.h
with
11 additions
and
0 deletions
miscmaths.cc
+
10
−
0
View file @
2a3e8d60
...
@@ -1368,6 +1368,16 @@ ReturnMatrix sqrt(const Matrix& mat)
...
@@ -1368,6 +1368,16 @@ ReturnMatrix sqrt(const Matrix& mat)
return
res
;
return
res
;
}
}
ReturnMatrix
sqrtm
(
const
Matrix
&
mat
)
{
Matrix
res
,
tmpU
,
tmpV
;
DiagonalMatrix
tmpD
;
SVD
(
mat
,
tmpD
,
tmpU
,
tmpV
);
res
=
tmpU
*
sqrt
(
tmpD
)
*
tmpV
.
t
();
res
.
Release
();
return
res
;
}
ReturnMatrix
log
(
const
Matrix
&
mat
)
ReturnMatrix
log
(
const
Matrix
&
mat
)
{
{
Matrix
res
=
mat
;
Matrix
res
=
mat
;
...
...
This diff is collapsed.
Click to expand it.
miscmaths.h
+
1
−
0
View file @
2a3e8d60
...
@@ -214,6 +214,7 @@ namespace MISCMATHS {
...
@@ -214,6 +214,7 @@ namespace MISCMATHS {
ReturnMatrix
dist2
(
const
Matrix
&
mat1
,
const
Matrix
&
mat2
);
ReturnMatrix
dist2
(
const
Matrix
&
mat1
,
const
Matrix
&
mat2
);
ReturnMatrix
abs
(
const
Matrix
&
mat
);
ReturnMatrix
abs
(
const
Matrix
&
mat
);
ReturnMatrix
sqrt
(
const
Matrix
&
mat
);
ReturnMatrix
sqrt
(
const
Matrix
&
mat
);
ReturnMatrix
sqrtm
(
const
Matrix
&
mat
);
ReturnMatrix
log
(
const
Matrix
&
mat
);
ReturnMatrix
log
(
const
Matrix
&
mat
);
ReturnMatrix
exp
(
const
Matrix
&
mat
);
ReturnMatrix
exp
(
const
Matrix
&
mat
);
ReturnMatrix
tanh
(
const
Matrix
&
mat
);
ReturnMatrix
tanh
(
const
Matrix
&
mat
);
...
...
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
register
or
sign in
to comment