MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / dot

Method dot

JSAT/src/jsat/linear/ShiftedVec.java:173–182  ·  view source on GitHub ↗
(Vec v)

Source from the content-addressed store, hash-verified

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()

Callers 1

testDotMethod · 0.95

Calls 2

lengthMethod · 0.95
sumMethod · 0.45

Tested by 1

testDotMethod · 0.76