/** 
* @file LabeledSet.h
* @brief Transformation of vectors
* @author MiKe
* @date 20.01.2010

*/
#ifndef BASICVECTORTRANSFORMATIONSINCLUDE
#define BASICVECTORTRANSFORMATIONSINCLUDE

#include "core/image/ImageT.h"
#include "core/vector/VectorT.h"
#include "core/vector/MatrixT.h"

#include "core/vector/VVector.h"
#include <vector>
#include "vislearning/cbaselib/VectorTransform.h"

namespace OBJREC {

   ///do nothing
   class IdentityTransform : public VectorTransform{
	public:
		IdentityTransform (){};
		~IdentityTransform (){};
		NICE::Vector transform( const NICE::Vector& vec);
		NICE::Vector transform( const NICE::Vector& vec, const std::vector<NICE::Vector>& params);
    };

   ///vec = vec/||vec||_2, where vec~vector
   class UnitLengthTransform : public VectorTransform{
	public:
		UnitLengthTransform(){};
		~UnitLengthTransform(){};
		NICE::Vector transform( const NICE::Vector& vec);
		NICE::Vector transform( const NICE::Vector& vec, const std::vector<NICE::Vector>& params);
    };

   ///vec = vec + params[0][0], where vec~vector, params[0][0]~scalar
   class ConstantShiftingTransform : public VectorTransform{
	public:
		ConstantShiftingTransform(){};
		~ConstantShiftingTransform(){};
		NICE::Vector transform( const NICE::Vector& vec);
		NICE::Vector transform( const NICE::Vector& vec, const std::vector<NICE::Vector>& params);
    };

   ///vec = vec * params[0][0], where vec~vector, params[0][0]~scalar
   class ConstantScalingTransform : public VectorTransform{
	public:
		ConstantScalingTransform(){};
		~ConstantScalingTransform(){};
		NICE::Vector transform( const NICE::Vector& vec);
		NICE::Vector transform( const NICE::Vector& vec, const std::vector<NICE::Vector>& params);
    };

   ///vec = vec .+ params[0], where vec~vector, params[0]~vector (dimensionwise addition, vectors must have same length)
   class VectorShiftingTransform : public VectorTransform{
	public:
		VectorShiftingTransform(){};
		~VectorShiftingTransform(){};
		NICE::Vector transform( const NICE::Vector& vec);
		NICE::Vector transform( const NICE::Vector& vec, const std::vector<NICE::Vector>& params);
    };

   ///vec = vec .* params[0], where vec~vector, params[0]~vector (dimensionwise scaling, vectors must have same length)
   class VectorScalingTransform  : public VectorTransform{
	public:
		VectorScalingTransform(){};
		~VectorScalingTransform(){};
		NICE::Vector transform( const NICE::Vector& vec);
		NICE::Vector transform( const NICE::Vector& vec, const std::vector<NICE::Vector>& params);
    };   

   /// Running Median wrt vec of width params[0][0] (if not specified, default width=3), vec filled with zeros at boundaries
   class RunningMedianTransform : public VectorTransform{
	public:
		RunningMedianTransform(){};
		~RunningMedianTransform(){};
		NICE::Vector transform( const NICE::Vector& vec);
		NICE::Vector transform( const NICE::Vector& vec, const std::vector<NICE::Vector>& params);
    };
   /// Running Mean wrt vec of width params[0][0] (if not specified, default width=3), vec mirrored at boundaries
   class RunningMeanTransform : public VectorTransform{
	private:
		uint get_index( int index, int vec_size);
	public:
		RunningMeanTransform(){};
		~RunningMeanTransform(){};
		NICE::Vector transform( const NICE::Vector& vec);
		NICE::Vector transform( const NICE::Vector& vec, const std::vector<NICE::Vector>& params);
    };


} // namespace

#endif