MCPcopy Create free account
hub / github.com/davisking/dlib / operator+

Method operator+

dlib/svm/function.h:433–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431 }
432
433 distance_function operator+ (
434 const distance_function& rhs
435 ) const
436 {
437 // make sure requires clause is not broken
438 DLIB_ASSERT(get_kernel() == rhs.get_kernel(),
439 "\t distance_function distance_function::operator+()"
440 << "\n\t You can only add two distance_functions together if they use the same kernel."
441 );
442
443 if (alpha.size() == 0)
444 return rhs;
445 else if (rhs.alpha.size() == 0)
446 return *this;
447 else
448 return distance_function(join_cols(alpha, rhs.alpha),
449 b + rhs.b + 2*trans(alpha)*kernel_matrix(kernel_function,basis_vectors,rhs.basis_vectors)*rhs.alpha,
450 kernel_function,
451 join_cols(basis_vectors, rhs.basis_vectors));
452 }
453
454 distance_function operator- (
455 const distance_function& rhs

Callers

nothing calls this directly

Calls 6

join_colsFunction · 0.85
kernel_matrixFunction · 0.85
distance_functionClass · 0.70
transFunction · 0.50
get_kernelMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected