-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opSubsAsgn.m: Fixed bug in scalar assignment
opBlockDiag.m: Fixed bug with weights double.m: Use minimal number of multipliations git-svn-id: svn://tuatara.cs.ubc.ca/spot/trunk@18 602325e8-326d-0410-a6db-8800ab266cdc
- Loading branch information
ewout78
committed
Jun 30, 2009
1 parent
7edcd3a
commit 8a771cc
Showing
6 changed files
with
38 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function d = diag(A) | ||
|
||
% Copyright 2009, Ewout van den Berg and Michael P. Friedlander | ||
% http://www.cs.ubc.ca/labs/scl/sparco | ||
% $Id: double.m 13 2009-06-28 02:56:46Z mpf $ | ||
|
||
[m,n] = size(A); | ||
k = min(m,n); | ||
|
||
d = zeros(k,1); | ||
for i=1:k | ||
v = zeros(n,1); v(i) = 1; | ||
w = A*v; | ||
d(i) = w(i); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters