36 #include <itpp/itexports.h> 45 ITPP_EXPORT ivec
find(
const bvec &invector);
64 ITPP_EXPORT mat
ones(
int rows,
int cols);
68 ITPP_EXPORT imat
ones_i(
int rows,
int cols);
70 ITPP_EXPORT cmat
ones_c(
int rows,
int cols);
82 ITPP_EXPORT mat
zeros(
int rows,
int cols);
86 ITPP_EXPORT imat
zeros_i(
int rows,
int cols);
88 ITPP_EXPORT cmat
zeros_c(
int rows,
int cols);
104 for (
int i =
size - 1; i >= 0; i--)
128 for (
int n = 1; n < points; ++n) {
129 output(n) = output(n-1)+step;
162 ITPP_EXPORT vec
zigzag_space(
double t0,
double t1,
int K = 5);
228 template <
typename Num_T>
231 int n_rows = c.
size();
232 int n_cols = r.
size();
234 for (
int i = 0; i < n_rows; ++i) {
235 int j_limit =
std::min(n_cols, n_rows - i);
236 for (
int j = 0; j < j_limit; ++j) {
237 output(i + j, j) = c(i);
240 for (
int j = 1; j < n_cols; ++j) {
241 int i_limit =
std::min(n_rows, n_cols - j);
242 for (
int i = 0; i < i_limit; ++i) {
243 output(i, i + j) = r(j);
250 template <
typename Num_T>
255 for (
int i = 0; i < s; ++i) {
256 for (
int j = 0; j < s - i; ++j) {
257 output(i + j, j) = c(i);
260 for (
int j = 1; j < s; ++j) {
261 for (
int i = 0; i < s - j; ++i) {
262 output(i, i + j) = c(j);
269 ITPP_EXPORT
const cmat
toeplitz(
const cvec &c);
285 ITPP_EXPORT
void house(
const vec &x, vec &v,
double &beta);
291 ITPP_EXPORT
void givens(
double a,
double b,
double &c,
double &s);
297 ITPP_EXPORT
void givens(
double a,
double b, mat &m);
303 ITPP_EXPORT mat
givens(
double a,
double b);
309 ITPP_EXPORT
void givens_t(
double a,
double b, mat &m);
315 ITPP_EXPORT mat
givens_t(
double a,
double b);
502 #endif // #ifndef SPECMAT_H int size() const
The size of the vector.
void set_size(int rows, int cols, bool copy=false)
Set size of matrix. If copy = true then keep the data before resizing.
ITPP_EXPORT ivec zeros_i(int size)
A Int vector of zeros.
ITPP_EXPORT bvec ones_b(int size)
A Binary vector of ones.
ITPP_EXPORT ivec ones_i(int size)
A Int vector of ones.
ITPP_EXPORT cmat eye_c(int size)
A Double Complex (size,size) unit matrix.
Vec< T > vec_2(T v0, T v1)
Vector of length 2.
vec impulse(int size)
Impulse vector.
void givens_t(double a, double b, mat &m)
Calculate the transposed Givens rotation matrix.
ivec find(const bvec &invector)
Return a integer vector with indicies where bvec == 1.
Mat< T > mat_2x1(T m00, T m10)
Matrix of size 2 by 1.
ITPP_EXPORT bvec zeros_b(int size)
A Binary vector of zeros.
template void eye(int, mat &)
Template instantiation of eye.
Mat< T > mat_3x3(T m00, T m01, T m02, T m10, T m11, T m12, T m20, T m21, T m22)
Matrix of size 3 by 3.
int length(const Vec< T > &v)
Length of vector.
Mat< T > mat_1x3(T m00, T m01, T m02)
Matrix of size 1 by 3.
Mat< T > mat_1x2(T m00, T m01)
Matrix of size 1 by 2.
ITPP_EXPORT cvec zeros_c(int size)
A Double Complex vector of zeros.
const cmat toeplitz(const cvec &c)
Generate symmetric Toeplitz matrix from vector c (complex valued)
ITPP_EXPORT vec zeros(int size)
A Double vector of zeros.
Definitions of converters between different vector and matrix types.
vec angle(const cvec &x)
Angle.
T min(const Vec< T > &in)
Minimum value of vector.
Vec< T > vec_3(T v0, T v1, T v2)
Vector of length 3.
Mat< T > mat_3x2(T m00, T m01, T m10, T m11, T m20, T m21)
Matrix of size 3 by 2.
Matrix Class Definitions.
Mat< T > mat_1x1(T m00)
Matrix of size 1 by 1.
int size(const Vec< T > &v)
Length of vector.
int floor_i(double x)
The nearest smaller integer.
imat conference(int n)
Conference matrix.
imat jacobsthal(int p)
Jacobsthal matrix.
ITPP_EXPORT vec ones(int size)
A float vector of ones.
mat rotation_matrix(int dim, int plane1, int plane2, double angle)
Create a rotation matrix that rotates the given plane angle radians. Note that the order of the plane...
void house(const vec &x, vec &v, double &beta)
Calcualte the Householder vector.
template vec linspace_fixed_step(double, double, double)
Template instantiation of linspace_fixed_step.
vec linspace(double from, double to, int points)
linspace (works in the same way as the MATLAB version)
Mat< T > mat_2x3(T m00, T m01, T m02, T m10, T m11, T m12)
Matrix of size 2 by 3.
Mat< T > mat_3x1(T m00, T m10, T m20)
Matrix of size 3 by 1.
Vec< T > vec_1(T v0)
Vector of length 1.
Mat< T > mat_2x2(T m00, T m01, T m10, T m11)
Matrix of size 2 by 2.
T to(double x)
Convert double to T.
vec zigzag_space(double t0, double t1, int K)
Zig-zag space function (variation on linspace)
ITPP_EXPORT bmat eye_b(int size)
A Binary (size,size) unit matrix.
ITPP_EXPORT cvec ones_c(int size)
A float Complex vector of ones.
ITPP_EXPORT imat eye_i(int size)
A Int (size,size) unit matrix.
void givens(double a, double b, double &c, double &s)
Calculate the Givens rotation values.
imat hadamard(int size)
Hadamard matrix.
Mat< bin > bmat
bin matrix
Templated Vector Class Definitions.