- prepared to use armadillo matrix lib
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@897 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+48
-11
@@ -8,31 +8,68 @@
|
|||||||
#ifndef _RADIO_VECTOR_HPP_
|
#ifndef _RADIO_VECTOR_HPP_
|
||||||
#define _RADIO_VECTOR_HPP_
|
#define _RADIO_VECTOR_HPP_
|
||||||
|
|
||||||
#include <Eigen/Dense>
|
#define VECTOR_USE_EIGEN
|
||||||
using namespace Eigen;
|
//#define VECTOR_USE_ARMADILLO
|
||||||
|
|
||||||
#include <complex>
|
#include <complex>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include <radio/radio_types.h>
|
#include <radio/radio_types.h>
|
||||||
|
|
||||||
using Eigen::Dense;
|
|
||||||
|
|
||||||
#ifndef radio_float_t
|
#ifndef radio_float_t
|
||||||
#define radio_float_t float
|
#define radio_float_t float
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef VECTOR_USE_EIGEN
|
||||||
|
#include <Eigen/Dense>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef VECTOR_USE_ARMADILLO
|
||||||
|
#include <armadillo>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Radio
|
namespace Radio
|
||||||
{
|
{
|
||||||
|
|
||||||
typedef radio_float_t RealScalar;
|
typedef radio_float_t RealScalar;
|
||||||
typedef complex<radio_float_t> ComplexScalar;
|
typedef std::complex<radio_float_t> ComplexScalar;
|
||||||
|
|
||||||
typedef Matrix<RealScalar, Dynamic, 1> RVec;
|
#ifdef VECTOR_USE_EIGEN
|
||||||
typedef Matrix<ComplexScalar, Dynamic, 1> CVec;
|
|
||||||
|
|
||||||
typedef Matrix<RealScalar, Dynamic, Dynamic> RMat;
|
typedef Eigen::Matrix<RealScalar, Eigen::Dynamic, 1> RVec;
|
||||||
typedef Matrix<ComplexScalar, Dynamic, Dynamic> CMat;
|
typedef Eigen::Matrix<ComplexScalar, Eigen::Dynamic, 1> CVec;
|
||||||
|
|
||||||
|
typedef Eigen::Matrix<RealScalar, Eigen::Dynamic, Eigen::Dynamic> RMat;
|
||||||
|
typedef Eigen::Matrix<ComplexScalar, Eigen::Dynamic, Eigen::Dynamic> CMat;
|
||||||
|
|
||||||
|
typedef Eigen::Map<RVec> RMap;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef VECTOR_USE_ARMADILLO
|
||||||
|
#if 1
|
||||||
|
template <typename T>
|
||||||
|
class Vec : public arma::Col<T>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void setZero()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
class RVec : public Vec<RealScalar>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
class CVec : public Vec<ComplexScalar>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
//typedef arma::col<RealScalar> RVec;
|
||||||
|
//typedef arma::col<ComplexScalar> CVec;
|
||||||
|
|
||||||
|
typedef arma::Mat<RealScalar> RMat;
|
||||||
|
typedef arma::Mat<ComplexScalar> CMat;
|
||||||
|
|
||||||
|
typedef arma::Map<RVec> RMap;
|
||||||
|
#endif
|
||||||
|
|
||||||
static ComplexScalar toComplexScalar(cpx_t v)
|
static ComplexScalar toComplexScalar(cpx_t v)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user