Skip to content
Snippets Groups Projects
Select Git revision
  • e5c1e41966eba0a4dcd2724026a42c8095b8f3ac
  • importMinAmt default protected
2 results

all.js

Blame
  • dmp.cc 685 B
    #include "dmp.h"
    #include <iostream>
    #include <armadillo>
    using namespace arma;
    using namespace std;
    
    Dmp::Dmp(mat w, mat g, double t) : weights(w), goal(g), tau(t) {}
    
    mat Dmp::getW() const {
    	return weights;
    }
    
    mat Dmp::getG() const {
    	return goal;
    }
    
    double Dmp::getT() const {
    	return tau;
    }
    
    void Dmp::setG(mat g) {
    	goal = g;
    }
    
    void Dmp::setT(double t) {
    	tau = t;
    }
    
    Dmp& Dmp::doubleSpeed() {
    	tau = tau/2;
    	return *this;
    }
    
    Dmp& Dmp::speedupTimes(int x) {
    	tau = tau/x;
    	return *this;
    }
    
    
    
    ostream& operator<<(ostream& os, const Dmp& dmp) {
    	os << "Weights = " << dmp.weights << endl;
    	os << "Goal = " << dmp.goal << endl;
    	os << "Tau = " << dmp.tau << endl;
    	
    	return os;
    }