(Vec v)
| 171 | // public void multiply(double c, Matrix A, Vec b) |
| 172 | |
| 173 | @Override |
| 174 | public double dot(Vec v) |
| 175 | { |
| 176 | if(v instanceof ShiftedVec) |
| 177 | { |
| 178 | ShiftedVec other = (ShiftedVec) v; |
| 179 | return this.base.dot(other.base) + other.base.sum()*this.shift + this.base.sum()*other.shift + this.length()*this.shift*other.shift; |
| 180 | } |
| 181 | return base.dot(v) + v.sum()*shift; |
| 182 | } |
| 183 | |
| 184 | @Override |
| 185 | public void zeroOut() |