6 #ifndef MYRAMATH_DENSE_VECTOR_H 7 #define MYRAMATH_DENSE_VECTOR_H 14 #include <myramath/MYRAMATH_EXPORT.h> 22 #ifdef MYRAMATH_ENABLE_CPP11 23 #include <initializer_list> 32 template<
int Arity,
class Number>
class Expression;
33 template<
class Number>
class Vector;
34 template<
class T>
class Array1;
37 template<
class Number>
class MYRAMATH_EXPORT Vector
63 #ifdef MYRAMATH_ENABLE_CPP11 136 const Number& operator () (
int n)
const;
138 const Number& operator [] (
int n)
const;
139 Number& operator () (
int n) ;
140 Number& operator [] (
int n) ;
144 const Number& at(
int n)
const;
164 CPair split_first(
int n)
const;
166 Pair split_first(
int n) ;
182 CPair split_last(
int n)
const;
184 Pair split_last(
int n) ;
191 template<
class Functor>
void transform(
const Functor& f)
192 { this->range().transform(f); }
211 void operator *= (Number alpha);
214 void operator /= (Number alpha);
233 #ifdef MYRAMATH_ENABLE_CPP11 242 static Vector<Number> logspace(Precision x0, Precision x1,
int N);
250 typedef std::vector<Number> Contents;
257 {
public:
typedef Number type; };
Number random()
Generate random real/complex Numbers, uniformly distributed over [-1,1].
void transform(const Functor &f)
Overwrites every x(n) in this Vector with f(x(n)).
Definition: Vector.h:191
Reflects Number trait for a Container, containers of Numbers (Matrix's, Vector's, etc) should special...
Definition: Number.h:55
Interface class for representing subranges of dense Matrix's.
std::pair< CVectorRange< Number >, CVectorRange< Number > > CPair
Useful typedefs.
Definition: Vector.h:42
Interface class for representing subranges of dense Vector's.
Represents a mutable VectorRange.
Definition: axpy.h:21
Represents a const MatrixRange.
Definition: bothcat.h:22
Abstraction layer, serializable objects write themselves to these.
Definition: Streams.h:39
Various utility functions/classes related to scalar Number types.
Represents a mutable MatrixRange.
Definition: conjugate.h:26
Tabulates a vector of length N, allows random access.
Definition: conjugate.h:21
Reflects Precision trait for a Number, scalar Number types should specialize it.
Definition: Number.h:33
Represents a const VectorRange.
Definition: axpy.h:20
Container of values, allows random (i) access.
Definition: Array1.h:32
Expression< 1, NumberC > make_complex(const Expression< 1, NumberS > &A)
Promotes a real Expression into a complex one.
Definition: functions_complex.cpp:122
Given an index (i,j,etc), returns a value.
Definition: arithmetic.h:19
Represents a const intRange.
Definition: intRange.h:142
float NumberS
Useful typedefs.
Definition: Number.h:21