-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9189 from acroy/cholmod
Fix issues with A_mul_Bc and Ac_mul_B for CholmodSparse (#9160).
- Loading branch information
Showing
5 changed files
with
142 additions
and
77 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Base.Test | ||
|
||
let # Issue 9160 | ||
const CHOLMOD = Base.LinAlg.CHOLMOD | ||
|
||
for Ti in CHOLMOD.CHMITypes.types | ||
for elty in CHOLMOD.CHMVRealTypes.types | ||
|
||
A = sprand(10,10,0.1) | ||
A = convert(SparseMatrixCSC{elty,Ti},A) | ||
cmA = CHOLMOD.CholmodSparse(A) | ||
|
||
B = sprand(10,10,0.1) | ||
B = convert(SparseMatrixCSC{elty,Ti},B) | ||
cmB = CHOLMOD.CholmodSparse(B) | ||
|
||
# Ac_mul_B | ||
@test_approx_eq sparse(cmA'*cmB) A'*B | ||
|
||
# A_mul_Bc | ||
@test_approx_eq sparse(cmA*cmB') A*B' | ||
|
||
# A_mul_Ac | ||
@test_approx_eq sparse(cmA*cmA') A*A' | ||
|
||
# Ac_mul_A | ||
@test_approx_eq sparse(cmA'*cmA) A'*A | ||
|
||
# A_mul_Ac for symmetric A | ||
A = 0.5*(A + A') | ||
cmA = CHOLMOD.CholmodSparse(A) | ||
@test_approx_eq sparse(cmA*cmA') A*A' | ||
end | ||
end | ||
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