00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "Square.h"
00020
00021 using namespace std;
00022 using namespace Marsyas;
00023
00024 Square::Square(mrs_string name):MarSystem("Square", name)
00025 {
00026 }
00027
00028 Square::Square(const Square& a) : MarSystem(a)
00029 {
00030 }
00031
00032
00033 Square::~Square()
00034 {
00035 }
00036
00037 MarSystem*
00038 Square::clone() const
00039 {
00040 return new Square(*this);
00041 }
00042
00043 void
00044 Square::myUpdate(MarControlPtr sender)
00045 {
00046 MRSDIAG("Square.cpp - Square:myUpdate");
00047
00048
00049 MarSystem::myUpdate(sender);
00050 }
00051
00052 void
00053 Square::myProcess(realvec& in, realvec& out)
00054 {
00055 mrs_natural t,o;
00056 for (o=0; o < inObservations_; o++)
00057 {
00058 for (t = 0; t < inSamples_; t++)
00059 {
00060 out(o, t) = in(o, t) * in(o, t);
00061 }
00062 }
00063 }