| 111 | |
| 112 | |
| 113 | dMatrix dMatrix::select (int np, int *p, int nq, int *q) |
| 114 | { |
| 115 | if (np < 1 || nq < 1) dDebug (0,"Matrix select, bad index array sizes"); |
| 116 | dMatrix r (np,nq); |
| 117 | for (int i=0; i<np; i++) { |
| 118 | for (int j=0; j<nq; j++) { |
| 119 | if (p[i] < 0 || p[i] >= n || q[i] < 0 || q[i] >= m) |
| 120 | dDebug (0,"Matrix select, bad index arrays"); |
| 121 | r.data[i*nq+j] = data[p[i]*m+q[j]]; |
| 122 | } |
| 123 | } |
| 124 | return r; |
| 125 | } |
| 126 | |
| 127 | |
| 128 | dMatrix dMatrix::operator + (const dMatrix &a) |
no test coverage detected