Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am fcortes on github.
  • I am cortes (https://keybase.io/cortes) on keybase.
  • I have a public key whose fingerprint is 4B48 B656 55A6 56CC 148B C092 3507 A48C CDEC E80B

To claim this, I am signing this object:

@fcortes
fcortes / linear_operator.cpp
Last active December 7, 2016 21:33
Templates example
#include "linear_operator.h"
template<class F, class G>
Vector<G> LinearOperator<F, G>::Apply(const Vector<F>& vec) const {
G* dt = new G[vec.GetLength()];
for(int i = 0; i < vec.GetLength(); i++) {
dt[i] = vec.Get(i) * 2;
}
return Vector<G>(vec.GetLength(), dt);