atan2 updates

This commit is contained in:
rjbaucells 2015-05-03 23:39:06 -04:00
parent fa24a92b24
commit 586b93bcf3
2 changed files with 3 additions and 2 deletions

View File

@ -10,6 +10,7 @@ function factory (type, config, load, typed) {
var algorithm03 = load(require('../../type/matrix/util/algorithm03'));
var algorithm09 = load(require('../../type/matrix/util/algorithm09'));
var algorithm11 = load(require('../../type/matrix/util/algorithm11'));
var algorithm12 = load(require('../../type/matrix/util/algorithm12'));
var algorithm13 = load(require('../../type/matrix/util/algorithm13'));
var algorithm14 = load(require('../../type/matrix/util/algorithm14'));
@ -122,7 +123,7 @@ function factory (type, config, load, typed) {
// check storage format
switch (y.storage()) {
case 'sparse':
c = algorithm11(y, x, atan2, true);
c = algorithm12(y, x, atan2, true);
break;
default:
c = algorithm14(y, x, atan2, true);

View File

@ -130,7 +130,7 @@ describe('atan2', function() {
describe('SparseMatrix', function () {
it('should calculate atan2 sparse matrix - scalar', function () {
assert.deepEqual(divide(atan2(1, sparse([[1, -1], [0, 1]])), pi), sparse([[0.25, 0.75], [0.5, 0.25]]));
assert.deepEqual(divide(atan2(1, sparse([[1, -1], [0, 1]])), pi), matrix([[0.25, 0.75], [0.5, 0.25]]));
assert.deepEqual(divide(atan2(sparse([[1, -1], [0, 1]]), 1), pi), sparse([[0.25, -0.25], [0, 0.25]]));
});