22#include <gsl/gsl_linalg.h> 
   24#include <yarp/sig/Matrix.h> 
   25#include <yarp/sig/Vector.h> 
   26#include <yarp/math/RandScalar.h> 
   27#include <yarp/math/RandnScalar.h> 
   31namespace learningmachine {
 
   43#ifndef DOXYGEN_SHOULD_SKIP_THIS 
   72void dchud(
double* r, 
int ldr, 
int p, 
double* 
x, 
double* 
z, 
int ldz, 
int nz,
 
   73           double* 
y, 
double* rho, 
double* c, 
double* s,
 
   74           unsigned char rtrans = 0, 
unsigned char ztrans = 0);
 
   80                                gsl_matrix* Z = NULL, gsl_vector* 
y = NULL, gsl_vector* rho = NULL,
 
   81                                unsigned char rtrans = 0, 
unsigned char ztrans = 0);
 
  100void cholupdate(yarp::sig::Matrix& R, 
const yarp::sig::Vector& 
x, yarp::sig::Vector& c, yarp::sig::Vector& s,
 
  101                yarp::sig::Matrix& Z, 
const yarp::sig::Vector& 
y, yarp::sig::Vector& rho, 
bool rtrans = 0, 
bool ztrans = 0);
 
  112void cholupdate(yarp::sig::Matrix& R, 
const yarp::sig::Vector& 
x, 
bool rtrans = 0);
 
  122void cholsolve(
const yarp::sig::Matrix& R, 
const yarp::sig::Matrix& B, yarp::sig::Matrix& X);
 
  132yarp::sig::Matrix 
cholsolve(
const yarp::sig::Matrix& R, 
const yarp::sig::Matrix& B);
 
  141void cholsolve(
const yarp::sig::Matrix& R, 
const yarp::sig::Vector& b, yarp::sig::Vector& 
x);
 
  150yarp::sig::Vector 
cholsolve(
const yarp::sig::Matrix& R, 
const yarp::sig::Vector& b);
 
  159yarp::sig::Matrix 
outerprod(
const yarp::sig::Vector& v1, 
const yarp::sig::Vector& v2);
 
  168yarp::sig::Vector& 
addvec(yarp::sig::Vector& v, 
double val);
 
  178void trsolve(
const yarp::sig::Matrix& 
A, 
const yarp::sig::Vector& b, yarp::sig::Vector& 
x, 
bool transa = 
false);
 
  189yarp::sig::Vector 
trsolve(
const yarp::sig::Matrix& 
A, 
const yarp::sig::Vector& b, 
bool transa = 
false);
 
  197void fillrandom(yarp::sig::Vector& v, yarp::math::RandScalar& prng);
 
  205void fillrandom(yarp::sig::Matrix& M, yarp::math::RandScalar& prng);
 
  213void fillrandom(yarp::sig::Vector& v, yarp::math::RandnScalar& prng);
 
  221void fillrandom(yarp::sig::Matrix& M, yarp::math::RandnScalar& prng);
 
  230yarp::sig::Vector 
random(
int length, yarp::math::RandScalar& prng);
 
  240yarp::sig::Matrix 
random(
int rows, 
int columns, yarp::math::RandScalar& prng);
 
  250yarp::sig::Vector 
random(
int length, yarp::math::RandnScalar& prng);
 
  260yarp::sig::Matrix 
random(
int rows, 
int columns, yarp::math::RandnScalar& prng);
 
  269yarp::sig::Vector& 
map(yarp::sig::Vector& v, 
double (op)(
double));
 
  278yarp::sig::Matrix& 
map(yarp::sig::Matrix& M, 
double (op)(
double));
 
  287yarp::sig::Vector 
map(
const yarp::sig::Vector& v, 
double (op)(
double));
 
  296yarp::sig::Matrix 
map(
const yarp::sig::Matrix& M, 
double (op)(
double));
 
  305yarp::sig::Matrix& 
cosmat(yarp::sig::Matrix& M);
 
  314yarp::sig::Matrix& 
sinmat(yarp::sig::Matrix& M);
 
  323yarp::sig::Vector& 
cosvec(yarp::sig::Vector& v);
 
  332yarp::sig::Vector& 
sinvec(yarp::sig::Vector& v);
 
  341yarp::sig::Matrix 
cosmat(
const yarp::sig::Matrix& M);
 
  350yarp::sig::Matrix 
sinmat(
const yarp::sig::Matrix& M);
 
  359yarp::sig::Vector 
cosvec(
const yarp::sig::Vector& v);
 
  368yarp::sig::Vector 
sinvec(
const yarp::sig::Vector& v);
 
 
void cholupdate(yarp::sig::Matrix &R, const yarp::sig::Vector &x, yarp::sig::Vector &c, yarp::sig::Vector &s, yarp::sig::Matrix &Z, const yarp::sig::Vector &y, yarp::sig::Vector &rho, bool rtrans=0, bool ztrans=0)
Perform a rank-1 update to a Cholesky factor, while updating additional vectors using the used Given'...
 
yarp::sig::Vector & cosvec(yarp::sig::Vector &v)
Computes the cosine of a vector element-wise inplace.
 
yarp::sig::Matrix outerprod(const yarp::sig::Vector &v1, const yarp::sig::Vector &v2)
Computes the outer product of two vectors.
 
void gsl_linalg_cholesky_update(gsl_matrix *R, gsl_vector *x, gsl_vector *c, gsl_vector *s, gsl_matrix *Z=NULL, gsl_vector *y=NULL, gsl_vector *rho=NULL, unsigned char rtrans=0, unsigned char ztrans=0)
 
void dchud(double *r, int ldr, int p, double *x, double *z, int ldz, int nz, double *y, double *rho, double *c, double *s, unsigned char rtrans=0, unsigned char ztrans=0)
Mathematical helper functions for use in the learningMachine library.
 
void fillrandom(yarp::sig::Vector &v, yarp::math::RandScalar &prng)
Fills an entire vector using the provided pseudo random number generator.
 
yarp::sig::Vector & map(yarp::sig::Vector &v, double(op)(double))
Performs a unary operator inplace on each element of a vector.
 
yarp::sig::Vector random(int length, yarp::math::RandScalar &prng)
Returns a random vector with given dimensionality.
 
void cholsolve(const yarp::sig::Matrix &R, const yarp::sig::Matrix &B, yarp::sig::Matrix &X)
Solves a system A*x=b for multiple row vectors in B using a precomputed Cholesky factor R.
 
yarp::sig::Vector & addvec(yarp::sig::Vector &v, double val)
Adds a scalar to a vector inplace.
 
yarp::sig::Matrix & cosmat(yarp::sig::Matrix &M)
Computes the cosine of a matrix element-wise inplace.
 
yarp::sig::Matrix & sinmat(yarp::sig::Matrix &M)
Computes the sine of a matrix element-wise inplace.
 
yarp::sig::Vector & sinvec(yarp::sig::Vector &v)
Computes the sine of a vector element-wise inplace.
 
void trsolve(const yarp::sig::Matrix &A, const yarp::sig::Vector &b, yarp::sig::Vector &x, bool transa=false)
Solves a triangular linear system Ax=b where A is triangular.
 
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.