|
30 | 30 | validateDoubleConsistency2(@(x,y) times(x(1),double(sparse(y))), y(1,:), y(2,:)); |
31 | 31 | validateDoubleConsistency2(@(x,y) times(double(x(1)),y), y(1,:), y(2,:)); |
32 | 32 | validateDoubleConsistency2(@(x,y) times(double(sparse(x(1))),y), y(1,:), y(2,:)); |
| 33 | + |
| 34 | + % product with a vector |
| 35 | + validateDoubleConsistency2(@(x,y) times(x,y(1,:)), y(1,:), y(2,:)); |
| 36 | + validateDoubleConsistency2(@(x,y) times(x,sparse(y(1,:))), y(1,:), y(2,:)); |
| 37 | + validateDoubleConsistency2(@(x,y) times(x,double(y(1,:))), y(1,:), y(2,:)); |
| 38 | + validateDoubleConsistency2(@(x,y) times(x,double(sparse(y(1,:)))), y(1,:), y(2,:)); |
| 39 | + validateDoubleConsistency2(@(x,y) times(double(x),y(1,:)), y(1,:), y(2,:)); |
| 40 | + validateDoubleConsistency2(@(x,y) times(double(sparse(x)),y(1,:)), y(1,:), y(2,:)); |
| 41 | + |
| 42 | + validateDoubleConsistency2(@(x,y) times(x(1,:),y), y(1,:), y(2,:)); |
| 43 | + validateDoubleConsistency2(@(x,y) times(x(1,:),sparse(y)), y(1,:), y(2,:)); |
| 44 | + validateDoubleConsistency2(@(x,y) times(x(1,:),double(y)), y(1,:), y(2,:)); |
| 45 | + validateDoubleConsistency2(@(x,y) times(x(1,:),double(sparse(y))), y(1,:), y(2,:)); |
| 46 | + validateDoubleConsistency2(@(x,y) times(double(x(1,:)),y), y(1,:), y(2,:)); |
| 47 | + validateDoubleConsistency2(@(x,y) times(double(sparse(x(1,:))),y), y(1,:), y(2,:)); |
| 48 | + |
| 49 | + validateDoubleConsistency2(@(x,y) times(x,y(:,1)), y(1,:), y(2,:)); |
| 50 | + validateDoubleConsistency2(@(x,y) times(x,sparse(y(:,1))), y(1,:), y(2,:)); |
| 51 | + validateDoubleConsistency2(@(x,y) times(x,double(y(:,1))), y(1,:), y(2,:)); |
| 52 | + validateDoubleConsistency2(@(x,y) times(x,double(sparse(y(:,1)))), y(1,:), y(2,:)); |
| 53 | + validateDoubleConsistency2(@(x,y) times(double(x),y(:,1)), y(1,:), y(2,:)); |
| 54 | + validateDoubleConsistency2(@(x,y) times(double(sparse(x)),y(:,1)), y(1,:), y(2,:)); |
| 55 | + |
| 56 | + validateDoubleConsistency2(@(x,y) times(x(:,1),y), y(1,:), y(2,:)); |
| 57 | + validateDoubleConsistency2(@(x,y) times(x(:,1),sparse(y)), y(1,:), y(2,:)); |
| 58 | + validateDoubleConsistency2(@(x,y) times(x(:,1),double(y)), y(1,:), y(2,:)); |
| 59 | + validateDoubleConsistency2(@(x,y) times(x(:,1),double(sparse(y))), y(1,:), y(2,:)); |
| 60 | + validateDoubleConsistency2(@(x,y) times(double(x(:,1)),y), y(1,:), y(2,:)); |
| 61 | + validateDoubleConsistency2(@(x,y) times(double(sparse(x(:,1))),y), y(1,:), y(2,:)); |
33 | 62 | end |
34 | 63 |
|
35 | 64 | function test_empty |
|
44 | 73 | shouldProduceAnError(@() times(x,x,x)); |
45 | 74 |
|
46 | 75 | % sizes should match |
47 | | - shouldProduceAnError(@() times(x, [1 2 3])); |
| 76 | + shouldProduceAnError(@() times(x, [1 2])); |
48 | 77 | end |
0 commit comments